emnj-tool 1.0.3 → 1.0.5
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/constant.js +1 -0
- package/dist/index.js +2 -12
- package/package.json +12 -4
- package/tsconfig.json +17 -9
- package/types/constant.d.ts +1 -0
- package/types/h5.d.ts +10 -0
- package/types/index.d.ts +2 -0
- package/types/src/h5.d.ts +10 -0
- package/types/src/index.d.ts +2 -0
- package/types/src/util.d.ts +1 -0
- package/types/util.d.ts +1 -0
package/dist/constant.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export const version = "0.0.3";
|
package/dist/index.js
CHANGED
@@ -12,20 +12,10 @@ import { Command } from "commander";
|
|
12
12
|
import inquirer from "inquirer";
|
13
13
|
import CreateH5 from "./h5.js";
|
14
14
|
import chalk from "chalk";
|
15
|
+
import { version } from "./constant.js";
|
15
16
|
const program = new Command();
|
16
17
|
const log = console.log;
|
17
|
-
program.name("项目初始化").description("CLI to Initialize some project").version(
|
18
|
-
// program
|
19
|
-
// .command("split")
|
20
|
-
// .description("Split a string into an array of strings using a separator.")
|
21
|
-
// .argument("<string>", "The string to split")
|
22
|
-
// .option("--first", "display just the first substring")
|
23
|
-
// .option("-s, --separator <char>", "separator character", ",")
|
24
|
-
// .action((str, options) => {
|
25
|
-
// console.log("---->> ", options);
|
26
|
-
// const limit = options.first ? 1 : undefined;
|
27
|
-
// console.log(str.split(options.separator, limit));
|
28
|
-
// });
|
18
|
+
program.name("项目初始化").description("CLI to Initialize some project").version(version);
|
29
19
|
program
|
30
20
|
.command("init")
|
31
21
|
.description("初始化项目,支持H5,Web等")
|
package/package.json
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "emnj-tool",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.5",
|
4
4
|
"description": "一个工具,用来初始化项目",
|
5
5
|
"type": "module",
|
6
|
-
"exports": "./index.js",
|
7
6
|
"engines": {
|
8
7
|
"node": ">=16.0.0"
|
9
8
|
},
|
10
9
|
"scripts": {
|
11
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
12
|
-
"build": "npx tsc"
|
11
|
+
"build": "pnpm run clean && npx tsc",
|
12
|
+
"clean": "rimraf dist"
|
13
13
|
},
|
14
14
|
"bin": {
|
15
15
|
"emnj-tool": "./dist/index.js"
|
@@ -17,13 +17,21 @@
|
|
17
17
|
"keywords": [
|
18
18
|
"emnj-tool"
|
19
19
|
],
|
20
|
-
"author": "",
|
20
|
+
"author": "beyond",
|
21
21
|
"license": "ISC",
|
22
22
|
"devDependencies": {
|
23
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
24
|
+
"@rollup/plugin-json": "^6.1.0",
|
25
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
26
|
+
"@rollup/plugin-terser": "^0.4.4",
|
23
27
|
"@types/fs-extra": "^11.0.4",
|
24
28
|
"@types/inquirer": "^9.0.7",
|
25
29
|
"@types/node": "^20.11.28",
|
30
|
+
"rimraf": "^5.0.7",
|
31
|
+
"rollup": "^4.17.2",
|
32
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
26
33
|
"ts-node": "^10.9.2",
|
34
|
+
"tslib": "^2.6.2",
|
27
35
|
"typescript": "^5.4.2"
|
28
36
|
},
|
29
37
|
"dependencies": {
|
package/tsconfig.json
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"compilerOptions": {
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"
|
3
|
+
"module": "ES2020", // 或者 "ES2015", "ESNext" 等
|
4
|
+
"moduleResolution": "node", // 确保模块解析适合Node.js
|
5
|
+
"target": "es6", // Node.js支持的最低版本
|
6
|
+
"lib": ["esnext", "dom"],
|
7
7
|
"strict": true,
|
8
|
-
"
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
8
|
+
"esModuleInterop": true,
|
9
|
+
"outDir": "dist",
|
10
|
+
"declaration": true,
|
11
|
+
"declarationDir": "types",
|
12
|
+
"resolveJsonModule": true,
|
13
|
+
"jsx": "preserve",
|
14
|
+
"jsxImportSource": "vue",
|
15
|
+
"allowJs": true,
|
16
|
+
"baseUrl": "./",
|
17
|
+
"paths": {},
|
18
|
+
"types": []
|
12
19
|
},
|
13
|
-
"include": ["src/**/*.ts"]
|
20
|
+
"include": ["src/**/*.js", "src/**/*.ts"],
|
21
|
+
"exclude": ["node_modules", "build", "dist", "example", "rollup.config.js"]
|
14
22
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const version = "0.0.3";
|
package/types/h5.d.ts
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
export default class CreateH5 {
|
2
|
+
private answerOptions;
|
3
|
+
constructor(answerOptions: InquirerPromptQuestions);
|
4
|
+
init(): Promise<void>;
|
5
|
+
mkdir(): Promise<string>;
|
6
|
+
/**
|
7
|
+
* unzip h5 template to current workspace path
|
8
|
+
*/
|
9
|
+
unzipH5Template(targetDirPath: string): void;
|
10
|
+
}
|
package/types/index.d.ts
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
export default class CreateH5 {
|
2
|
+
private answerOptions;
|
3
|
+
constructor(answerOptions: InquirerPromptQuestions);
|
4
|
+
init(): Promise<void>;
|
5
|
+
mkdir(): Promise<string>;
|
6
|
+
/**
|
7
|
+
* unzip h5 template to current workspace path
|
8
|
+
*/
|
9
|
+
unzipH5Template(targetDirPath: string): void;
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function sum(a: number, b: number): number;
|
package/types/util.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export declare function sum(a: number, b: number): number;
|