@teaui/cli 1.2.1 → 1.3.6

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/.dist/bin.d.ts CHANGED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/.dist/bin.js CHANGED
@@ -1,2 +1,31 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const commander_1 = require("commander");
5
+ const index_js_1 = require("./index.js");
6
+ const program = new commander_1.Command();
7
+ program
8
+ .name('teaui')
9
+ .description('CLI for creating TeaUI applications')
10
+ .version('1.2.1');
11
+ program
12
+ .command('create')
13
+ .description('Create a new TeaUI application')
14
+ .argument('<name>', 'Name of the application')
15
+ .requiredOption('-f, --framework <framework>', 'Framework to use', value => {
16
+ if (!['react', 'preact', 'none'].includes(value)) {
17
+ throw new Error(`Invalid framework: ${value}. Must be one of: react, preact, none`);
18
+ }
19
+ return value;
20
+ })
21
+ .action(async (name, options) => {
22
+ try {
23
+ (0, index_js_1.create)(name, options);
24
+ }
25
+ catch (error) {
26
+ console.error(`Error creating application: ${error}`);
27
+ process.exit(1);
28
+ }
29
+ });
30
+ program.parse();
2
31
  //# sourceMappingURL=bin.js.map
package/.dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../lib/bin.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../lib/bin.ts"],"names":[],"mappings":";;;AAEA,yCAAiC;AAIjC,yCAAiC;AAEjC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAA;AAE7B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,qCAAqC,CAAC;KAClD,OAAO,CAAC,OAAO,CAAC,CAAA;AAEnB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,gCAAgC,CAAC;KAC7C,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;KAC7C,cAAc,CAAC,6BAA6B,EAAE,kBAAkB,EAAE,KAAK,CAAC,EAAE;IACzE,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CACb,sBAAsB,KAAK,uCAAuC,CACnE,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAC;KACD,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAA4B,EAAE,EAAE;IAC3D,IAAI,CAAC;QACH,IAAA,iBAAM,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC,CAAC,CAAA;AAEJ,OAAO,CAAC,KAAK,EAAE,CAAA"}
package/.dist/index.d.ts CHANGED
@@ -0,0 +1,3 @@
1
+ export declare function create(name: string, options: {
2
+ framework: string;
3
+ }): Promise<void>;
package/.dist/index.js CHANGED
@@ -1,2 +1,19 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create = create;
4
+ const promises_1 = require("fs/promises");
5
+ const path_1 = require("path");
6
+ async function create(name, options) {
7
+ const appPath = (0, path_1.join)(process.cwd(), name);
8
+ await (0, promises_1.mkdir)(appPath, { recursive: true });
9
+ const templatePath = (0, path_1.join)(__dirname, 'frameworks', options.framework);
10
+ const templateFiles = await (0, promises_1.readdir)(templatePath);
11
+ for (const file of templateFiles) {
12
+ const templateFilePath = (0, path_1.join)(templatePath, file);
13
+ const content = await (0, promises_1.readFile)(templateFilePath, 'utf-8');
14
+ const processedContent = content.replace(/\{\{name\}\}/g, name);
15
+ await (0, promises_1.writeFile)((0, path_1.join)(appPath, file), processedContent);
16
+ }
17
+ console.log(`Created new TeaUI application: ${name} with framework: ${options.framework}`);
18
+ }
2
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;AAGA,wBAiBC;AApBD,0CAA+D;AAC/D,+BAAyB;AAElB,KAAK,UAAU,MAAM,CAAC,IAAY,EAAE,OAA4B;IACrE,MAAM,OAAO,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAA;IACzC,MAAM,IAAA,gBAAK,EAAC,OAAO,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;IAEvC,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IACrE,MAAM,aAAa,GAAG,MAAM,IAAA,kBAAO,EAAC,YAAY,CAAC,CAAA;IAEjD,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,gBAAgB,GAAG,IAAA,WAAI,EAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QACjD,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAQ,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;QACzD,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAA;QAC/D,MAAM,IAAA,oBAAS,EAAC,IAAA,WAAI,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,CAAA;IACxD,CAAC;IAED,OAAO,CAAC,GAAG,CACT,kCAAkC,IAAI,oBAAoB,OAAO,CAAC,SAAS,EAAE,CAC9E,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "CLI for @teaui packages",
4
4
  "author": "Colin T.A. Gray <colinta@colinta.com>",
5
5
  "contributors": [],
6
- "version": "1.2.1",
6
+ "version": "1.3.6",
7
7
  "license": "MIT",
8
8
  "preferGlobal": false,
9
9
  "repository": {
@@ -38,10 +38,10 @@
38
38
  "node": ">= 18.12.0"
39
39
  },
40
40
  "dependencies": {
41
- "@teaui/core": "^1.2.1"
41
+ "commander": "^14.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@teaui/shared": "1.1.4"
44
+ "@teaui/shared": "1.3.6"
45
45
  },
46
46
  "scripts": {
47
47
  "clean": "rm -rf .dist/",