diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index 5ffe10c3e..9667d75a8 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -80,13 +80,17 @@ jobs: env: NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth. npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config. - run: npm publish --tag $RELEASE_CHANNEL --workspaces + run: | + npm publish --tag $RELEASE_CHANNEL --workspaces + npm publish --tag $RELEASE_CHANNEL - name: Dry-run Firebolt SDKs to NPM if: steps.check_build.outputs.files_exists == 'true' && (github.ref_name == 'main' && github.event_name != 'workflow_dispatch') env: NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth. npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config. - run: npm publish --tag $RELEASE_CHANNEL --workspaces --dry-run + run: | + npm publish --tag $RELEASE_CHANNEL --workspaces --dry-run + npm publish --tag $RELEASE_CHANNEL --dry-run - name: Checkout firebolt GitHub.io repository if: steps.check_build.outputs.files_exists == 'true' env: diff --git a/.npmignore b/.npmignore index f02d3d175..381406f94 100644 --- a/.npmignore +++ b/.npmignore @@ -1,20 +1,10 @@ .github/* .husky/* .DS_Store +build/* +src/* +test/* *.config.js* .releaserc .commitlintrc.json -src/descriptions/* -src/js/* -src/openrpc/* -src/schemas/* -src/template/* -src/sdks/*/build/* -src/sdks/*/src/* -src/sdks/*/test/* -src/sdks/*/jest.config.json -src/sdks/*/sdk.config.json -src/sdks/*/tsconfig.json -src/sdks/*/.* -test/* push-docs.sh diff --git a/package.json b/package.json index 713f770b0..7ff3911ea 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run test:setup && NODE_OPTIONS=--experimental-vm-modules npx --config=jest.config.json --detectOpenHandles jest", "clean": "rm -rf dist && npm run clean --workspaces", "dist": "npm run fs:setup && npm run validate:each && npm run compile && npm run specification && npm run version && npm run dist:notest --workspaces && npm run test", - "specification": "node ./src/js/version-specification/index.mjs --source ./src/json/firebolt-specification.json", + "specification": "node ./src/js/version-specification/index.mjs --source ./src/json/firebolt-specification.json --legacy-versions 0", "specification:report": "node ./src/js/version-specification/index.mjs --source ./dist/firebolt-specification.json --report", "version": "node ./src/js/version.mjs sync", "dev:setup": "husky install", diff --git a/src/js/version-specification/apis.mjs b/src/js/version-specification/apis.mjs index 08ba3ab22..0259630f0 100644 --- a/src/js/version-specification/apis.mjs +++ b/src/js/version-specification/apis.mjs @@ -155,13 +155,13 @@ const run = async (version, parsedArgs) => { return new Promise( async (resolve, reject) => { let legacy = major-1 - while (legacy>major-parsedArgs['legacy-versions']-1 && legacy>0) { + while (legacy>=major-parsedArgs['legacy-versions'] && legacy >= 0) { const v = `${legacy}.x` // create a temporary npm package and install the version of Firebolt we want to grab - await exec(`cd build; mkdir temp${legacy}; cd temp${legacy}; npm init -y ; npm install --saveDev @firebolt-js/sdk@${v}`) + await exec(`cd build; mkdir temp${legacy}; cd temp${legacy}; npm init -y ; npm install --saveDev @firebolt-js/apis@${v}`) - version.apis[`${legacy}`] = await loadJson(`./build/temp${legacy}/node_modules/@firebolt-js/sdk/dist/firebolt-open-rpc.json`) + version.apis[`${legacy}`] = await loadJson(`./build/temp${legacy}/node_modules/@firebolt-js/apis/dist/firebolt-open-rpc.json`) await exec(`cd build; rm -r temp${legacy}`) logSuccess(`Added version ${v}`) diff --git a/src/js/version-specification/index.mjs b/src/js/version-specification/index.mjs index ec7c03b8e..aa48bd757 100644 --- a/src/js/version-specification/index.mjs +++ b/src/js/version-specification/index.mjs @@ -9,7 +9,7 @@ const loadJson = file => readFile(file).then(data => JSON.parse(data.toString()) const knownOpts = { 'capabilities': [Boolean], - 'legacy-support': [Number], + 'legacy-versions': [Number], 'source': [String], 'report': [Boolean] }