@nqlib/nqui 0.4.1 → 0.4.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.
|
@@ -230,57 +230,15 @@ If a version had bugs (e.g. init-cursor routed to wrong script, skills not worki
|
|
|
230
230
|
npm deprecate @nqlib/nqui@0.4.1 "Use 0.4.2 instead. See changelog."
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
4. **Unpublish** (rare, npm restrictions apply):
|
|
233
|
+
4. **Unpublish** (rare, npm restrictions apply):
|
|
234
|
+
- Must be within 72 hours of publish
|
|
235
|
+
- No other packages can depend on it
|
|
236
|
+
- `npm unpublish @nqlib/nqui@0.4.1 --force`
|
|
234
237
|
|
|
235
238
|
**Recommendation:** Usually deprecate + publish patch. Unpublish only for security issues.
|
|
236
239
|
|
|
237
240
|
---
|
|
238
241
|
|
|
239
|
-
## Unpublishing
|
|
240
|
-
|
|
241
|
-
### npmjs.com
|
|
242
|
-
|
|
243
|
-
**Rules:**
|
|
244
|
-
- **Within 72 hours of publish**: You can unpublish. The version is then available for re-publish.
|
|
245
|
-
- **After 72 hours**: Unpublish is disallowed. Versions are permanently locked. Use deprecation instead.
|
|
246
|
-
|
|
247
|
-
**Unpublish a specific version** (within 72 hours):
|
|
248
|
-
```bash
|
|
249
|
-
cd packages/nqui
|
|
250
|
-
npm unpublish @nqlib/nqui@0.4.1 --force --registry=https://registry.npmjs.com
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
**Unpublish entire package** (within 72 hours, removes all versions):
|
|
254
|
-
```bash
|
|
255
|
-
npm unpublish @nqlib/nqui --force --registry=https://registry.npmjs.com
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
**After 72 hours – deprecate instead:**
|
|
259
|
-
```bash
|
|
260
|
-
npm deprecate @nqlib/nqui@0.4.1 "Superseded by 0.4.2. Use npm install @nqlib/nqui@0.4.2"
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### GitHub Packages
|
|
264
|
-
|
|
265
|
-
**Rules:**
|
|
266
|
-
- You can delete any version at any time.
|
|
267
|
-
- Deleted versions can be re-published (unlike npm).
|
|
268
|
-
|
|
269
|
-
**Delete via GitHub UI:**
|
|
270
|
-
1. Go to your repo → **Packages** (right sidebar) or `https://github.com/ORG/REPO/packages`
|
|
271
|
-
2. Click the package `nqui`
|
|
272
|
-
3. **Manage package** → **Delete package** (entire package) or **Manage versions** → delete specific versions
|
|
273
|
-
|
|
274
|
-
**Delete via GitHub API** (for automation):
|
|
275
|
-
```bash
|
|
276
|
-
# Requires GITHUB_TOKEN with delete:packages
|
|
277
|
-
curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" \
|
|
278
|
-
"https://api.github.com/orgs/nqlib/packages/npm/nqui/versions/VERSION_ID"
|
|
279
|
-
```
|
|
280
|
-
(Get `VERSION_ID` from the package page or API.)
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
242
|
## Version Management
|
|
285
243
|
|
|
286
244
|
The `npm version` command automatically:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nqlib/nqui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "A React component library with enhanced UI components and developer tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/nqui.cjs.js",
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"nqui-setup": "./scripts/post-install.js"
|
|
115
115
|
},
|
|
116
116
|
"dependencies": {
|
|
117
|
+
"@nqlib/nqcode": "workspace:*",
|
|
117
118
|
"@codesandbox/sandpack-react": "^2.20.0",
|
|
118
119
|
"@dnd-kit/core": "^6.3.1",
|
|
119
120
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
@@ -122,6 +123,7 @@
|
|
|
122
123
|
"@fontsource-variable/inter": "^5.2.8",
|
|
123
124
|
"@hugeicons/core-free-icons": "^3.1.1",
|
|
124
125
|
"@hugeicons/react": "^1.1.4",
|
|
126
|
+
"@nqlib/nqappbuilder": "workspace:*",
|
|
125
127
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
126
128
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
127
129
|
"@radix-ui/react-collapsible": "^1.1.12",
|
package/scripts/publish-npmjs.js
CHANGED
|
@@ -19,19 +19,8 @@ const npmrcPath = join(rootDir, '.npmrc');
|
|
|
19
19
|
// Read package.json
|
|
20
20
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
21
21
|
|
|
22
|
-
// Save
|
|
22
|
+
// Save original publishConfig
|
|
23
23
|
const originalPublishConfig = packageJson.publishConfig;
|
|
24
|
-
const originalDependencies = { ...packageJson.dependencies };
|
|
25
|
-
|
|
26
|
-
// Remove workspace:* deps (npm doesn't support workspace: protocol).
|
|
27
|
-
// nqcode/nqappbuilder are dev/showcase-only and not bundled in the library.
|
|
28
|
-
const workspaceDeps = ['@nqlib/nqcode', '@nqlib/nqappbuilder'];
|
|
29
|
-
for (const name of workspaceDeps) {
|
|
30
|
-
if (packageJson.dependencies?.[name] === 'workspace:*') {
|
|
31
|
-
delete packageJson.dependencies[name];
|
|
32
|
-
console.log(` Removed ${name} (workspace dep)`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
24
|
|
|
36
25
|
// Override publishConfig for npmjs.com
|
|
37
26
|
packageJson.publishConfig = {
|
|
@@ -110,17 +99,14 @@ try {
|
|
|
110
99
|
}
|
|
111
100
|
throw error;
|
|
112
101
|
} finally {
|
|
113
|
-
// Restore original publishConfig
|
|
102
|
+
// Restore original publishConfig
|
|
114
103
|
if (originalPublishConfig) {
|
|
115
104
|
packageJson.publishConfig = originalPublishConfig;
|
|
116
105
|
} else {
|
|
117
106
|
delete packageJson.publishConfig;
|
|
118
107
|
}
|
|
119
|
-
if (originalDependencies) {
|
|
120
|
-
packageJson.dependencies = originalDependencies;
|
|
121
|
-
}
|
|
122
108
|
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
|
123
|
-
console.log('🔄 Restored
|
|
109
|
+
console.log('🔄 Restored publishConfig');
|
|
124
110
|
|
|
125
111
|
// Restore .npmrc if it existed
|
|
126
112
|
if (npmrcExists && originalNpmrc !== null) {
|
|
@@ -59,24 +59,11 @@ function getWorkspacePackageDirs(workspaceRoot) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
function isNquiSourceDir(dir) {
|
|
62
|
-
// Must NOT be inside node_modules (that means we're installed as a dep, not dev source)
|
|
63
|
-
if (resolve(dir).includes('node_modules')) return false;
|
|
64
62
|
return existsSync(resolve(dir, 'docs/components/README.md')) &&
|
|
65
63
|
existsSync(resolve(dir, 'package.json')) &&
|
|
66
64
|
readFileSync(resolve(dir, 'package.json'), 'utf8').includes('"name": "@nqlib/nqui"');
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
function findProjectRootFromNodeModules(startDir) {
|
|
70
|
-
let dir = resolve(startDir);
|
|
71
|
-
for (let i = 0; i < 20; i++) {
|
|
72
|
-
if (existsSync(resolve(dir, 'node_modules/@nqlib/nqui'))) return dir;
|
|
73
|
-
const parent = dirname(dir);
|
|
74
|
-
if (parent === dir) break;
|
|
75
|
-
dir = parent;
|
|
76
|
-
}
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
67
|
/**
|
|
81
68
|
* Returns the directory where .cursor/ should be written.
|
|
82
69
|
* Prefers a dir with node_modules/@nqlib/nqui so docs path resolves.
|
|
@@ -85,13 +72,7 @@ function findProjectRootFromNodeModules(startDir) {
|
|
|
85
72
|
* @returns {string} Absolute path to target directory
|
|
86
73
|
*/
|
|
87
74
|
export function resolveTargetDir(startDir) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// 0. Running from node_modules (postinstall as dep) -> use host project root
|
|
91
|
-
if (cwd.includes('node_modules')) {
|
|
92
|
-
const projectRoot = findProjectRootFromNodeModules(cwd);
|
|
93
|
-
if (projectRoot) return projectRoot;
|
|
94
|
-
}
|
|
75
|
+
const cwd = resolve(startDir);
|
|
95
76
|
|
|
96
77
|
// 1. Current dir has nqui in node_modules -> use it
|
|
97
78
|
if (hasNquiInNodeModules(cwd)) return cwd;
|