From 25e4280d6e8fce0abf3c0076955fd651c71c02d2 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 24 Jul 2025 15:56:19 -0700 Subject: [PATCH 1/4] Fix ci run target I think we need the specific branch name --- .github/workflows/ci.yml | 9 +++++---- .scripts/samples.ts | 43 ++++++++++++++++++++-------------------- .scripts/validate.ts | 13 +++++++++++- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb6d4f08..b4541846 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,13 +2,14 @@ name: CI on: pull_request: - branches: [ $default-branch ] + branches: + - main jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - run: npm run validate \ No newline at end of file + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - run: npm run validate diff --git a/.scripts/samples.ts b/.scripts/samples.ts index b5733b41..cb66056a 100644 --- a/.scripts/samples.ts +++ b/.scripts/samples.ts @@ -291,38 +291,39 @@ export const samples: Sample[] = [ apis: [], contributions: [] }, + { description: 'authenticationprovider-sample', excludeFromReadme: true, path: 'authenticationprovider-sample', guide: null, apis: [], contributions: [] }, { description: 'configuration-sample', excludeFromReadme: true, path: 'configuration-sample', guide: null, apis: [], contributions: [] }, { description: 'contentprovider-sample', excludeFromReadme: true, path: 'contentprovider-sample', guide: null, apis: [], contributions: [] }, - { description: 'nodefs-provider-sample', excludeFromReadme: true, path: 'nodefs-provider-sample', guide: null, apis: [], contributions: [] }, - { description: 'progress-sample', excludeFromReadme: true, path: 'progress-sample', guide: null, apis: [], contributions: [] }, - { description: 'quickinput-sample', excludeFromReadme: true, path: 'quickinput-sample', guide: null, apis: [], contributions: [] }, { description: 'diagnostic-related-information-sample', excludeFromReadme: true, path: 'diagnostic-related-information-sample', guide: null, apis: [], contributions: [] }, - { description: 'fsconsumer-sample', excludeFromReadme: true, path: 'fsconsumer-sample', guide: null, apis: [], contributions: [] }, - { description: 'github-authentication-sample', excludeFromReadme: true, path: 'github-authentication-sample', guide: null, apis: [], contributions: [] }, - { description: 'helloworld-sample', excludeFromReadme: true, path: 'helloworld-sample', guide: null, apis: [], contributions: [] }, - { description: 'helloworld-minimal-sample', excludeFromReadme: true, path: 'helloworld-minimal-sample', guide: null, apis: [], contributions: [] }, - { description: 'helloworld-test-sample', excludeFromReadme: true, path: 'helloworld-test-sample', guide: null, apis: [], contributions: [] }, - { description: 'helloworld-web-sample', excludeFromReadme: true, path: 'helloworld-web-sample', guide: null, apis: [], contributions: [] }, - { description: 'helloworld-test-cli-sample', excludeFromReadme: true, path: 'helloworld-test-cli-sample', guide: null, apis: [], contributions: [] }, - { description: 'inline-completions', excludeFromReadme: true, path: 'inline-completions', guide: null, apis: [], contributions: [] }, - { description: 'notebook-renderer-react-sample', excludeFromReadme: true, path: 'notebook-renderer-react-sample', guide: null, apis: [], contributions: [] }, - { description: 'notebook-format-code-action-sample', excludeFromReadme: true, path: 'notebook-format-code-action-sample', guide: null, apis: [], contributions: [] }, - { description: 'notebook-serializer-sample', excludeFromReadme: true, path: 'notebook-serializer-sample', guide: null, apis: [], contributions: [] }, - { description: 'proposed-api-sample', excludeFromReadme: true, path: 'proposed-api-sample', guide: null, apis: [], contributions: [] }, - { description: 'virtual-document-sample', excludeFromReadme: true, path: 'virtual-document-sample', guide: null, apis: [], contributions: [] }, - { description: 'welcome-view-content-sample', excludeFromReadme: true, path: 'welcome-view-content-sample', guide: null, apis: [], contributions: [] }, { description: 'document-paste', excludeFromReadme: true, path: 'document-paste', guide: null, apis: [], contributions: [] }, { description: 'drop-on-document', excludeFromReadme: true, path: 'drop-on-document', guide: null, apis: [], contributions: [] }, - { description: 'uri-handler-sample', excludeFromReadme: true, path: 'uri-handler-sample', guide: null, apis: [], contributions: [] }, - { description: 'authenticationprovider-sample', excludeFromReadme: true, path: 'authenticationprovider-sample', guide: null, apis: [], contributions: [] }, + { description: 'fsconsumer-sample', excludeFromReadme: true, path: 'fsconsumer-sample', guide: null, apis: [], contributions: [] }, + { description: 'github-authentication-sample', excludeFromReadme: true, path: 'github-authentication-sample', guide: null, apis: [], contributions: [] }, + { description: 'helloworld-minimal-sample', excludeFromReadme: true, path: 'helloworld-minimal-sample', guide: null, apis: [], contributions: [] }, + { description: 'helloworld-sample', excludeFromReadme: true, path: 'helloworld-sample', guide: null, apis: [], contributions: [] }, + { description: 'helloworld-test-cli-sample', excludeFromReadme: true, path: 'helloworld-test-cli-sample', guide: null, apis: [], contributions: [] }, + { description: 'helloworld-test-sample', excludeFromReadme: true, path: 'helloworld-test-sample', guide: null, apis: [], contributions: [] }, + { description: 'helloworld-web-sample', excludeFromReadme: true, path: 'helloworld-web-sample', guide: null, apis: [], contributions: [] }, + { description: 'inline-completions', excludeFromReadme: true, path: 'inline-completions', guide: null, apis: [], contributions: [] }, { description: 'jupyter-kernel-execution-sample', excludeFromReadme: true, path: 'jupyter-kernel-execution-sample', guide: null, apis: [], contributions: [] }, + { description: 'lm-api-tutorial', excludeFromReadme: true, path: 'lm-api-tutorial', guide: null, apis: [], contributions: [] }, + { description: 'mcp-extension-sample', excludeFromReadme: true, path: 'mcp-extension-sample', guide: null, apis: [], contributions: [] }, + { description: 'nodefs-provider-sample', excludeFromReadme: true, path: 'nodefs-provider-sample', guide: null, apis: [], contributions: [] }, + { description: 'notebook-format-code-action-sample', excludeFromReadme: true, path: 'notebook-format-code-action-sample', guide: null, apis: [], contributions: [] }, + { description: 'notebook-renderer-react-sample', excludeFromReadme: true, path: 'notebook-renderer-react-sample', guide: null, apis: [], contributions: [] }, + { description: 'notebook-serializer-sample', excludeFromReadme: true, path: 'notebook-serializer-sample', guide: null, apis: [], contributions: [] }, + { description: 'progress-sample', excludeFromReadme: true, path: 'progress-sample', guide: null, apis: [], contributions: [] }, + { description: 'proposed-api-sample', excludeFromReadme: true, path: 'proposed-api-sample', guide: null, apis: [], contributions: [] }, + { description: 'quickinput-sample', excludeFromReadme: true, path: 'quickinput-sample', guide: null, apis: [], contributions: [] }, { description: 'shell-integration-sample', excludeFromReadme: true, path: 'shell-integration-sample', guide: null, apis: [], contributions: [] }, { description: 'tabs-api-sample', excludeFromReadme: true, path: 'tabs-api-sample', guide: null, apis: [], contributions: [] }, { description: 'telemetry-sample', excludeFromReadme: true, path: 'telemetry-sample', guide: null, apis: [], contributions: [] }, - { description: 'lm-api-tutorial', excludeFromReadme: true, path: 'lm-api-tutorial', guide: null, apis: [], contributions: [] }, - { description: 'wasm-component-model', excludeFromReadme: true, path: 'wasm-component-model', guide: null, apis: [], contributions: [] }, + { description: 'uri-handler-sample', excludeFromReadme: true, path: 'uri-handler-sample', guide: null, apis: [], contributions: [] }, + { description: 'virtual-document-sample', excludeFromReadme: true, path: 'virtual-document-sample', guide: null, apis: [], contributions: [] }, { description: 'wasm-component-model-async', excludeFromReadme: true, path: 'wasm-component-model-async', guide: null, apis: [], contributions: [] }, { description: 'wasm-component-model-resource', excludeFromReadme: true, path: 'wasm-component-model-resource', guide: null, apis: [], contributions: [] }, + { description: 'wasm-component-model', excludeFromReadme: true, path: 'wasm-component-model', guide: null, apis: [], contributions: [] }, + { description: 'welcome-view-content-sample', excludeFromReadme: true, path: 'welcome-view-content-sample', guide: null, apis: [], contributions: [] }, ] /** diff --git a/.scripts/validate.ts b/.scripts/validate.ts index 5e0e75a6..405a21f7 100644 --- a/.scripts/validate.ts +++ b/.scripts/validate.ts @@ -16,6 +16,9 @@ function validateSamplesAreListed() { samplesByPath.set(sample.path, sample); } + + const errors: Error[] = []; + for (const fileName of fs.readdirSync(root)) { if (fileName === 'node_modules' || fileName.startsWith('.') @@ -26,7 +29,15 @@ function validateSamplesAreListed() { const sampleEntry = samplesByPath.get(fileName); if (!sampleEntry) { - throw new Error(`Sample '${fileName}' is not listed in samples.js`); + errors.push(new Error(`Sample '${fileName}' is not listed in samples.js`)); + } + } + + if (errors.length > 0) { + if (errors.length === 1) { + throw errors[0]; + } else { + throw new AggregateError(errors, 'Multiple samples are not listed in samples.js'); } } } From 7c8d5ea5c0d231617240ea6e681479b193667d3f Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 24 Jul 2025 16:00:52 -0700 Subject: [PATCH 2/4] Also run install --- .github/workflows/ci.yml | 1 + package-lock.json | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4541846..12ef8881 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,4 +12,5 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 + - run: npm ci --workspaces=false - run: npm run validate diff --git a/package-lock.json b/package-lock.json index 7bc3e745..32002a1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@types/node": "^22.8.2", "glob": "^11.0.0", "tsx": "^4.19.2", - "typescript": "^5.6.3" + "typescript": "^5.8.2" } }, "node_modules/@esbuild/aix-ppc64": { @@ -865,10 +865,11 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1493,9 +1494,9 @@ } }, "typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true }, "undici-types": { From 0f4e3b328032ada51256dd26c39fcd877dad4cf2 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 24 Jul 2025 16:02:26 -0700 Subject: [PATCH 3/4] Use better script names --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f1733a03..aaec1741 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "version": "0.0.1", "private": true, "scripts": { - "compile": "tsx .scripts/run-script.ts compile", - "lint": "tsx .scripts/run-script.ts lint", - "install": "tsx .scripts/run-command.ts npm install", - "auditFix": "tsx .scripts/run-command.ts npm audit fix", + "compile-all": "tsx .scripts/run-script.ts compile", + "lint-all": "tsx .scripts/run-script.ts lint", + "install-all": "tsx .scripts/run-command.ts npm install", + "audit-fix-all": "tsx .scripts/run-command.ts npm audit fix", "update-readme": "tsx .scripts/update-readme.ts", "update-lsif": "tsx .scripts/update-lsif.ts", "validate": "tsx .scripts/validate.ts" @@ -19,4 +19,4 @@ "tsx": "^4.19.2", "typescript": "^5.8.2" } -} +} \ No newline at end of file From 51465288485a46a4fc6ef9500960fdfbd6fb7498 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 24 Jul 2025 16:03:35 -0700 Subject: [PATCH 4/4] Add missing sample --- .scripts/samples.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/.scripts/samples.ts b/.scripts/samples.ts index cb66056a..3dda0340 100644 --- a/.scripts/samples.ts +++ b/.scripts/samples.ts @@ -293,6 +293,7 @@ export const samples: Sample[] = [ }, { description: 'authenticationprovider-sample', excludeFromReadme: true, path: 'authenticationprovider-sample', guide: null, apis: [], contributions: [] }, { description: 'configuration-sample', excludeFromReadme: true, path: 'configuration-sample', guide: null, apis: [], contributions: [] }, + { description: 'chat-model-provider-sample', excludeFromReadme: true, path: 'chat-model-provider-sample', guide: null, apis: [], contributions: [] }, { description: 'contentprovider-sample', excludeFromReadme: true, path: 'contentprovider-sample', guide: null, apis: [], contributions: [] }, { description: 'diagnostic-related-information-sample', excludeFromReadme: true, path: 'diagnostic-related-information-sample', guide: null, apis: [], contributions: [] }, { description: 'document-paste', excludeFromReadme: true, path: 'document-paste', guide: null, apis: [], contributions: [] },