Migrate to npm workspaces

This commit is contained in:
Daniel Imms
2025-11-23 09:54:17 -08:00
parent da4ab8a01e
commit bf4fb3ad64
3 changed files with 966 additions and 135 deletions
-45
View File
@@ -1,45 +0,0 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*
* Script to initialize addon packages under "addons/" with outer deps.
*/
const path = require('path');
const cp = require('child_process');
const fs = require('fs');
const PACKAGE_ROOT = path.join(__dirname, '..');
// install addon deps
const addonsPath = path.join(PACKAGE_ROOT, 'addons');
if (fs.existsSync(addonsPath)) {
console.log('pulling addon dependencies...');
// walk all addon folders
fs.readdir(addonsPath, (err, files) => {
for (const folder of files) {
const addonPath = path.join(addonsPath, folder);
// install only if there are dependencies listed
let packageJson;
try {
packageJson = require(path.join(addonPath, 'package.json'));
} catch (e) {
// swallow as changing branches can leave folders around
}
if (packageJson
&& (
(packageJson.devDependencies && Object.keys(packageJson.devDependencies).length)
|| (packageJson.dependencies && Object.keys(packageJson.dependencies).length)
)
)
{
console.log('Preparing', folder);
cp.execSync('npm ci', {cwd: addonPath});
} else {
console.log('Skipped', folder);
}
}
});
}
+963 -88
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -8,6 +8,9 @@
"types": "typings/xterm.d.ts",
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"workspaces": [
"addons/*"
],
"keywords": [
"cli",
"command-line",
@@ -25,8 +28,6 @@
],
"scripts": {
"setup": "npm run build",
"presetup": "npm run install-addons",
"install-addons": "node ./bin/install-addons.js",
"start": "node demo/start",
"build": "npm run tsc",
"watch": "npm run tsc-watch",