@teaui/cli 1.3.6 → 1.3.7
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 +1 -1
- package/.dist/bin.js.map +1 -1
- package/.dist/frameworks/none/index.ts +57 -0
- package/.dist/frameworks/none/package.json +17 -0
- package/.dist/frameworks/none/tsconfig.json +18 -0
- package/.dist/frameworks/preact/index.tsx +31 -0
- package/.dist/frameworks/preact/package.json +19 -0
- package/.dist/frameworks/preact/tsconfig.json +26 -0
- package/.dist/frameworks/react/index.tsx +32 -0
- package/.dist/frameworks/react/package.json +20 -0
- package/.dist/frameworks/react/tsconfig.json +19 -0
- package/package.json +3 -3
package/.dist/bin.js
CHANGED
|
@@ -12,7 +12,7 @@ program
|
|
|
12
12
|
.command('create')
|
|
13
13
|
.description('Create a new TeaUI application')
|
|
14
14
|
.argument('<name>', 'Name of the application')
|
|
15
|
-
.requiredOption('-f, --framework <framework>', 'Framework to use', value => {
|
|
15
|
+
.requiredOption('-f, --framework <framework> (none, react, or preact)', 'Framework to use', value => {
|
|
16
16
|
if (!['react', 'preact', 'none'].includes(value)) {
|
|
17
17
|
throw new Error(`Invalid framework: ${value}. Must be one of: react, preact, none`);
|
|
18
18
|
}
|
package/.dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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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
|
+
Window,
|
|
11
|
+
interceptConsoleLog,
|
|
12
|
+
} from '@teaui/core'
|
|
13
|
+
;(async () => {
|
|
14
|
+
interceptConsoleLog()
|
|
15
|
+
console.log('Logs appear in the "ConsoleLog" component')
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
console.log('one more log for good measure')
|
|
18
|
+
}, 1000)
|
|
19
|
+
|
|
20
|
+
process.title = '{{name}}'
|
|
21
|
+
const consoleLog = new ConsoleLog({
|
|
22
|
+
height: 10,
|
|
23
|
+
})
|
|
24
|
+
const [screen, program] = await Screen.start(
|
|
25
|
+
new Window({
|
|
26
|
+
child: new TrackMouse({
|
|
27
|
+
content: Stack.down([
|
|
28
|
+
[
|
|
29
|
+
'flex1',
|
|
30
|
+
Stack.down([
|
|
31
|
+
new Text({alignment: 'center', text: 'Hello to "{{name}}"'}),
|
|
32
|
+
new Separator({
|
|
33
|
+
direction: 'horizontal',
|
|
34
|
+
border: 'trailing',
|
|
35
|
+
padding: 1,
|
|
36
|
+
}),
|
|
37
|
+
Space.vertical(10),
|
|
38
|
+
new Button({
|
|
39
|
+
title: 'Exit',
|
|
40
|
+
onClick: () => {
|
|
41
|
+
screen.exit()
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
]),
|
|
45
|
+
],
|
|
46
|
+
['natural', consoleLog],
|
|
47
|
+
]),
|
|
48
|
+
}),
|
|
49
|
+
}),
|
|
50
|
+
{quitChar: 'q'},
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
program.key('escape', function () {
|
|
54
|
+
consoleLog.clear()
|
|
55
|
+
screen.render()
|
|
56
|
+
})
|
|
57
|
+
})()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"main": ".dist/index.js",
|
|
4
|
+
"license": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "$npm_execpath tsc",
|
|
7
|
+
"start": "$npm_execpath build && node --enable-source-maps -- .dist/index.js",
|
|
8
|
+
"clean": "rm -rf .dist/"
|
|
9
|
+
},
|
|
10
|
+
"private": true,
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@teaui/core": "latest"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"typescript": "^5.6.3"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["./"],
|
|
3
|
+
"exclude": [".dist/"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"outDir": ".dist"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {interceptConsoleLog, type Screen} from '@teaui/core'
|
|
2
|
+
import {Button, ConsoleLog, Separator, Space, Stack, run} from '@teaui/preact'
|
|
3
|
+
|
|
4
|
+
function App() {
|
|
5
|
+
function onExit() {
|
|
6
|
+
screen?.exit()
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const name = '{{name}}'
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Stack.down>
|
|
13
|
+
<Stack.down flex={1}>
|
|
14
|
+
Hello to "{name}"
|
|
15
|
+
<Separator direction="horizontal" border="trailing" padding={1} />
|
|
16
|
+
<Space flex={1} />
|
|
17
|
+
<Button title="Exit" onClick={onExit} />
|
|
18
|
+
<Space flex={1} />
|
|
19
|
+
</Stack.down>
|
|
20
|
+
<ConsoleLog height={10} />
|
|
21
|
+
</Stack.down>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let screen: Screen | undefined
|
|
26
|
+
;(async () => {
|
|
27
|
+
interceptConsoleLog()
|
|
28
|
+
|
|
29
|
+
const [screen_] = await run(<App />)
|
|
30
|
+
screen = screen_
|
|
31
|
+
})()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"main": ".dist/index.js",
|
|
4
|
+
"license": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "$npm_execpath tsc",
|
|
7
|
+
"start": "$npm_execpath build && node --enable-source-maps -- .dist/index.js",
|
|
8
|
+
"clean": "rm -rf .dist/"
|
|
9
|
+
},
|
|
10
|
+
"private": true,
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"preact": "^10.24.3",
|
|
13
|
+
"@teaui/core": "latest",
|
|
14
|
+
"@teaui/preact": "latest"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"typescript": "^5.6.3"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["./"],
|
|
3
|
+
"exclude": [".dist/"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"outDir": ".dist",
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
"jsxImportSource": "preact",
|
|
19
|
+
"paths": {
|
|
20
|
+
"react": ["./node_modules/preact/compat/"],
|
|
21
|
+
"react/jsx-runtime": ["./node_modules/preact/jsx-runtime"],
|
|
22
|
+
"react-dom": ["./node_modules/preact/compat/"],
|
|
23
|
+
"react-dom/*": ["./node_modules/preact/compat/*"]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {interceptConsoleLog, type Screen} from '@teaui/core'
|
|
3
|
+
import {Button, ConsoleLog, Separator, Space, Stack, run} from '@teaui/react'
|
|
4
|
+
|
|
5
|
+
function App() {
|
|
6
|
+
function onExit() {
|
|
7
|
+
screen?.exit()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const name = '{{name}}'
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Stack.down>
|
|
14
|
+
<Stack.down flex={1}>
|
|
15
|
+
Hello to "{name}"
|
|
16
|
+
<Separator direction="horizontal" border="trailing" padding={1} />
|
|
17
|
+
<Space flex={1} />
|
|
18
|
+
<Button title="Exit" onClick={onExit} />
|
|
19
|
+
<Space flex={1} />
|
|
20
|
+
</Stack.down>
|
|
21
|
+
<ConsoleLog height={10} />
|
|
22
|
+
</Stack.down>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let screen: Screen | undefined
|
|
27
|
+
;(async () => {
|
|
28
|
+
interceptConsoleLog()
|
|
29
|
+
|
|
30
|
+
const [screen_] = await run(<App />)
|
|
31
|
+
screen = screen_
|
|
32
|
+
})()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"main": ".dist/index.js",
|
|
4
|
+
"license": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "$npm_execpath tsc",
|
|
7
|
+
"start": "$npm_execpath build && node --enable-source-maps -- .dist/index.js",
|
|
8
|
+
"clean": "rm -rf .dist/"
|
|
9
|
+
},
|
|
10
|
+
"private": true,
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@teaui/react": "latest",
|
|
13
|
+
"@teaui/core": "latest",
|
|
14
|
+
"react": "^18.3.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/react": "^18.3.1",
|
|
18
|
+
"typescript": "^5.6.3"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["./"],
|
|
3
|
+
"exclude": [".dist/"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"outDir": ".dist",
|
|
17
|
+
"jsx": "react"
|
|
18
|
+
}
|
|
19
|
+
}
|
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.3.
|
|
6
|
+
"version": "1.3.7",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"preferGlobal": false,
|
|
9
9
|
"repository": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"commander": "^14.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@teaui/shared": "1.3.
|
|
44
|
+
"@teaui/shared": "1.3.7"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"clean": "rm -rf .dist/",
|
|
48
|
-
"build": "pnpm clean && pnpm tsc"
|
|
48
|
+
"build": "pnpm clean && pnpm tsc && cp -r frameworks .dist/"
|
|
49
49
|
}
|
|
50
50
|
}
|