From a1a5c52bfae408fb1568be62bfb39b306cb97479 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Tue, 18 Jun 2024 18:29:18 +0200 Subject: [PATCH] chore: improve update script (#3377) --- .github/workflows/update-dependencies.yml | 14 +++++++--- Spell Checker.code-workspace | 32 +++++++---------------- package.json | 4 ++- website/package.json | 3 ++- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index a000e5688..03f7a26f7 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -1,4 +1,4 @@ -name: ' 🔗 Update Dependencies Main' +name: ' 🔗 Update Dependencies' on: push: @@ -8,16 +8,22 @@ on: - '**/package.json' - '**/package-lock.json' workflow_dispatch: + inputs: + base: + description: The Base Ref to apply the diff + required: false + default: 'main' schedule: - cron: '0 12 * * 0' +env: + NEW_BRANCH: "update-dependencies-${{ inputs.base || 'main' }}" + REF_BRANCH: ${{ inputs.base || 'main' }} + jobs: update-dependencies: if: github.repository_owner == 'streetsidesoftware' runs-on: ubuntu-latest - env: - NEW_BRANCH: 'update-dependencies-main' - REF_BRANCH: main steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/Spell Checker.code-workspace b/Spell Checker.code-workspace index 660294325..eb2daa31a 100644 --- a/Spell Checker.code-workspace +++ b/Spell Checker.code-workspace @@ -28,28 +28,14 @@ "name": "Tools", "path": "tools/build-tools" }, - { - "path": "packages/utils-disposables" - }, - { - "path": "packages/utils-logger" - }, - { - "path": "packages/json-rpc-api" - }, - { - "path": "packages/webview-api" - }, - { - "path": "packages/webview-rpc" - }, - { - "path": "packages/webview-ui" - }, - { - "name": "Docs", - "path": "docs" - } + { "path": "packages/utils-disposables" }, + { "path": "packages/utils-logger" }, + { "path": "packages/json-rpc-api" }, + { "path": "packages/webview-api" }, + { "path": "packages/webview-rpc" }, + { "path": "packages/webview-ui" }, + { "name": "Docs", "path": "docs" }, + { "path": "website" } ], "settings": { "cSpell.import": ["${workspaceFolder:Spell Checker Root}/cspell.config.yaml"], @@ -58,7 +44,7 @@ "editor.formatOnSave": true, "files.eol": "\n", "cSpell.flagWords": [], - "cSpell.enableFiletypes": ["github-actions-workflow"], + "cSpell.enabledFileTypes": { "github-actions-workflow": true }, "svg.preview.background": "dark-transparent" }, "launch": { diff --git a/package.json b/package.json index a7b2e4222..935423c6c 100644 --- a/package.json +++ b/package.json @@ -3995,7 +3995,9 @@ "lint-docs-ci": "prettier -c \"docs/**/*.{md,markdown,yaml,yml,json,html,htm,js,ts}\"", "test-client-integration": "npm --workspace=@internal/integration-tests run test-integration", "test": "npm --workspaces --if-present run test && echo OK", - "update-packages": "npx npm-check-updates --root -ws --target semver -u && npm i", + "update-packages": "npm run update:packages:root && npm run update:packages:website", + "update:packages:root": "npx npm-check-updates --root -ws --target semver -u && npm i", + "update:packages:website": "cd website && npm run update-packages", "preinstall": "npx only-allow npm" }, "devDependencies": { diff --git a/website/package.json b/website/package.json index d30ae01cb..75eeec0b1 100644 --- a/website/package.json +++ b/website/package.json @@ -17,7 +17,8 @@ "gen-docs": "npm run gen-commands && npm run gen-config", "gen-commands": "node ./_scripts/extract-commands.mjs > ./docs/auto_commands.md", "gen-config": "node ./_scripts/extract-config.mjs > ./docs/auto_configuration.md", - "typecheck": "tsc" + "typecheck": "tsc", + "update-packages": "npx npm-check-updates --target semver -u && npm i" }, "dependencies": { "@docusaurus/core": "3.3.2",