@jsonpages/cli 3.0.11 → 3.0.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +35 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonpages/cli",
3
- "version": "3.0.11",
3
+ "version": "3.0.12",
4
4
  "description": "JsonPages CLI - Sovereign Projection Engine",
5
5
  "type": "module",
6
6
  "bin": {
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.4'); // Bump version for fix
19
+ .version('2.0.5'); // Bump version
20
20
 
21
21
  /**
22
22
  * 🧠 THE UNIVERSAL INTERPRETER
@@ -110,13 +110,14 @@ 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
113
114
  await execa(npmCmd, ['create', 'vite@latest', '.', '--', '--template', 'react-ts'], { cwd: targetDir });
114
115
  spinner.succeed('Environment scaffolded.');
115
116
 
116
117
  // 2. CLEANUP
117
118
  spinner.start('Wiping default boilerplate...');
118
119
  await fs.emptyDir(path.join(targetDir, 'src'));
119
- const junk = ['App.css', 'App.tsx', 'main.tsx', 'vite-env.d.ts', 'favicon.ico', 'index.html'];
120
+ const junk = ['App.css', 'App.tsx', 'main.tsx', 'vite-env.d.ts', 'favicon.ico', 'index.html', 'package.json', 'package-lock.json'];
120
121
  for (const file of junk) {
121
122
  await fs.remove(path.join(targetDir, file)).catch(() => {});
122
123
  await fs.remove(path.join(targetDir, 'src', file)).catch(() => {});
@@ -134,35 +135,11 @@ program
134
135
  await processScriptInNode(scriptPath, targetDir);
135
136
  spinner.succeed('Source code and assets projected successfully.');
136
137
 
137
- // 5. DEPENDENCY RESOLUTION
138
+ // 5. INSTALLATION (Ora è solo un npm install pulito)
138
139
  spinner.start('Installing dependencies (this may take a minute)...');
139
140
 
140
- // 🛡️ FIX: Pinning delle versioni per evitare ERESOLVE (React Router v6 vs v7)
141
- const deps = [
142
- 'react@^19.0.0',
143
- 'react-dom@^19.0.0',
144
- 'zod@^3.24.1',
145
- 'react-router-dom@^6.30.0', // FIX: Forziamo v6 per compatibilità col Core
146
- 'lucide-react',
147
- 'radix-ui',
148
- '@base-ui/react',
149
- 'class-variance-authority',
150
- 'tailwind-merge',
151
- 'clsx',
152
- 'tw-animate-css',
153
- 'file-saver',
154
- 'jszip',
155
- '@jsonpages/core@latest' // Scarica dal registry pubblico
156
- ];
157
-
158
- const devDeps = [
159
- 'vite', '@vitejs/plugin-react', 'typescript',
160
- '@tailwindcss/vite', 'tailwindcss',
161
- '@types/node', '@types/react', '@types/react-dom', '@types/file-saver'
162
- ];
163
-
164
- await execa(npmCmd, ['install', ...deps], { cwd: targetDir });
165
- await execa(npmCmd, ['install', '-D', ...devDeps], { cwd: targetDir });
141
+ // Eseguiamo npm install senza argomenti, perché le dipendenze sono già nel package.json
142
+ await execa(npmCmd, ['install'], { cwd: targetDir });
166
143
 
167
144
  spinner.succeed(chalk.green.bold('✨ Tenant Ready!'));
168
145
 
@@ -179,6 +156,8 @@ program
179
156
  });
180
157
 
181
158
  async function injectInfraFiles(targetDir, name) {
159
+ // 🛡️ DEFINIZIONE ESPLICITA DELLE DIPENDENZE
160
+ // Questo assicura che package.json sia la fonte di verità prima dell'installazione.
182
161
  const pkg = {
183
162
  name: name,
184
163
  private: true,
@@ -188,6 +167,33 @@ async function injectInfraFiles(targetDir, name) {
188
167
  "dev": "vite",
189
168
  "build": "tsc && vite build",
190
169
  "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"
191
197
  }
192
198
  };
193
199
  await fs.writeJson(path.join(targetDir, 'package.json'), pkg, { spaces: 2 });