htmv 0.0.1 → 0.0.2
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/cli/cli.js +23 -0
- package/package.json +3 -3
- package/src/cli/cli.ts +26 -0
- package/src/cli/commands/help.ts +5 -0
- package/src/cli/commands/new.ts +4 -0
- package/src/cli/messages.json +3 -0
- package/tsconfig.json +8 -4
- package/cli.ts +0 -2
- /package/{index.ts → src/index.ts} +0 -0
package/dist/cli/cli.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import help from "./commands/help";
|
|
3
|
+
import newCommand from "./commands/new";
|
|
4
|
+
import { AVAILABLE_COMMANDS } from "./messages.json";
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
const command = args[0];
|
|
7
|
+
if (command === undefined) {
|
|
8
|
+
console.error("No command specified. Available commands are:");
|
|
9
|
+
console.error(AVAILABLE_COMMANDS);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
const commandArgs = args.slice(1);
|
|
13
|
+
const commands = {
|
|
14
|
+
help,
|
|
15
|
+
new: () => newCommand(commandArgs),
|
|
16
|
+
};
|
|
17
|
+
if (command in commands) {
|
|
18
|
+
commands[command]();
|
|
19
|
+
process.exit(0);
|
|
20
|
+
}
|
|
21
|
+
console.error("Unknown command. Available commands are:");
|
|
22
|
+
console.error(AVAILABLE_COMMANDS);
|
|
23
|
+
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "htmv",
|
|
3
|
-
"
|
|
3
|
+
"main": "dist/index.js",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.2",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@biomejs/biome": "2.3.3",
|
|
8
8
|
"@types/bun": "latest"
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"elysia": "^1.4.15"
|
|
16
16
|
},
|
|
17
17
|
"bin": {
|
|
18
|
-
"htmv": "
|
|
18
|
+
"htmv": "dist/cli/cli.js"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/src/cli/cli.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import help from "./commands/help";
|
|
3
|
+
import newCommand from "./commands/new";
|
|
4
|
+
import { AVAILABLE_COMMANDS } from "./messages.json";
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const command = args[0];
|
|
8
|
+
if (command === undefined) {
|
|
9
|
+
console.error("No command specified. Available commands are:");
|
|
10
|
+
console.error(AVAILABLE_COMMANDS);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const commandArgs = args.slice(1);
|
|
15
|
+
const commands = {
|
|
16
|
+
help,
|
|
17
|
+
new: () => newCommand(commandArgs),
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
if (command in commands) {
|
|
21
|
+
commands[command as keyof typeof commands]();
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
console.error("Unknown command. Available commands are:");
|
|
25
|
+
console.error(AVAILABLE_COMMANDS);
|
|
26
|
+
process.exit(1);
|
package/tsconfig.json
CHANGED
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
// Bundler mode
|
|
12
12
|
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
13
|
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
14
|
|
|
17
15
|
// Best practices
|
|
18
16
|
"strict": true,
|
|
@@ -24,6 +22,12 @@
|
|
|
24
22
|
// Some stricter flags (disabled by default)
|
|
25
23
|
"noUnusedLocals": false,
|
|
26
24
|
"noUnusedParameters": false,
|
|
27
|
-
"noPropertyAccessFromIndexSignature": false
|
|
28
|
-
|
|
25
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
26
|
+
|
|
27
|
+
// Config for npm
|
|
28
|
+
"noEmit": false, // Changed to false to allow it to compile
|
|
29
|
+
"outDir": "./dist",
|
|
30
|
+
"declaration": true //generates .d.ts
|
|
31
|
+
},
|
|
32
|
+
"include": ["src"]
|
|
29
33
|
}
|
package/cli.ts
DELETED
|
File without changes
|