monoplate-kit 1.0.0

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/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "monoplate-kit",
3
+ "version": "1.0.0",
4
+ "description": "This library is necessary for launching and developing Monoplate.",
5
+ "license": "MIT",
6
+ "author": "Arata Uebayashi",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "scripts": {
11
+ "build": "tsc"
12
+ },
13
+ "engines": {
14
+ "node": ">=24.14.0",
15
+ "npm": ">=11.9.0"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/ue0ba1ya1sh3i-hash/monoplate.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/ue0ba1ya1sh3i-hash/monoplate/issues"
23
+ },
24
+ "pnpm": {
25
+ "onlyBuiltDependencies": [
26
+ "esbuild"
27
+ ]
28
+ },
29
+ "devDependencies": {
30
+ "@types/node": "^25.7.0",
31
+ "typescript": "^6.0.3"
32
+ },
33
+ "dependencies": {
34
+ "@clack/prompts": "^1.4.0",
35
+ "chalk": "^5.6.2",
36
+ "execa": "^9.6.1"
37
+ }
38
+ }
package/src/index.ts ADDED
@@ -0,0 +1,56 @@
1
+ import chalk from "chalk"
2
+ import * as clack from "@clack/prompts"
3
+ import { execa } from "execa"
4
+
5
+ export const log = (
6
+ message: string,
7
+ logType: "error" | "info" | "warn" | "complete",
8
+ tag?: string,
9
+ ): void => {
10
+ const logMessage = tag ? `[${tag}] ${message}` : message
11
+
12
+ switch (logType) {
13
+ case "complete":
14
+ console.log(chalk.green(logMessage))
15
+ break
16
+ case "error":
17
+ console.log(chalk.red(logMessage))
18
+ break
19
+ case "info":
20
+ console.log(chalk.blue(logMessage))
21
+ break
22
+ case "warn":
23
+ console.log(chalk.yellow(logMessage))
24
+ break
25
+ }
26
+ }
27
+
28
+ export const prompts = async (
29
+ option: Parameters<typeof clack.group>[0],
30
+ ): Promise<ReturnType<typeof clack.group>> => {
31
+ const data = await clack.group(option)
32
+ return data
33
+ }
34
+
35
+ export const newLine = (number?: number): void => {
36
+ // 無指定の場合は1行に設定
37
+ number = number ?? 1
38
+
39
+ for (let i = 0; i < number; i++) {
40
+ console.log()
41
+ }
42
+ }
43
+
44
+ export const runCli = async (command: string, options: string[]): Promise<number | undefined> => {
45
+ newLine()
46
+ console.log(`> ${command} ${options.join(" ")}`)
47
+
48
+ newLine()
49
+ const { exitCode } = await execa(command, options, {
50
+ stdio: "inherit",
51
+ reject: false
52
+ })
53
+
54
+ newLine()
55
+ return exitCode
56
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": "./src",
4
+ "outDir": "./dist",
5
+
6
+ // Environment Settings
7
+ "module": "nodenext",
8
+ "target": "esnext",
9
+
10
+ // Node
11
+ "lib": ["esnext"],
12
+ "types": ["node"],
13
+
14
+ // Other Outputs
15
+ "sourceMap": true,
16
+ "declaration": true,
17
+ "declarationMap": true,
18
+
19
+ // Stricter Typechecking Options
20
+ "noUncheckedIndexedAccess": true,
21
+ "exactOptionalPropertyTypes": true,
22
+ "noImplicitReturns": true,
23
+ "noImplicitOverride": true,
24
+ "noUnusedLocals": true,
25
+ "noUnusedParameters": true,
26
+ "noFallthroughCasesInSwitch": true,
27
+ "noPropertyAccessFromIndexSignature": true,
28
+
29
+ // Recommended Options
30
+ "strict": true,
31
+ "verbatimModuleSyntax": true,
32
+ "isolatedModules": true,
33
+ "noUncheckedSideEffectImports": true,
34
+ "moduleDetection": "force",
35
+ "skipLibCheck": true,
36
+ }
37
+ }