chore: migrate code-snippet - #616
Merged
Merged
Conversation
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
# Conflicts: # .changeset/config.json # pnpm-lock.yaml
… and jest globals The frontend was migrated without an eslint config, so the monorepo root lint flagged App.vue (acquireVsCodeApi is undefined), the ESM .js files (import/export needed sourceType module) and the jest test globals. Add a package level .eslintrc.js that declares the webview global, sets sourceType module with a modern ecmaVersion, enables the jest env for tests, and keeps the legacy single-word component name. Matches the task-explorer frontend approach. Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
…ce break Merging main and regenerating the lockfile re-bound vuetify to vue@3.4.3 (task-explorer's vue_frontend_rpc pins it), which breaks inquirer-gui's plugin tests with 'app.onUnmount is not a function' (a Vue 3.5 API). Pin vue workspace-wide so only one version resolves. Same fix as the cloud-foundry-tools migration. Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
# Conflicts: # pnpm-lock.yaml
# Conflicts: # pnpm-lock.yaml
The migration added a bare yeoman-generator@4.12.0 dependency. The
standalone repo used the module without declaring it, relying on flat
node_modules hoisting. In pnpm's isolated layout that pin changed which
yeoman-generator version is hoisted to node_modules/.pnpm/node_modules,
and yeoman-env-v3's webpack bundle resolves yeoman-environment@3.19.3's
undeclared require('yeoman-generator') through that hoist. With 4.12.0
hoisted the bundle pulled in istextorbinary@2.6.0 -> editions@2.3.1 ->
errlop@2.2.0/edition-browsers (ESM mis-parsed as CJS), failing the
yeoman-env-v3 build. On main the hoist is yeoman-generator@8.2.2 and the
bundle is clean.
code-snippet only uses Generator as a type (code-snippet.ts:23) and the
package is not in the emitted bundle, so no runtime dependency is needed.
Removing it restores main's hoist decision. Keep @types/yeoman-generator
so Generator resolves to a real type; without it eslint's
no-redundant-type-constituents fires on `Generator | undefined`.
Verified locally on Node 24: eslint clean, tsc clean, 50 tests pass,
backend bundle clean and free of yeoman-generator, and yeoman-env-v3
compiles with the same 6 warnings as main.
Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
jacob-kreyenbuehl
force-pushed
the
migration/code-snippet
branch
from
September 23, 2026 13:41
d00994a to
15c4b74
Compare
# Conflicts: # .changeset/config.json # pnpm-lock.yaml
Adding the code-snippet packages makes pnpm resolve @types/vscode afresh for two third-party type packages: @sap-devx/code-snippet-types @types/vscode: ^1.48.0 @sap/artifact-management-base-types @types/vscode: >=1.52.0 < 2.0.0 Both loose ranges now pick 1.138.0 instead of the 1.75.0 the repository already uses. Two @types/vscode copies then land in app-studio-toolkit-types' program and its compile fails with TS6200 (duplicate identifiers), TS2374 and TS2717. Main never hit this because its lockfile already binds those two to 1.75.0 and pnpm install does not re-resolve existing entries. Scoped overrides keep that binding stable for any future install too. Verified locally: app-studio-toolkit-types compiles, eslint clean, yeoman-env-v3 bundle compiles with the same 6 warnings as main, and the lockfile passes --frozen-lockfile. Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
The migration copied the source's thresholds (lines 99, statements 99, branches 98, functions 97) but also changed temp-dir from ./reports/.nyc_output to ./.nyc_output. Two consequences: - the package dropped into the default .nyc_output, which the root merged-coverage gate globs; - its own thresholds are unreachable here (nyc 15 accounting on the same tests gives 94.67 lines / 92.13 statements / 78.72 branches / 87.93 functions), so its own check failed. This matches the pattern the playbook prescribes for VS Code extension backends, as done in PR #624: redirect the package's nyc output to ./reports/.nyc_output and keep realistic thresholds it enforces itself. Verified locally on Node 24: coverage passes, bundle clean, 50 tests. Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
The source pinned the deprecated vsce@1.x with 'vsce package --yarn', which shells out to yarn and does not exist in this pnpm monorepo. The migration only swapped the flag to --no-yarn, so 'vsce package' still failed on 'npm list --production' in the workspace. Use the monorepo standard from the playbook (and PR #624): depend on @vscode/vsce 2.24.0 and run 'vsce package --no-dependencies'. The extension is webpack-bundled, so vsce does not need to walk runtime deps. Verified locally on Node 24: the package's full ci now completes (compile, coverage, bundle, frontend:copy, package, coverage:copy). Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
Contributor
Build ReportPlease note:
|
…jest config The flat <rootDir>/node_modules form matches nothing under pnpm, where dependencies resolve into <workspaceRoot>/node_modules/.pnpm, so nothing was being scoped deliberately. Use the .pnpm allow-list form like the other migrated frontends, covering the ESM deps this package pulls (@sap-devx/*, vuetify, lodash). Verified: 17 tests pass, same as before the change. Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
The frontend had both .eslintrc.js and a package.json eslintConfig. ESLint uses the .eslintrc.js, so the package.json block was dead: --print-config showed its env (vue/setup-compiler-macros) was not applied. The root .eslintrc.js already extends plugin:vue/vue3-essential for .vue files, so nothing is lost. Verified: repo-wide eslint --max-warnings=0 is clean. Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
The wrapper still used the deprecated vsce@^1.x with 'package --no-yarn' and wrote coverage to the default ./.nyc_output, which the root merge-coverage globs into the 100% gate. Align it with the backend and with PR #624: @vscode/vsce 2.24.0 + 'vsce package --no-dependencies', and redirect nyc output to ./reports/.nyc_output. Verified: the wrapper's full ci passes (2 tests, 100% coverage, bundle, vsce package, coverage:copy). Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
- backend README preview image and frontend README inquirer-gui link pointed at the retired standalone repos - types README linked SAP/code-snippet issues and a ./CONTRIBUTING.md that does not exist in that package - all four package CHANGELOG.md files were headed with the folder name; changesets writes the package name Signed-off-by: Jacob Kreyenbuehl <jacob.kreyenbuehl@sap.com>
…eview Fidelity reverts to source (migration stays faithful): - backend + wrapper webpack.config.js: restore node.global=true. It is a no-op under target:node (global exists in the VS Code host), but the source and the already-migrated yeoman-ui/guided-development backends keep it. - backend + wrapper .vscodeignore: restore the source contents. The migration-added parent-dir excludes change nothing (vsix contents are byte-identical with and without them, verified by packaging both ways) Findings from the independent review that were in scope: - example vscode-snippet-contrib: package script used the deprecated vsce 1.x with --no-yarn and did not even declare it, so it failed if run; now on @vscode/vsce 2.24.0 with --no-dependencies like the rest. - frontend: removed the dead 'lint' script (vue-cli-service is not a dependency here; the same dead script existed in the source repo too). Out of scope (pre-existing in the source repo, byte-identical, so the migration stays faithful): the properties.push TypeError in usage-analytics-wrapper.ts, the un-awaited initHtmlContent in AbstractWebviewPanel.ts, the per-extension log spam in contributors.ts, and the duplicate coverage step in backend ci.
jacob-kreyenbuehl
force-pushed
the
migration/code-snippet
branch
from
September 24, 2026 08:29
e48cbf1 to
fa5d143
Compare
rolanbadrislamov
self-requested a review
September 24, 2026 08:41
rolanbadrislamov
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the Code Snippet framework from
SAP/code-snippetinto the app-studio-toolkit monorepo underprojects/code-snippet.Key changes
@sap-devx/code-snippet-typespackage plus private backend, frontend, wrapper, and example workspaces.CHANGELOG.old.mdand updates project documentation and package links.Behaviour
No changeset is included because this is a relocation-only migration. The maintenance-release changeset will be created after this PR merges. Scoped package CI, Prettier, and ESLint are green.
Reviewer's guide
95 files changed, but most are a source lift. Review in this order:
.changeset/config.json, workspace discovery, package metadata, and the public types package.tsconfig.base.json, root ESLint override, nyc/mocha scripts, webpack, and VSIX ignore files.workspace:*relationships.Not in this PR (deliberately): no changeset or release/version bump.
@sap-devx/code-snippet-typesalready exists on npm at2.0.0; its maintenance release must be handled in the post-merge changeset PR.