zero-tools 1.3.7 → 1.3.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/bin.ts +18 -35
- package/dist/bin.js +2 -4
- package/package.json +1 -1
package/bin.ts
CHANGED
|
@@ -17,17 +17,20 @@ let argv = minimist(process.argv.slice(2), {
|
|
|
17
17
|
}
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
-
let packageTem =
|
|
21
|
-
|
|
20
|
+
let packageTem = `
|
|
21
|
+
{
|
|
22
22
|
"name": "${name}",
|
|
23
23
|
"version": "1.0.0",
|
|
24
24
|
"description": "",
|
|
25
|
-
"main": "
|
|
25
|
+
"main": "index.ts",
|
|
26
26
|
"scripts": {
|
|
27
|
+
"debug": "ts-node-dev index.ts"
|
|
27
28
|
},
|
|
28
29
|
"author": "",
|
|
29
30
|
"license": "ISC",
|
|
30
|
-
"dependencies": {
|
|
31
|
+
"dependencies": {},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"ts-node-dev": "^1.1.6"
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
`
|
|
@@ -92,14 +95,12 @@ let tsconfigTem =
|
|
|
92
95
|
}
|
|
93
96
|
`
|
|
94
97
|
|
|
95
|
-
let indexTem =
|
|
96
|
-
`
|
|
98
|
+
let indexTem = `
|
|
97
99
|
let a="test"
|
|
98
100
|
console.log(a)
|
|
99
101
|
`
|
|
100
102
|
|
|
101
|
-
let cwsTem =
|
|
102
|
-
`
|
|
103
|
+
let cwsTem = `
|
|
103
104
|
{
|
|
104
105
|
"folders": [
|
|
105
106
|
{
|
|
@@ -109,40 +110,23 @@ let cwsTem =
|
|
|
109
110
|
"settings": {}
|
|
110
111
|
}
|
|
111
112
|
`
|
|
112
|
-
|
|
113
|
-
let taskTem =
|
|
114
|
-
`
|
|
115
|
-
{
|
|
116
|
-
"version": "2.0.0",
|
|
117
|
-
"tasks": [
|
|
118
|
-
{
|
|
119
|
-
"label": "tsc",
|
|
120
|
-
"type": "typescript",
|
|
121
|
-
"tsconfig": "tsconfig.json",
|
|
122
|
-
"problemMatcher": [
|
|
123
|
-
"$tsc"
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
`
|
|
129
|
-
let launchTem =
|
|
130
|
-
`
|
|
113
|
+
let launchTem = `
|
|
131
114
|
{
|
|
132
115
|
"version": "0.2.0",
|
|
133
116
|
"configurations": [
|
|
134
117
|
{
|
|
135
118
|
"type": "node",
|
|
136
119
|
"request": "launch",
|
|
137
|
-
"name": "
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
|
|
120
|
+
"name": "启动",
|
|
121
|
+
"runtimeExecutable": "yarn",
|
|
122
|
+
"args": [
|
|
123
|
+
"debug",
|
|
124
|
+
],
|
|
125
|
+
},
|
|
141
126
|
]
|
|
142
127
|
}
|
|
143
128
|
`
|
|
144
|
-
let helpString =
|
|
145
|
-
`
|
|
129
|
+
let helpString = `
|
|
146
130
|
----------------------开发工具包-----------------------
|
|
147
131
|
zero ut (zero --unitTesting)在当前文件夹新建TS单元测试项目
|
|
148
132
|
zero xt (zero --xlsxToTs)在当前文件夹下的xlsx.json中所描述的Excel文件转换TS文件
|
|
@@ -159,7 +143,6 @@ let fn = {
|
|
|
159
143
|
if (!fs.existsSync(cwd + "/.vscode")) {
|
|
160
144
|
fs.mkdirSync(cwd + "/.vscode")
|
|
161
145
|
}
|
|
162
|
-
fs.writeFileSync(cwd + "/.vscode/tasks.json", taskTem)
|
|
163
146
|
fs.writeFileSync(cwd + "/.vscode/launch.json", launchTem)
|
|
164
147
|
},
|
|
165
148
|
xt: () => {
|
|
@@ -181,7 +164,7 @@ let fn = {
|
|
|
181
164
|
data.forEach(ExcelName => {
|
|
182
165
|
if (ExcelName.substr(-5) == ".xlsx" && ExcelName.substr(0, 1) != "~") {
|
|
183
166
|
let FileDir: string = `${xlsxPath}/${ExcelName}`
|
|
184
|
-
xlsxToTs(FileDir, tsPath, checkCell, startCell,note)
|
|
167
|
+
xlsxToTs(FileDir, tsPath, checkCell, startCell, note)
|
|
185
168
|
console.log(`${ExcelName}`)
|
|
186
169
|
}
|
|
187
170
|
})
|
package/dist/bin.js
CHANGED
|
@@ -36,12 +36,11 @@ var argv = minimist(process.argv.slice(2), {
|
|
|
36
36
|
version: ['v'],
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
var packageTem = "{\n \"name\": \"" + name + "\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"
|
|
39
|
+
var packageTem = "\n{\n \"name\": \"" + name + "\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"index.ts\",\n \"scripts\": {\n \"debug\": \"ts-node-dev index.ts\"\n },\n \"author\": \"\",\n \"license\": \"ISC\",\n \"dependencies\": {},\n \"devDependencies\": {\n \"ts-node-dev\": \"^1.1.6\"\n }\n}\n";
|
|
40
40
|
var tsconfigTem = "\n{\n \"compilerOptions\": {\n /* Basic Options */\n \"target\": \"es5\", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */\n \"module\": \"commonjs\", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */\n // \"lib\": [], /* Specify library files to be included in the compilation. */\n // \"allowJs\": true, /* Allow javascript files to be compiled. */\n // \"checkJs\": true, /* Report errors in .js files. */\n // \"jsx\": \"preserve\", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */\n // \"declaration\": true, /* Generates corresponding '.d.ts' file. */\n \"sourceMap\": true, /* Generates corresponding '.map' file. */\n // \"outFile\": \"./\", /* Concatenate and emit output to single file. */\n \"outDir\": \"./dist\", /* Redirect output structure to the directory. */\n // \"rootDir\": \"./\", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */\n // \"removeComments\": true, /* Do not emit comments to output. */\n // \"noEmit\": true, /* Do not emit outputs. */\n // \"importHelpers\": true, /* Import emit helpers from 'tslib'. */\n // \"downlevelIteration\": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */\n // \"isolatedModules\": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */\n \n /* Strict Type-Checking Options */\n \"strict\": true, /* Enable all strict type-checking options. */\n // \"noImplicitAny\": true, /* Raise error on expressions and declarations with an implied 'any' type. */\n // \"strictNullChecks\": true, /* Enable strict null checks. */\n // \"strictFunctionTypes\": true, /* Enable strict checking of function types. */\n // \"strictPropertyInitialization\": true, /* Enable strict checking of property initialization in classes. */\n // \"noImplicitThis\": true, /* Raise error on 'this' expressions with an implied 'any' type. */\n // \"alwaysStrict\": true, /* Parse in strict mode and emit \"use strict\" for each source file. */\n \n /* Additional Checks */\n // \"noUnusedLocals\": true, /* Report errors on unused locals. */\n // \"noUnusedParameters\": true, /* Report errors on unused parameters. */\n // \"noImplicitReturns\": true, /* Report error when not all code paths in function return a value. */\n // \"noFallthroughCasesInSwitch\": true, /* Report errors for fallthrough cases in switch statement. */\n \n /* Module Resolution Options */\n // \"moduleResolution\": \"node\", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */\n // \"baseUrl\": \"./\", /* Base directory to resolve non-absolute module names. */\n // \"paths\": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */\n // \"rootDirs\": [], /* List of root folders whose combined content represents the structure of the project at runtime. */\n // \"typeRoots\": [], /* List of folders to include type definitions from. */\n // \"types\": [], /* Type declaration files to be included in compilation. */\n // \"allowSyntheticDefaultImports\": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */\n \"esModuleInterop\": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */\n // \"preserveSymlinks\": true, /* Do not resolve the real path of symlinks. */\n \n /* Source Map Options */\n // \"sourceRoot\": \"./\", /* Specify the location where debugger should locate TypeScript files instead of source locations. */\n // \"mapRoot\": \"./\", /* Specify the location where debugger should locate map files instead of generated locations. */\n // \"inlineSourceMap\": true, /* Emit a single file with source maps instead of having a separate file. */\n // \"inlineSources\": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */\n \n /* Experimental Options */\n // \"experimentalDecorators\": true, /* Enables experimental support for ES7 decorators. */\n // \"emitDecoratorMetadata\": true, /* Enables experimental support for emitting type metadata for decorators. */\n }\n }\n";
|
|
41
41
|
var indexTem = "\nlet a=\"test\"\nconsole.log(a)\n";
|
|
42
42
|
var cwsTem = "\n{\n\t\"folders\": [\n\t\t{\n\t\t\t\"path\": \".\"\n\t\t}\n\t],\n\t\"settings\": {}\n}\n";
|
|
43
|
-
var
|
|
44
|
-
var launchTem = "\n{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"node\",\n \"request\": \"launch\",\n \"name\": \"\u542F\u52A8\u7A0B\u5E8F\",\n \"program\": \"${workspaceFolder}/dist/index.js\",\n \"preLaunchTask\": \"tsc\"\n }\n ]\n}\n";
|
|
43
|
+
var launchTem = "\n{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"node\",\n \"request\": \"launch\",\n \"name\": \"\u542F\u52A8\",\n \"runtimeExecutable\": \"yarn\",\n \"args\": [\n \"debug\",\n ],\n },\n ]\n}\n";
|
|
45
44
|
var helpString = "\n----------------------\u5F00\u53D1\u5DE5\u5177\u5305-----------------------\nzero ut (zero --unitTesting)\u5728\u5F53\u524D\u6587\u4EF6\u5939\u65B0\u5EFATS\u5355\u5143\u6D4B\u8BD5\u9879\u76EE\nzero xt (zero --xlsxToTs)\u5728\u5F53\u524D\u6587\u4EF6\u5939\u4E0B\u7684xlsx.json\u4E2D\u6240\u63CF\u8FF0\u7684Excel\u6587\u4EF6\u8F6C\u6362TS\u6587\u4EF6\nzero h (zero --help)\u5E2E\u52A9\nzero v (zero --version)\u7248\u672C\u53F7\n----------------------\u84DD\u9762\u5305 \u5236\u4F5C----------------------";
|
|
46
45
|
var fn = {
|
|
47
46
|
ut: function () {
|
|
@@ -52,7 +51,6 @@ var fn = {
|
|
|
52
51
|
if (!fs.existsSync(cwd + "/.vscode")) {
|
|
53
52
|
fs.mkdirSync(cwd + "/.vscode");
|
|
54
53
|
}
|
|
55
|
-
fs.writeFileSync(cwd + "/.vscode/tasks.json", taskTem);
|
|
56
54
|
fs.writeFileSync(cwd + "/.vscode/launch.json", launchTem);
|
|
57
55
|
},
|
|
58
56
|
xt: function () {
|