khal-os 1.260326.2 → 1.260326.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/version.yml +21 -11
- package/package.json +1 -1
|
@@ -114,27 +114,37 @@ jobs:
|
|
|
114
114
|
cd packages/npx-cli
|
|
115
115
|
bun build src/cli.ts --outfile dist/cli.js --target node
|
|
116
116
|
|
|
117
|
-
- name:
|
|
117
|
+
- name: Strip workspace deps for npm publish
|
|
118
118
|
run: |
|
|
119
|
-
VERSION="${{ steps.version.outputs.version }}"
|
|
120
119
|
node -e "
|
|
121
120
|
const fs = require('fs');
|
|
122
121
|
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
123
|
-
|
|
122
|
+
// Remove all workspace:* deps — the bundled cli.js has everything inlined
|
|
124
123
|
for (const depType of ['dependencies', 'devDependencies', 'peerDependencies']) {
|
|
125
|
-
|
|
124
|
+
if (!pkg[depType]) continue;
|
|
125
|
+
for (const [key, val] of Object.entries(pkg[depType])) {
|
|
126
126
|
if (typeof val === 'string' && val.startsWith('workspace:')) {
|
|
127
|
-
pkg[depType][key]
|
|
128
|
-
changed = true;
|
|
127
|
+
delete pkg[depType][key];
|
|
129
128
|
}
|
|
130
129
|
}
|
|
130
|
+
if (Object.keys(pkg[depType]).length === 0) delete pkg[depType];
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
// Also strip sub-package workspace refs
|
|
133
|
+
const npxPkg = 'packages/npx-cli/package.json';
|
|
134
|
+
if (fs.existsSync(npxPkg)) {
|
|
135
|
+
const sub = JSON.parse(fs.readFileSync(npxPkg, 'utf8'));
|
|
136
|
+
for (const depType of ['dependencies', 'devDependencies']) {
|
|
137
|
+
if (!sub[depType]) continue;
|
|
138
|
+
for (const [key, val] of Object.entries(sub[depType])) {
|
|
139
|
+
if (typeof val === 'string' && val.startsWith('workspace:')) {
|
|
140
|
+
delete sub[depType][key];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
fs.writeFileSync(npxPkg, JSON.stringify(sub, null, '\t') + '\n');
|
|
137
145
|
}
|
|
146
|
+
fs.writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n');
|
|
147
|
+
console.log('Stripped workspace:* deps for npm publish');
|
|
138
148
|
"
|
|
139
149
|
|
|
140
150
|
- name: Publish to npm
|