khal-os 1.260326.2 → 1.260326.4

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.
@@ -114,33 +114,42 @@ jobs:
114
114
  cd packages/npx-cli
115
115
  bun build src/cli.ts --outfile dist/cli.js --target node
116
116
 
117
- - name: Resolve workspace references for npm
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
- let changed = false;
122
+ // Remove all workspace:* deps — the bundled cli.js has everything inlined
124
123
  for (const depType of ['dependencies', 'devDependencies', 'peerDependencies']) {
125
- for (const [key, val] of Object.entries(pkg[depType] || {})) {
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] = '${VERSION}';
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
- if (changed) {
133
- fs.writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n');
134
- console.log('Resolved workspace:* → ${VERSION}');
135
- } else {
136
- console.log('No workspace references to resolve');
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
141
151
  env:
142
152
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
143
- NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
144
153
  HUSKY: "0"
145
154
  run: |
146
155
  if [ -z "$NPM_TOKEN" ]; then
@@ -148,4 +157,5 @@ jobs:
148
157
  exit 0
149
158
  fi
150
159
  echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
151
- npm publish --access public --tag ${{ steps.context.outputs.npm_tag }} || echo "Publish failed version may already exist"
160
+ # Use pnpm publishit resolves workspace:* automatically
161
+ pnpm publish --access public --tag ${{ steps.context.outputs.npm_tag }} --no-git-checks || echo "Publish failed — version may already exist"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "khal-os",
3
- "version": "1.260326.2",
3
+ "version": "1.260326.4",
4
4
  "bin": {
5
5
  "khal-os": "./packages/npx-cli/dist/cli.js"
6
6
  },