@jsonpages/cli 3.0.13 → 3.0.15
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/assets/src_tenant_alpha.sh +1531 -1352
- package/package.json +1 -1
- package/src/index.js +19 -35
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const program = new Command();
|
|
|
16
16
|
program
|
|
17
17
|
.name('jsonpages')
|
|
18
18
|
.description('JsonPages CLI - Sovereign Projection Engine')
|
|
19
|
-
.version('2.0.
|
|
19
|
+
.version('2.0.2'); // Bump version
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* 🧠 THE UNIVERSAL INTERPRETER
|
|
@@ -110,14 +110,13 @@ program
|
|
|
110
110
|
// Windows fix: npm.cmd invece di npm
|
|
111
111
|
const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
112
112
|
|
|
113
|
-
// Usiamo create-vite ma poi sovrascriveremo il package.json
|
|
114
113
|
await execa(npmCmd, ['create', 'vite@latest', '.', '--', '--template', 'react-ts'], { cwd: targetDir });
|
|
115
114
|
spinner.succeed('Environment scaffolded.');
|
|
116
115
|
|
|
117
116
|
// 2. CLEANUP
|
|
118
117
|
spinner.start('Wiping default boilerplate...');
|
|
119
118
|
await fs.emptyDir(path.join(targetDir, 'src'));
|
|
120
|
-
const junk = ['App.css', 'App.tsx', 'main.tsx', 'vite-env.d.ts', 'favicon.ico', 'index.html'
|
|
119
|
+
const junk = ['App.css', 'App.tsx', 'main.tsx', 'vite-env.d.ts', 'favicon.ico', 'index.html'];
|
|
121
120
|
for (const file of junk) {
|
|
122
121
|
await fs.remove(path.join(targetDir, file)).catch(() => {});
|
|
123
122
|
await fs.remove(path.join(targetDir, 'src', file)).catch(() => {});
|
|
@@ -135,11 +134,25 @@ program
|
|
|
135
134
|
await processScriptInNode(scriptPath, targetDir);
|
|
136
135
|
spinner.succeed('Source code and assets projected successfully.');
|
|
137
136
|
|
|
138
|
-
// 5.
|
|
137
|
+
// 5. DEPENDENCY RESOLUTION
|
|
139
138
|
spinner.start('Installing dependencies (this may take a minute)...');
|
|
140
139
|
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
const deps = [
|
|
141
|
+
'react', 'react-dom', 'zod', 'react-router-dom',
|
|
142
|
+
'lucide-react', 'radix-ui',
|
|
143
|
+
'tailwind-merge', 'clsx',
|
|
144
|
+
'file-saver', 'jszip',
|
|
145
|
+
'@jsonpages/core' // Scarica dal registry pubblico
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
const devDeps = [
|
|
149
|
+
'vite', '@vitejs/plugin-react', 'typescript',
|
|
150
|
+
'@tailwindcss/vite', 'tailwindcss',
|
|
151
|
+
'@types/node', '@types/react', '@types/react-dom', '@types/file-saver'
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
await execa(npmCmd, ['install', ...deps], { cwd: targetDir });
|
|
155
|
+
await execa(npmCmd, ['install', '-D', ...devDeps], { cwd: targetDir });
|
|
143
156
|
|
|
144
157
|
spinner.succeed(chalk.green.bold('✨ Tenant Ready!'));
|
|
145
158
|
|
|
@@ -156,8 +169,6 @@ program
|
|
|
156
169
|
});
|
|
157
170
|
|
|
158
171
|
async function injectInfraFiles(targetDir, name) {
|
|
159
|
-
// 🛡️ DEFINIZIONE ESPLICITA DELLE DIPENDENZE
|
|
160
|
-
// Questo assicura che package.json sia la fonte di verità prima dell'installazione.
|
|
161
172
|
const pkg = {
|
|
162
173
|
name: name,
|
|
163
174
|
private: true,
|
|
@@ -167,33 +178,6 @@ async function injectInfraFiles(targetDir, name) {
|
|
|
167
178
|
"dev": "vite",
|
|
168
179
|
"build": "tsc && vite build",
|
|
169
180
|
"preview": "vite preview"
|
|
170
|
-
},
|
|
171
|
-
dependencies: {
|
|
172
|
-
"react": "^19.0.0",
|
|
173
|
-
"react-dom": "^19.0.0",
|
|
174
|
-
"react-router-dom": "^6.30.0", // Pinned v6 per compatibilità Core
|
|
175
|
-
"zod": "^3.24.1",
|
|
176
|
-
"lucide-react": "^0.474.0",
|
|
177
|
-
"radix-ui": "^1.0.1",
|
|
178
|
-
"@base-ui/react": "^1.0.0-alpha.1",
|
|
179
|
-
"class-variance-authority": "^0.7.0",
|
|
180
|
-
"tailwind-merge": "^2.2.0",
|
|
181
|
-
"clsx": "^2.1.0",
|
|
182
|
-
"tw-animate-css": "^0.0.4",
|
|
183
|
-
"file-saver": "^2.0.5",
|
|
184
|
-
"jszip": "^3.10.1",
|
|
185
|
-
"@jsonpages/core": "latest"
|
|
186
|
-
},
|
|
187
|
-
devDependencies: {
|
|
188
|
-
"vite": "^6.0.0",
|
|
189
|
-
"@vitejs/plugin-react": "^4.2.1",
|
|
190
|
-
"typescript": "^5.7.3", // 👈 Qui c'è TSC esplicitamente
|
|
191
|
-
"@tailwindcss/vite": "^4.0.0",
|
|
192
|
-
"tailwindcss": "^4.0.0",
|
|
193
|
-
"@types/node": "^20.0.0",
|
|
194
|
-
"@types/react": "^19.0.0",
|
|
195
|
-
"@types/react-dom": "^19.0.0",
|
|
196
|
-
"@types/file-saver": "^2.0.7"
|
|
197
181
|
}
|
|
198
182
|
};
|
|
199
183
|
await fs.writeJson(path.join(targetDir, 'package.json'), pkg, { spaces: 2 });
|