this.gui 1.1.23 → 1.1.24
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/bin/{cli.ts → cli.js} +0 -1
- package/dist/bin/cli.js +38 -0
- package/dist/{this-gui.umd.js → this.gui.umd.js} +17 -17
- package/package.json +2 -2
- package/dist/notes/Proyect.md +0 -109
- package/dist/overall approach.md +0 -93
- package/public/notes/Proyect.md +0 -109
- package/public/overall approach.md +0 -93
- /package/dist/{this-gui.es.js → this.gui.es.js} +0 -0
package/bin/{cli.ts → cli.js}
RENAMED
package/dist/bin/cli.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var child_process = require('child_process');
|
|
5
|
+
var fsExtra = require('fs-extra');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
var url = require('url');
|
|
8
|
+
|
|
9
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
10
|
+
/**
|
|
11
|
+
* This.GUI CLI (TypeScript)
|
|
12
|
+
*
|
|
13
|
+
* Initializes a new This.GUI project using:
|
|
14
|
+
*
|
|
15
|
+
* npx thisgui my-app
|
|
16
|
+
*
|
|
17
|
+
* Compiles to dist/bin/cli.js when the package is built.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const { copySync } = fsExtra;
|
|
21
|
+
const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
22
|
+
const __dirname$1 = path.dirname(__filename$1);
|
|
23
|
+
const appName = process.argv[2] || 'my-app';
|
|
24
|
+
const templateDir = path.resolve(__dirname$1, '../templates');
|
|
25
|
+
const targetDir = path.resolve(process.cwd(), appName);
|
|
26
|
+
console.log(`\n🧩 Creating .GUI project: ${appName}\n`);
|
|
27
|
+
try {
|
|
28
|
+
copySync(templateDir, targetDir);
|
|
29
|
+
console.log(`📁 Project files copied to ${targetDir}`);
|
|
30
|
+
process.chdir(targetDir);
|
|
31
|
+
console.log(`📦 Installing dependencies...\n`);
|
|
32
|
+
child_process.execSync('npm install', { stdio: 'inherit' });
|
|
33
|
+
console.log(`\n✅ Done!\n`);
|
|
34
|
+
console.log(`Next steps:\n cd ${appName}\n npm run storybook\n`);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error('❌ Error creating project:', error);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|