@intent-codes/intent-ruoyi-vue-ts 0.0.1

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/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # 若依前端代码生成工具
2
+
3
+ ```sh
4
+ main.ts --type=
5
+ ```
6
+
7
+
8
+ ```sh
9
+ # npm 镜像
10
+ https://registry.npmmirror.com/
11
+ # npm 官网
12
+ https://registry.npmjs.com/
13
+ # 切换
14
+ npm config set registry=https://registry.npmjs.com/
15
+ npm config set //registry.npmjs.org/:_authToken=你的token
16
+ npm publish --access public
17
+
18
+ npm publish --//registry.npmjs.org/:_authToken=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 --access public
19
+ ```
package/dist/main.js ADDED
@@ -0,0 +1,41 @@
1
+ import { parseSync } from "oxc-parser";
2
+ import { Command } from 'commander';
3
+ const program = new Command();
4
+ program.name("ruoyi-vue3-ts").description("若依前端代码生成器").version("0.1.0");
5
+ // ts-api-create
6
+ // ts-types-create
7
+ // vue-create
8
+ program.command("ts-api-create")
9
+ .description("新增 typescript api 代码")
10
+ .argument("<path>", "表结构定义文件的路径")
11
+ .action((str, option) => {
12
+ let code = `import request from "@utils/request";
13
+ export async function fetchSth() {
14
+ return request.get();
15
+ }
16
+ `;
17
+ console.log(code);
18
+ });
19
+ program.command("ts-types-create")
20
+ .description("新增 typescript interface 代码")
21
+ .argument("<path>", "表结构定义文件的路径")
22
+ .action((str, option) => {
23
+ const code = `declare interface Person{
24
+ name: string;
25
+ }`;
26
+ console.log(code);
27
+ });
28
+ program.command("vue-create")
29
+ .description("新增 vue 代码")
30
+ .argument("<path>", "表结构定义文件的路径")
31
+ .action((str, option) => {
32
+ // TODO: 支持生成多个 vue 文件
33
+ const code = `<script lang="ts" setup>
34
+
35
+ </script>
36
+ <template>
37
+ <div>hello world</div>
38
+ </template>`;
39
+ console.log(code);
40
+ });
41
+ program.parse();
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@intent-codes/intent-ruoyi-vue-ts",
3
+ "version": "0.0.1",
4
+ "main": "src/main.ts",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "build": "tsc"
8
+ },
9
+ "type": "module",
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "description": "",
14
+ "dependencies": {
15
+ "@oxc-project/types": "^0.112.0",
16
+ "@vue/compiler-dom": "^3.5.27",
17
+ "@vue/compiler-sfc": "^3.5.27",
18
+ "commander": "^14.0.3",
19
+ "oxc-parser": "^0.112.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^25.2.0",
23
+ "typescript": "^5.9.3"
24
+ }
25
+ }
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@intent-codes/intent-ruoyi-vue-ts",
3
+ "version": "0.0.1",
4
+ "main": "src/main.ts",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "build": "tsc"
8
+ },
9
+ "type": "module",
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "description": "",
14
+ "dependencies": {
15
+ "@oxc-project/types": "^0.112.0",
16
+ "@vue/compiler-dom": "^3.5.27",
17
+ "@vue/compiler-sfc": "^3.5.27",
18
+ "commander": "^14.0.3",
19
+ "oxc-parser": "^0.112.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^25.2.0",
23
+ "typescript": "^5.9.3"
24
+ }
25
+ }
package/src/main.ts ADDED
@@ -0,0 +1,44 @@
1
+ import { parseSync } from "oxc-parser";
2
+ import { Command } from 'commander';
3
+ const program = new Command();
4
+ program.name("ruoyi-vue3-ts").description("若依前端代码生成器").version("0.1.0");
5
+
6
+ // ts-api-create
7
+ // ts-types-create
8
+ // vue-create
9
+
10
+ program.command("ts-api-create")
11
+ .description("新增 typescript api 代码")
12
+ .argument("<path>", "表结构定义文件的路径")
13
+ .action((str, option) => {
14
+ let code = `import request from "@utils/request";
15
+ export async function fetchSth() {
16
+ return request.get();
17
+ }
18
+ `;
19
+ console.log(code);
20
+ });
21
+ program.command("ts-types-create")
22
+ .description("新增 typescript interface 代码")
23
+ .argument("<path>", "表结构定义文件的路径")
24
+ .action((str, option) => {
25
+ const code = `declare interface Person{
26
+ name: string;
27
+ }`;
28
+ console.log(code);
29
+ });
30
+ program.command("vue-create")
31
+ .description("新增 vue 代码")
32
+ .argument("<path>", "表结构定义文件的路径")
33
+ .action((str, option) => {
34
+ // TODO: 支持生成多个 vue 文件
35
+ const code = `<script lang="ts" setup>
36
+
37
+ </script>
38
+ <template>
39
+ <div>hello world</div>
40
+ </template>`;
41
+ console.log(code);
42
+ });
43
+
44
+ program.parse();
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "noEmit": false,
4
+ "target": "esnext",
5
+ "module": "nodenext",
6
+ "rewriteRelativeImportExtensions": true,
7
+ "erasableSyntaxOnly": true,
8
+ "verbatimModuleSyntax": true,
9
+ "rootDir": "./src",
10
+ "outDir": "./dist"
11
+ },
12
+ "include": ["./src/**/*"]
13
+ }