neutronium 3.4.1 → 3.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.
Files changed (2) hide show
  1. package/cli/index.js +20 -1
  2. package/package.json +8 -3
package/cli/index.js CHANGED
@@ -6,6 +6,7 @@ const path = require('path');
6
6
  const { execSync, exec } = require('child_process');
7
7
  const { transformSync } = require('@babel/core');
8
8
  const { compileProject, compileProjectWatch } = require('../compiler/compiler');
9
+ const { zip } = require("zip-a-folder");
9
10
 
10
11
  const [, , command, ...args] = process.argv;
11
12
 
@@ -182,7 +183,7 @@ async function init() {
182
183
 
183
184
  const folderCmd = createdFolder ? ` cd ${path.basename(targetPath)} \n` : '';
184
185
  console.log('\n✅ Neutronium app is ready!');
185
- console.log(`➡️ Run the following to get started:\n\n${folderCmd} npm start\nto apply favicon:\n neu-cli apply-favicon [favicon path]\n`);
186
+ console.log(`➡️ Run the following to get started:\n\n${folderCmd} npm start\nto apply favicon:\n neu-cli apply-favicon [favicon path]\nto export the project:\n neu-cli [export/ship]`);
186
187
  }
187
188
 
188
189
  // --- CLI Command Routing ---
@@ -265,6 +266,24 @@ switch (command) {
265
266
  }
266
267
  }
267
268
  break;
269
+ case "export":
270
+ case "ship":
271
+ if (fs.existsSync(path.join(process.cwd(), 'dist'))) {
272
+ try {
273
+ (async () => {
274
+ if (!path.join(process.cwd(), 'build')) {
275
+ fs.mkdir(path.join(process,cwd(), 'build'));
276
+ }
277
+ await zip(path.join(process.cwd(), 'dist'), path.join(process.cwd(), 'build'));
278
+ console.log('✅ code exported successfully')
279
+ })
280
+ } catch (err) {
281
+ throw new err;
282
+ }
283
+ } else {
284
+ throw new Error("couldn't find folder 'dist'");
285
+ }
286
+ break;
268
287
  default:
269
288
  console.log('❌ Unknown command.');
270
289
  console.log(`
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "neutronium",
3
- "version": "3.4.1",
3
+ "version": "3.4.3",
4
4
  "description": "Ultra-dense JavaScript framework – maximum performance, minimal overhead",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
7
7
  "types": "./ts-neutronium/index.d.ts",
8
8
  "scripts": {},
9
9
  "exports": {
10
- ".": "./src/index.js"
10
+ ".": {
11
+ "require": "./src/index.js",
12
+ "sandbox": "./sandbox.mjs",
13
+ "compiler": "./compiler/compiler.js"
14
+ }
11
15
  },
12
16
  "bin": {
13
17
  "neu-cli": "cli/index.js"
@@ -36,6 +40,7 @@
36
40
  "chokidar": "^4.0.3",
37
41
  "inquirer": "^12.7.0",
38
42
  "mime": "^4.0.7",
39
- "ws": "^8.18.3"
43
+ "ws": "^8.18.3",
44
+ "zip-a-folder": "^4.0.4"
40
45
  }
41
46
  }