chore: migrate xml-tools - #620
Conversation
Raw relocation of the 10 SAP/xml-tools packages into projects/xml-tools/packages/ as-is (no logic changes). Toolchain wiring, tsconfig/eslint alignment, workspace deps and changeset config follow in subsequent commits. Standalone-repo root cruft (lerna.json, .husky, .github, .circleci, yarn.lock, root package.json, root .reuse/LICENSES/LICENSE/CONTRIBUTING, scripts, webpack.config.base.js, .eslintrc.js) is intentionally not migrated; the monorepo root is a superset. Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
Isolated formatting pass with the monorepo's Prettier, kept in its own commit so the whole-tree reflow does not obscure the logic/wiring changes that follow. Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
Adapt the migrated xml-tools packages to build and test under the app-studio-toolkit pnpm workspace: - Intra-project deps -> workspace:*; add missing transitive deps that yarn's flat node_modules had masked (chevrotain, @xml-tools/ast, @xml-tools/common). - package.json: repository.directory + bugs pointing at the monorepo; drop engines.node; drop inline nyc config; list CHANGELOG in files. - Per-package tsconfig.json (noEmit type-check) and nyc.config.js (lib/**/*.js @ 100%), overriding the root's src/** false-green. - language-server: detect the bundled dist/server.js directly instead of keying off node_modules (unreliable under pnpm's symlinks). - xml-toolkit: rework the VSIX packaging for pnpm (resolve the sibling language-server via its node_modules symlink so vsce keeps it a child; copy LICENSE/LICENSES from the monorepo root before mutating pkg.json; drop yarn nohoist coupling). Tighten .vscodeignore/.gitignore. ci runs clean+bundle+package (electron integration tests need a display). - CHANGELOG.md -> CHANGELOG.old.md with a historic-note header; refresh READMEs to point Support/Contributing at the monorepo. Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
Add inline per-project overrides for projects/xml-tools, matching the precedent set by the earlier migrations (vscode-logging etc.): the chevrotain-generated parser sources trip require-yield / no-case-declarations / no-useless-escape, and the api.d.ts type surfaces trip no-explicit-any / no-unused-vars / no-redundant-type-constituents. Relaxed rather than rewriting migrated code; TODO to tighten incrementally. Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
The nine published @xml-tools/* packages share cross-dependencies at the type level (ast/content-assist/etc. re-export parser & common types), so they must publish in lockstep to avoid two versions of the same type at runtime. The private xml-toolkit extension versions independently (its version is the VSIX marketplace version). Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
Build ReportPlease note:
|
…les arrays Address migration-review findings against the OSS monorepo-migration playbook: - Move chevrotain from devDependencies to dependencies in ast, common and content-assist: their published api.d.ts imports IToken from chevrotain, so consumers' type-check needs it installed (a devDep isn't). Previously only worked via pnpm hoisting through @xml-tools/parser. - Add xml-toolkit as its own fixed group in .changeset/config.json. It is a productive VSIX (private:true) that must still version and get a GitHub Release tag; being in neither fixed nor ignore was the wrong state. - Drop .reuse and LICENSES from the 9 published packages' files arrays: those dirs don't exist here (xml-tools ships no per-package REUSE), so the entries pointed at nothing in the npm artifact. Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
Resolve pnpm-lock.yaml conflict by regenerating from the merged manifest set (pnpm install --lockfile-only), which also records the chevrotain devDep->dep move in ast/common/content-assist. All other files auto-merged cleanly. Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
jacob-kreyenbuehl
left a comment
There was a problem hiding this comment.
Reviewed the migration end to end. Nice work, the source lift is clean and CI is green (Full Build compiles, tests, merges coverage, lints, and packages the VSIX).
What I verified (all good)
- Source fidelity: I diffed every moved
lib/test/api.d.tsagainst SAP/xml-tools. 242 files are byte-identical. Only 4 differ: 3 are pure prettier reflow, 1 is the documentedapi.jschange. api.jsSERVER_PATH change: correct. The old check looked atnode_modulesexistence, which does not work under pnpm (pnpm always makes a symlinkednode_modules). Detecting the bundleddist/server.jsdirectly is the right fix.bundledPathmatches the webpack output.- VSIX packaging (
package-vsix.js): well documented, and CI proves it really builds a VSIX. The sibling-via-symlink trick (so the package is a child of the extension dir) is sound. - Coverage: the 9 libraries run
coverage:*and hit the root 100% gate.xml-toolkitruns onlyclean bundle package, so it opts out. This matches the pattern we use for extension backends. - Pinning / privacy / deps: no external consumers of
@xml-tools/*, 21workspace:*intra deps, onlyxml-toolkitis private, and the pnpm strict-isolation deps (chevrotain, ast, common) are declared. The@types/vscodepin has a clear reason comment.
Findings
1. Should fix (owner call): the fixed changeset group changes the version policy and would push a fake major bump to public users
The source repo uses lerna "version": "independent". The 9 packages are on purpose at different versions (ast 5.1.0, common 0.2.0, parser 1.0.11).
A fixed group forces lockstep. I checked this on the repo: both existing fixed groups (vscode-logging at 2.0.9, inquirer-gui at 3.4.13) came from sources that were already unified in lerna, so the fixed group kept their old behavior. xml-tools is the first one coming from an independent source, so here the fixed group is a real policy change.
What happens: the next changeset that touches any one package will snap all 9 to one version. So @xml-tools/common goes 0.2.0 to 5.1.x in a single release. These are public packages with heavy use (@xml-tools/ast is about 22k downloads/week), so thousands of external users get a fake 5 major jump, and every release republishes all 9 even when only 1 changed.
updateInternalDependencies: patch already bumps dependents for you, so lockstep is not needed for correctness. My rec: drop the fixed group and let them version independently, same as the source. If lockstep is what you want, it is a policy change on public packages, so please get an owner sign off first.
2. Nit: ["xml-toolkit"] as a single-item fixed group does nothing
A fixed group needs 2 or more members. task-explorer's private extension is just left out of the config and versions independently by default. Your PR text also says "xml-toolkit versions independently", which is exactly what leaving it out gives you. You can remove this line.
3. Nit: dead script reference
xml-toolkit has "vsix:prepare": "sh prepare-vsix-package.sh", but that file does not exist. Nothing in ci calls it, so it is harmless, but it is dead. Suggest removing it.
4. Needs verify (low): deprecated vsce@1.84.0
The monorepo standard is @vscode/vsce@2.24.0. It works here because the proxyquire hot patch depends on vsce 1.x internals (vsce/out/package, the ./npm getDependencies). This is fine for now because xml-toolkit has to bundle the sibling language-server dist/, which is harder than plain --no-dependencies. But it is a deprecated package with old transitive deps. Not a blocker, just worth a note for later cleanup.
Overall this is a solid, faithful migration. Finding 1 is the only real one, and it is a versioning policy question for public packages, so it needs an owner decision.
- Drop the changeset fixed group. The @xml-tools/* packages ship from an independent-versioned source (ast 5.1.0, common 0.2.0, parser 1.0.11); a fixed group would snap all nine to one version, pushing a fake major bump to public consumers. updateInternalDependencies:patch already bumps dependents, so lockstep is not needed for correctness. Let them version independently, as in the source repo. Also removes the no-op single-member ["xml-toolkit"] group. - Remove the dead vsix:prepare script (prepare-vsix-package.sh does not exist and nothing in ci calls it). Signed-off-by: badrislamovrolan <rolan.badrislamov@sap.com>
FIndings 1, 2, 3 are addressed in d601cc3 |
jacob-kreyenbuehl
left a comment
There was a problem hiding this comment.
Confirmed, both findings are resolved correctly.
- Dropping the fixed group puts the
@xml-tools/*packages back on independent versioning, same as the source repo. Verified the config is valid and xml-tools is now in neitherfixednorignore. ["xml-toolkit"]single-item group removed, and the deadvsix:preparescript is gone with no hanging references.- CI re-ran on the new commit and is fully green.
Thanks for addressing these cleanly. Approving.
Summary
Migrates
SAP/xml-toolsintoprojects/xml-tools/What changed:
projects/xml-tools/packages/(9 published@xml-tools/*libraries + the privatexml-toolkitVS Code extension)workspace:*intra-project deps, per-packagetsconfig/nycconfig, root eslint overridesnode_moduleshad masked (chevrotain,@xml-tools/ast,@xml-tools/common) — surfaced by pnpm's strict isolationlanguage-servernow detects its bundleddist/server.jsdirectly instead of probingnode_modules(unreliable under pnpm symlinks)xml-toolkitVSIX packaging reworked for pnpm (was coupled to yarnnohoist);.vscodeignore/.gitignoretightened@types/vscodekept pinned at1.56.0(minimum supported API); rationale noted inpackage.jsonReviewer's guide
Review in this order:
.eslintrc.js— new overrides scoped toprojects/xml-tools/**, relaxing chevrotain-generated +api.d.tsviolations; mirrors the vscode-logging patternprojects/xml-tools/packages/*/package.json— noprivateon the libraries,workspace:*deps,repository.directory/bugspoint at the monorepo,filesincludes CHANGELOGprojects/xml-tools/packages/xml-toolkit/scripts/package-vsix.js— vsce hot-patch resolves the siblinglanguage-servervia itsnode_modulessymlink so it packages as a child; LICENSE copy is crash-safe (before pkg.json mutation)projects/xml-tools/packages/language-server/lib/api.js—SERVER_PATHdetection change (only non-move logic edit)packages/*/lib&api.d.ts— source lift only, no logic changesNot in this PR