@jsonpages/cli 3.0.10 → 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 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonpages/cli",
3
- "version": "3.0.10",
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.2'); // Bump version
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,25 +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
- 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 });
141
+ // Eseguiamo npm install senza argomenti, perché le dipendenze sono già nel package.json
142
+ await execa(npmCmd, ['install'], { cwd: targetDir });
156
143
 
157
144
  spinner.succeed(chalk.green.bold('✨ Tenant Ready!'));
158
145
 
@@ -169,6 +156,8 @@ program
169
156
  });
170
157
 
171
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.
172
161
  const pkg = {
173
162
  name: name,
174
163
  private: true,
@@ -178,6 +167,33 @@ async function injectInfraFiles(targetDir, name) {
178
167
  "dev": "vite",
179
168
  "build": "tsc && vite build",
180
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"
181
197
  }
182
198
  };
183
199
  await fs.writeJson(path.join(targetDir, 'package.json'), pkg, { spaces: 2 });