Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: add petstore lint test to fix spectral ESM bundling error #8055

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/test-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ jobs:
env:
VERSION: ${{ steps.inso-variables.outputs.inso-version }}

# local dx:
# cp -r packages/insomnia-inso/src/commands/fixtures/with-ruleset ../tempfolder
# npm run build -w insomnia-inso && npm run package -w insomnia-inso && $PWD/packages/insomnia-inso/binaries/inso lint spec ../tempfolder/path-plugin.yaml
- name: Ensure Inso binary can use spectral lint config out of project folder
run: |
cp -r packages/insomnia-inso/src/commands/fixtures/with-ruleset ../tempfolder
echo "Expected: warnings, not ES Module errors"
packages/insomnia-inso/binaries/inso lint spec ../tempfolder/path-plugin.yaml

- name: Run Inso binary e2e tests
run: npm run test:binary -w insomnia-inso

Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions packages/insomnia-inso/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"build": "esr esbuild.ts",
"build:production": "cross-env NODE_ENV=production esr esbuild.ts",
"start": "ESBUILD_WATCH=true esr esbuild.ts",
"prepackage": "npm run build:production && rm -rf binaries/inso",
"package": "npx -y @yao-pkg/[email protected] . --output binaries/inso --targets host",
"package": "rm -rf binaries/inso && npx -y @yao-pkg/[email protected] . --output binaries/inso --targets host",
"postpackage": "node src/scripts/verify-pkg.js",
"artifacts": "esr src/scripts/artifacts.ts"
},
Expand All @@ -41,10 +40,10 @@
},
"dependencies": {
"@seald-io/nedb": "^4.0.4",
"@stoplight/spectral-core": "^1.18.3",
"@stoplight/spectral-formats": "^1.6.0",
"@stoplight/spectral-ruleset-bundler": "^1.5.2",
"@stoplight/spectral-rulesets": "^1.18.1",
"@stoplight/spectral-core": "^1.19.1",
"@stoplight/spectral-formats": "^1.7.0",
"@stoplight/spectral-ruleset-bundler": "1.6.0",
"@stoplight/spectral-rulesets": "^1.20.2",
"@stoplight/types": "^14.1.1",
"commander": "^12.1.0",
"consola": "^2.15.0",
Expand Down
1 change: 1 addition & 0 deletions packages/insomnia-inso/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const shouldReturnSuccessCode = [
// lint spec
// as identifer filepath
'$PWD/packages/insomnia-inso/bin/inso lint spec packages/insomnia-inso/src/commands/fixtures/openapi-spec.yaml',

// as identifier filepath with spectral.yaml
'$PWD/packages/insomnia-inso/bin/inso lint spec packages/insomnia-inso/src/commands/fixtures/with-ruleset/path-plugin.yaml',
// as working directory and identifier filename
Expand Down
8 changes: 4 additions & 4 deletions packages/insomnia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@
"@fortawesome/react-fontawesome": "^0.2.0",
"@getinsomnia/api-client": "0.0.4",
"@sentry/electron": "^5.1.0",
"@stoplight/spectral-core": "^1.18.3",
"@stoplight/spectral-formats": "^1.6.0",
"@stoplight/spectral-ruleset-bundler": "1.5.2",
"@stoplight/spectral-rulesets": "^1.18.1",
"@stoplight/spectral-core": "^1.19.1",
"@stoplight/spectral-formats": "^1.7.0",
"@stoplight/spectral-ruleset-bundler": "1.6.0",
"@stoplight/spectral-rulesets": "^1.20.2",
"@tailwindcss/typography": "^0.5.12",
"@tanstack/react-virtual": "3.2.0",
"@testing-library/dom": "^9.3.4",
Expand Down
Loading