@teaui/cli 1.3.7 → 1.4.8
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.js +4 -6
- package/.dist/bin.js.map +1 -1
- package/.dist/index.js +10 -13
- package/.dist/index.js.map +1 -1
- package/package.json +3 -2
package/.dist/bin.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const index_js_1 = require("./index.js");
|
|
6
|
-
const program = new commander_1.Command();
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { create } from './index.js';
|
|
4
|
+
const program = new Command();
|
|
7
5
|
program
|
|
8
6
|
.name('teaui')
|
|
9
7
|
.description('CLI for creating TeaUI applications')
|
|
@@ -20,7 +18,7 @@ program
|
|
|
20
18
|
})
|
|
21
19
|
.action(async (name, options) => {
|
|
22
20
|
try {
|
|
23
|
-
|
|
21
|
+
create(name, options);
|
|
24
22
|
}
|
|
25
23
|
catch (error) {
|
|
26
24
|
console.error(`Error creating application: ${error}`);
|
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,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAIjC,OAAO,EAAC,MAAM,EAAC,MAAM,YAAY,CAAA;AAEjC,MAAM,OAAO,GAAG,IAAI,OAAO,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,CACb,sDAAsD,EACtD,kBAAkB,EAClB,KAAK,CAAC,EAAE;IACN,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,CACF;KACA,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAA4B,EAAE,EAAE;IAC3D,IAAI,CAAC;QACH,MAAM,CAAC,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.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
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);
|
|
1
|
+
import { mkdir, readFile, writeFile, readdir } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
export async function create(name, options) {
|
|
4
|
+
const appPath = join(process.cwd(), name);
|
|
5
|
+
await mkdir(appPath, { recursive: true });
|
|
6
|
+
const templatePath = join(__dirname, 'frameworks', options.framework);
|
|
7
|
+
const templateFiles = await readdir(templatePath);
|
|
11
8
|
for (const file of templateFiles) {
|
|
12
|
-
const templateFilePath =
|
|
13
|
-
const content = await
|
|
9
|
+
const templateFilePath = join(templatePath, file);
|
|
10
|
+
const content = await readFile(templateFilePath, 'utf-8');
|
|
14
11
|
const processedContent = content.replace(/\{\{name\}\}/g, name);
|
|
15
|
-
await
|
|
12
|
+
await writeFile(join(appPath, file), processedContent);
|
|
16
13
|
}
|
|
17
14
|
console.log(`Created new TeaUI application: ${name} with framework: ${options.framework}`);
|
|
18
15
|
}
|
package/.dist/index.js.map
CHANGED
|
@@ -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":"AAAA,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAC,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAA;AAEzB,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAY,EAAE,OAA4B;IACrE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAA;IACzC,MAAM,KAAK,CAAC,OAAO,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;IAEvC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IACrE,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,CAAA;IAEjD,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QACjD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;QACzD,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAA;QAC/D,MAAM,SAAS,CAAC,IAAI,CAAC,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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"type": "module",
|
|
2
3
|
"name": "@teaui/cli",
|
|
3
4
|
"description": "CLI for @teaui packages",
|
|
4
5
|
"author": "Colin T.A. Gray <colinta@colinta.com>",
|
|
5
6
|
"contributors": [],
|
|
6
|
-
"version": "1.
|
|
7
|
+
"version": "1.4.8",
|
|
7
8
|
"license": "MIT",
|
|
8
9
|
"preferGlobal": false,
|
|
9
10
|
"repository": {
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"commander": "^14.0.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@teaui/shared": "1.
|
|
45
|
+
"@teaui/shared": "1.4.8"
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|
|
47
48
|
"clean": "rm -rf .dist/",
|