@vnodes/cli 0.1.8 → 0.1.10
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/bye/bye.d.ts +12 -0
- package/dist/cli/bye/bye.d.ts.map +1 -0
- package/dist/cli/bye/bye.js +13 -0
- package/dist/cli/bye/bye.js.map +1 -0
- package/dist/cli/cli.js +5 -1
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/rm/rm.d.ts +1 -1
- package/dist/cli/rm/rm.d.ts.map +1 -1
- package/dist/cli/rm/rm.js +7 -5
- package/dist/cli/rm/rm.js.map +1 -1
- package/dist/cli/suffix/suffix.d.ts +6 -2
- package/dist/cli/suffix/suffix.d.ts.map +1 -1
- package/dist/cli/suffix/suffix.js +9 -5
- package/dist/cli/suffix/suffix.js.map +1 -1
- package/dist/cli/wd/wd.js +1 -1
- package/dist/cli/wd/wd.js.map +1 -1
- package/dist/cli/workspace/files/.eslint/allow-self-import.mjs.template +17 -0
- package/dist/cli/workspace/files/.eslint/common.mjs.template +22 -0
- package/dist/cli/workspace/files/.eslint/dependency-check.mjs.template +22 -0
- package/dist/cli/workspace/files/.eslint/eslint.base.mjs.template +8 -0
- package/dist/cli/workspace/files/.eslint/module-boundries.mjs.template +40 -0
- package/dist/cli/workspace/files/.eslint/no-undefined.mjs.template +16 -0
- package/dist/cli/workspace/files/.eslint/node-protocol.mjs.template +13 -0
- package/dist/cli/workspace/files/.eslint/plugin-check.mjs.template +11 -0
- package/dist/cli/workspace/files/.github/workflows/ci.yml.template +79 -0
- package/dist/cli/workspace/files/.gitignore.template +52 -0
- package/dist/cli/workspace/files/.husky/_/.gitignore.template +1 -0
- package/dist/cli/workspace/files/.husky/_/applypatch-msg.template +2 -0
- package/dist/cli/workspace/files/.husky/_/commit-msg.template +2 -0
- package/dist/cli/workspace/files/.husky/_/h.template +22 -0
- package/dist/cli/workspace/files/.husky/_/husky.sh.template +9 -0
- package/dist/cli/workspace/files/.husky/_/post-applypatch.template +2 -0
- package/dist/cli/workspace/files/.husky/_/post-checkout.template +2 -0
- package/dist/cli/workspace/files/.husky/_/post-commit.template +2 -0
- package/dist/cli/workspace/files/.husky/_/post-merge.template +2 -0
- package/dist/cli/workspace/files/.husky/_/post-rewrite.template +2 -0
- package/dist/cli/workspace/files/.husky/_/pre-applypatch.template +2 -0
- package/dist/cli/workspace/files/.husky/_/pre-auto-gc.template +2 -0
- package/dist/cli/workspace/files/.husky/_/pre-commit.template +2 -0
- package/dist/cli/workspace/files/.husky/_/pre-merge-commit.template +2 -0
- package/dist/cli/workspace/files/.husky/_/pre-push.template +2 -0
- package/dist/cli/workspace/files/.husky/_/pre-rebase.template +2 -0
- package/dist/cli/workspace/files/.husky/_/prepare-commit-msg.template +2 -0
- package/dist/cli/workspace/files/.husky/commit-msg.template +24 -0
- package/dist/cli/workspace/files/.husky/pre-commit.template +11 -0
- package/dist/cli/workspace/files/.prettierignore.template +5 -0
- package/dist/cli/workspace/files/.prettierrc.template +4 -0
- package/dist/cli/workspace/files/.verdaccio/config.yml.template +28 -0
- package/dist/cli/workspace/files/.vscode/_.code-snippets.template +8 -0
- package/dist/cli/workspace/files/.vscode/cli.code-snippets.template +25 -0
- package/dist/cli/workspace/files/.vscode/extensions.json.template +14 -0
- package/dist/cli/workspace/files/.vscode/nest.code-snippets.template +16 -0
- package/dist/cli/workspace/files/.vscode/settings.json.template +27 -0
- package/dist/cli/workspace/files/.vscode/ts.code-snippets.template +16 -0
- package/dist/cli/workspace/files/eslint.config.mjs.template +4 -0
- package/dist/cli/workspace/files/pnpm-workspace.yaml.template +13 -0
- package/dist/cli/workspace/files/tsconfig.json.template +5 -0
- package/dist/cli/workspace/files/vitest.workspace.ts.template +4 -0
- package/dist/cli/workspace/templates/README.md.ejs +34 -0
- package/dist/cli/workspace/templates/nx.json.ejs +127 -0
- package/dist/cli/workspace/templates/package.json.ejs +63 -0
- package/dist/cli/workspace/templates/project.json.ejs +14 -0
- package/dist/cli/workspace/templates/tsconfig.base.json.ejs +38 -0
- package/dist/cli/workspace/workspace.d.ts +12 -0
- package/dist/cli/workspace/workspace.d.ts.map +1 -0
- package/dist/cli/workspace/workspace.js +50 -0
- package/dist/cli/workspace/workspace.js.map +1 -0
- package/dist/generators/command/command.d.ts +5 -0
- package/dist/generators/command/command.d.ts.map +1 -0
- package/dist/generators/command/command.js +18 -0
- package/dist/generators/command/command.js.map +1 -0
- package/dist/generators/command/files/__fileName__.ts.template +17 -0
- package/dist/generators/command/schema.d.js +3 -0
- package/dist/generators/command/schema.d.js.map +1 -0
- package/dist/generators/command/schema.d.ts +3 -0
- package/dist/generators/command/schema.json +18 -0
- package/dist/generators/generator/files/__fileName__.ts.template +18 -0
- package/dist/generators/generator/files/files/__fileName__.json.template.template +3 -0
- package/dist/generators/generator/files/schema.d.ts.template +3 -0
- package/dist/generators/generator/files/schema.json.template +18 -0
- package/dist/generators/generator/generator.d.ts +5 -0
- package/dist/generators/generator/generator.d.ts.map +1 -0
- package/dist/generators/generator/generator.js +25 -0
- package/dist/generators/generator/generator.js.map +1 -0
- package/dist/generators/generator/schema.d.js +3 -0
- package/dist/generators/generator/schema.d.js.map +1 -0
- package/dist/generators/generator/schema.d.ts +3 -0
- package/dist/generators/generator/schema.json +18 -0
- package/dist/generators/hello/files/__fileName__.json.template +3 -0
- package/dist/generators/hello/hello.d.ts +5 -0
- package/dist/generators/hello/hello.d.ts.map +1 -0
- package/dist/generators/hello/hello.js +16 -0
- package/dist/generators/hello/hello.js.map +1 -0
- package/dist/generators/hello/schema.d.js +3 -0
- package/dist/generators/hello/schema.d.js.map +1 -0
- package/dist/generators/hello/schema.d.ts +3 -0
- package/dist/generators/hello/schema.json +18 -0
- package/dist/generators/project/api/package.json.template +1 -1
- package/dist/generators/project/api/src/app/resources/resource.module.ts.template +1 -1
- package/dist/generators/project/api/src/app/resources/sample/sample.controller.ts.template +1 -1
- package/dist/generators/project/api/src/app/resources/sample/sample.module.ts.template +1 -1
- package/dist/generators/project/cli/bin/__fileName__.mjs.template +3 -0
- package/dist/generators/project/cli/eslint.config.mjs.template +4 -0
- package/dist/generators/project/cli/generators.json.template +9 -0
- package/dist/generators/project/cli/package.json.template +96 -0
- package/dist/generators/project/cli/src/cli/cli.ts.template +11 -0
- package/dist/generators/project/cli/src/cli/hello/hello.ts.template +17 -0
- package/dist/generators/project/cli/src/generators/hello/files/hello.template.template +1 -0
- package/dist/generators/project/cli/src/generators/hello/hello.spec.ts.template +7 -0
- package/dist/generators/project/cli/src/generators/hello/hello.ts.template +19 -0
- package/dist/generators/project/cli/src/generators/hello/schema.d.ts.template +3 -0
- package/dist/generators/project/cli/src/generators/hello/schema.json.template +18 -0
- package/dist/generators/project/cli/src/index.ts.template +4 -0
- package/dist/generators/project/prisma/.env.template +0 -1
- package/dist/generators/project/prisma/package.json.template +4 -6
- package/dist/generators/project/prisma/prisma.config.ts.template +4 -10
- package/dist/generators/project/project.d.ts +2 -0
- package/dist/generators/project/project.d.ts.map +1 -1
- package/dist/generators/project/project.js +18 -13
- package/dist/generators/project/project.js.map +1 -1
- package/dist/generators/project/schema.json +2 -12
- package/dist/package.json +6 -2
- package/dist/peer-dependencies.d.ts +2 -0
- package/dist/peer-dependencies.d.ts.map +1 -0
- package/dist/peer-dependencies.js +3 -0
- package/dist/peer-dependencies.js.map +1 -0
- package/dist/utils/infer-project-configuration.d.ts +3 -0
- package/dist/utils/infer-project-configuration.d.ts.map +1 -0
- package/dist/utils/infer-project-configuration.js +13 -0
- package/dist/utils/infer-project-configuration.js.map +1 -0
- package/generators.json +16 -1
- package/package.json +6 -2
- package/dist/generators/project/api/.swcrc.template +0 -29
- package/dist/generators/project/api/prisma/schema.prisma.template +0 -14
- package/dist/generators/project/api/prisma.config.ts.template +0 -12
- package/dist/generators/project/api/tsconfig.app.json.template +0 -14
- /package/dist/generators/project/{lib → common}/.swcrc.template +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Say bye
|
|
4
|
+
*
|
|
5
|
+
* ### Example
|
|
6
|
+
* ````sh
|
|
7
|
+
* vnodes bye --username YourName
|
|
8
|
+
* ````
|
|
9
|
+
* @param command main command instance
|
|
10
|
+
*/
|
|
11
|
+
export declare function bye(command: Command): void;
|
|
12
|
+
//# sourceMappingURL=bye.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bye.d.ts","sourceRoot":"","sources":["../../../src/cli/bye/bye.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,QAKnC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Say bye
|
|
3
|
+
*
|
|
4
|
+
* ### Example
|
|
5
|
+
* ````sh
|
|
6
|
+
* vnodes bye --username YourName
|
|
7
|
+
* ````
|
|
8
|
+
* @param command main command instance
|
|
9
|
+
*/ export function bye(command) {
|
|
10
|
+
command.command('bye').requiredOption('-u, --username <string>', 'What is your name').action(({ username })=>console.log(`Hello, ${username}`));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=bye.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/bye/bye.ts"],"sourcesContent":["import { Command } from 'commander';\n\n/**\n * Say bye\n *\n * ### Example\n * ````sh\n * vnodes bye --username YourName\n * ````\n * @param command main command instance\n */\nexport function bye(command: Command) {\n command\n .command('bye')\n .requiredOption('-u, --username <string>', 'What is your name')\n .action(({ username }) => console.log(`Hello, ${username}`));\n}\n"],"names":["bye","command","requiredOption","action","username","console","log"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,SAASA,IAAIC,OAAgB;IAClCA,QACGA,OAAO,CAAC,OACRC,cAAc,CAAC,2BAA2B,qBAC1CC,MAAM,CAAC,CAAC,EAAEC,QAAQ,EAAE,GAAKC,QAAQC,GAAG,CAAC,CAAC,OAAO,EAAEF,UAAU;AAC9D"}
|
package/dist/cli/cli.js
CHANGED
|
@@ -3,12 +3,16 @@ import { hello } from './hello/hello.js';
|
|
|
3
3
|
import { wd } from './wd/wd.js';
|
|
4
4
|
import { suffix } from './suffix/suffix.js';
|
|
5
5
|
import { rm } from './rm/rm.js';
|
|
6
|
+
import { bye } from './bye/bye.js';
|
|
7
|
+
import { workspace } from './workspace/workspace.js';
|
|
6
8
|
program.name('Vnodes cli').description('Tools and generators').version('0.1.0').showHelpAfterError(true);
|
|
7
9
|
[
|
|
8
10
|
hello,
|
|
11
|
+
bye,
|
|
9
12
|
wd,
|
|
10
13
|
suffix,
|
|
11
|
-
rm
|
|
14
|
+
rm,
|
|
15
|
+
workspace
|
|
12
16
|
].map((c)=>c(program));
|
|
13
17
|
program.parse();
|
|
14
18
|
|
package/dist/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/cli.ts"],"sourcesContent":["import { program } from 'commander';\nimport { hello } from './hello/hello.js';\nimport { wd } from './wd/wd.js';\nimport { suffix } from './suffix/suffix.js';\nimport { rm } from './rm/rm.js';\n\nprogram
|
|
1
|
+
{"version":3,"sources":["../../src/cli/cli.ts"],"sourcesContent":["import { program } from 'commander';\nimport { hello } from './hello/hello.js';\nimport { wd } from './wd/wd.js';\nimport { suffix } from './suffix/suffix.js';\nimport { rm } from './rm/rm.js';\nimport { bye } from './bye/bye.js';\nimport { workspace } from './workspace/workspace.js';\n\nprogram.name('Vnodes cli').description('Tools and generators').version('0.1.0').showHelpAfterError(true);\n\n[hello, bye, wd, suffix, rm, workspace].map((c) => c(program));\n\nprogram.parse();\n"],"names":["program","hello","wd","suffix","rm","bye","workspace","name","description","version","showHelpAfterError","map","c","parse"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,EAAE,QAAQ,aAAa;AAChC,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,EAAE,QAAQ,aAAa;AAChC,SAASC,GAAG,QAAQ,eAAe;AACnC,SAASC,SAAS,QAAQ,2BAA2B;AAErDN,QAAQO,IAAI,CAAC,cAAcC,WAAW,CAAC,wBAAwBC,OAAO,CAAC,SAASC,kBAAkB,CAAC;AAEnG;IAACT;IAAOI;IAAKH;IAAIC;IAAQC;IAAIE;CAAU,CAACK,GAAG,CAAC,CAACC,IAAMA,EAAEZ;AAErDA,QAAQa,KAAK"}
|
package/dist/cli/rm/rm.d.ts
CHANGED
package/dist/cli/rm/rm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["../../../src/cli/rm/rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["../../../src/cli/rm/rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,OAAO,EAAE,OAAO,QASlC"}
|
package/dist/cli/rm/rm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { rm as nodeRm } from 'node:fs/promises';
|
|
2
2
|
import { scope } from '@vnodes/fs';
|
|
3
3
|
import { cwd } from 'node:process';
|
|
4
4
|
/**
|
|
@@ -6,15 +6,17 @@ import { cwd } from 'node:process';
|
|
|
6
6
|
*
|
|
7
7
|
* ### Example
|
|
8
8
|
* ````sh
|
|
9
|
-
* vnodes rm --
|
|
9
|
+
* vnodes rm --path some/path/to/delete
|
|
10
10
|
* ````
|
|
11
11
|
* @param command main command instance
|
|
12
12
|
*/ export function rm(command) {
|
|
13
|
-
command.command('rm').requiredOption('-p, --path <string>', '
|
|
13
|
+
command.command('rm').description('Remove all directories/files under the given path.').requiredOption('-p, --path <string>', 'Path to delete').action(async ({ path })=>{
|
|
14
14
|
const resolve = scope(cwd());
|
|
15
|
-
|
|
15
|
+
await nodeRm(resolve(path), {
|
|
16
16
|
recursive: true,
|
|
17
|
-
force: true
|
|
17
|
+
force: true,
|
|
18
|
+
maxRetries: 3,
|
|
19
|
+
retryDelay: 400
|
|
18
20
|
});
|
|
19
21
|
});
|
|
20
22
|
}
|
package/dist/cli/rm/rm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/rm/rm.ts"],"sourcesContent":["import { Command } from 'commander';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/rm/rm.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { rm as nodeRm } from 'node:fs/promises';\nimport { scope } from '@vnodes/fs';\nimport { cwd } from 'node:process';\n/**\n * Remove files/directories\n *\n * ### Example\n * ````sh\n * vnodes rm --path some/path/to/delete\n * ````\n * @param command main command instance\n */\nexport function rm(command: Command) {\n command\n .command('rm')\n .description('Remove all directories/files under the given path.')\n .requiredOption('-p, --path <string>', 'Path to delete')\n .action(async ({ path }) => {\n const resolve = scope(cwd());\n await nodeRm(resolve(path), { recursive: true, force: true, maxRetries: 3, retryDelay: 400 });\n });\n}\n"],"names":["rm","nodeRm","scope","cwd","command","description","requiredOption","action","path","resolve","recursive","force","maxRetries","retryDelay"],"mappings":"AACA,SAASA,MAAMC,MAAM,QAAQ,mBAAmB;AAChD,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,GAAG,QAAQ,eAAe;AACnC;;;;;;;;CAQC,GACD,OAAO,SAASH,GAAGI,OAAgB;IACjCA,QACGA,OAAO,CAAC,MACRC,WAAW,CAAC,sDACZC,cAAc,CAAC,uBAAuB,kBACtCC,MAAM,CAAC,OAAO,EAAEC,IAAI,EAAE;QACrB,MAAMC,UAAUP,MAAMC;QACtB,MAAMF,OAAOQ,QAAQD,OAAO;YAAEE,WAAW;YAAMC,OAAO;YAAMC,YAAY;YAAGC,YAAY;QAAI;IAC7F;AACJ"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
/**
|
|
3
|
-
* Suffix file/files recursive
|
|
3
|
+
* Suffix file/files recursive (optional)
|
|
4
4
|
*
|
|
5
5
|
* ### Example
|
|
6
6
|
* ````sh
|
|
7
|
-
*
|
|
7
|
+
* # Add .template suffix
|
|
8
|
+
* vnodes suffix --s .template -r
|
|
9
|
+
*
|
|
10
|
+
* # Remove the .template suffix
|
|
11
|
+
* vnodes suffix --s .template -r -u
|
|
8
12
|
* ````
|
|
9
13
|
* @param command main command instance
|
|
10
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suffix.d.ts","sourceRoot":"","sources":["../../../src/cli/suffix/suffix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC
|
|
1
|
+
{"version":3,"file":"suffix.d.ts","sourceRoot":"","sources":["../../../src/cli/suffix/suffix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,QAsBtC"}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { readdirSync, renameSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
/**
|
|
4
|
-
* Suffix file/files recursive
|
|
4
|
+
* Suffix file/files recursive (optional)
|
|
5
5
|
*
|
|
6
6
|
* ### Example
|
|
7
7
|
* ````sh
|
|
8
|
-
*
|
|
8
|
+
* # Add .template suffix
|
|
9
|
+
* vnodes suffix --s .template -r
|
|
10
|
+
*
|
|
11
|
+
* # Remove the .template suffix
|
|
12
|
+
* vnodes suffix --s .template -r -u
|
|
9
13
|
* ````
|
|
10
14
|
* @param command main command instance
|
|
11
15
|
*/ export function suffix(command) {
|
|
12
|
-
command.command('suffix').option('-u, --undo', '
|
|
13
|
-
const
|
|
16
|
+
command.command('suffix').option('-u, --undo', 'Remove the suffix from file names').option('-r, --recursive', 'Apply suffix to all files under sub directories').requiredOption('-s, --suffix <string>', 'Suffix to append to the file names').action(async ({ suffix, recursive, undo })=>{
|
|
17
|
+
const absolutePaths = readdirSync('', {
|
|
14
18
|
recursive: !!recursive,
|
|
15
19
|
withFileTypes: true
|
|
16
20
|
}).filter((e)=>e.isFile()).map((e)=>join('./', e.parentPath, e.name));
|
|
17
21
|
const createNewFilepath = (filePath)=>{
|
|
18
22
|
return undo ? filePath.replace(new RegExp(`${suffix}$`), '') : `${filePath}${suffix}`;
|
|
19
23
|
};
|
|
20
|
-
for (const filePath of
|
|
24
|
+
for (const filePath of absolutePaths){
|
|
21
25
|
renameSync(filePath, createNewFilepath(filePath));
|
|
22
26
|
}
|
|
23
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/suffix/suffix.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { readdirSync, renameSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * Suffix file/files recursive\n *\n * ### Example\n * ````sh\n * vnodes suffix --
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/suffix/suffix.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { readdirSync, renameSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * Suffix file/files recursive (optional)\n *\n * ### Example\n * ````sh\n * # Add .template suffix\n * vnodes suffix --s .template -r\n *\n * # Remove the .template suffix\n * vnodes suffix --s .template -r -u\n * ````\n * @param command main command instance\n */\nexport function suffix(command: Command) {\n command\n .command('suffix')\n .option('-u, --undo', 'Remove the suffix from file names')\n .option('-r, --recursive', 'Apply suffix to all files under sub directories')\n .requiredOption('-s, --suffix <string>', 'Suffix to append to the file names')\n .action(async ({ suffix, recursive, undo }) => {\n const absolutePaths = readdirSync('', {\n recursive: !!recursive,\n withFileTypes: true,\n })\n .filter((e) => e.isFile())\n .map((e) => join('./', e.parentPath, e.name));\n\n const createNewFilepath = (filePath: string) => {\n return undo ? filePath.replace(new RegExp(`${suffix}$`), '') : `${filePath}${suffix}`;\n };\n\n for (const filePath of absolutePaths) {\n renameSync(filePath, createNewFilepath(filePath));\n }\n });\n}\n"],"names":["readdirSync","renameSync","join","suffix","command","option","requiredOption","action","recursive","undo","absolutePaths","withFileTypes","filter","e","isFile","map","parentPath","name","createNewFilepath","filePath","replace","RegExp"],"mappings":"AACA,SAASA,WAAW,EAAEC,UAAU,QAAQ,UAAU;AAClD,SAASC,IAAI,QAAQ,YAAY;AAEjC;;;;;;;;;;;;CAYC,GACD,OAAO,SAASC,OAAOC,OAAgB;IACrCA,QACGA,OAAO,CAAC,UACRC,MAAM,CAAC,cAAc,qCACrBA,MAAM,CAAC,mBAAmB,mDAC1BC,cAAc,CAAC,yBAAyB,sCACxCC,MAAM,CAAC,OAAO,EAAEJ,MAAM,EAAEK,SAAS,EAAEC,IAAI,EAAE;QACxC,MAAMC,gBAAgBV,YAAY,IAAI;YACpCQ,WAAW,CAAC,CAACA;YACbG,eAAe;QACjB,GACGC,MAAM,CAAC,CAACC,IAAMA,EAAEC,MAAM,IACtBC,GAAG,CAAC,CAACF,IAAMX,KAAK,MAAMW,EAAEG,UAAU,EAAEH,EAAEI,IAAI;QAE7C,MAAMC,oBAAoB,CAACC;YACzB,OAAOV,OAAOU,SAASC,OAAO,CAAC,IAAIC,OAAO,GAAGlB,OAAO,CAAC,CAAC,GAAG,MAAM,GAAGgB,WAAWhB,QAAQ;QACvF;QAEA,KAAK,MAAMgB,YAAYT,cAAe;YACpCT,WAAWkB,UAAUD,kBAAkBC;QACzC;IACF;AACJ"}
|
package/dist/cli/wd/wd.js
CHANGED
package/dist/cli/wd/wd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/wd/wd.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { cwd } from 'process';\n\n/**\n * Print the current working directory\n *\n * ### Example\n * ````sh\n * vnodes hello --username YourName\n * ````\n * @param command main command instance\n */\nexport function wd(command: Command) {\n command.command('wd').action(() => {\n console.log(cwd());\n });\n}\n"],"names":["cwd","wd","command","action","console","log"],"mappings":"AACA,SAASA,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/wd/wd.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { cwd } from 'node:process';\n\n/**\n * Print the current working directory\n *\n * ### Example\n * ````sh\n * vnodes hello --username YourName\n * ````\n * @param command main command instance\n */\nexport function wd(command: Command) {\n command.command('wd').action(() => {\n console.log(cwd());\n });\n}\n"],"names":["cwd","wd","command","action","console","log"],"mappings":"AACA,SAASA,GAAG,QAAQ,eAAe;AAEnC;;;;;;;;CAQC,GACD,OAAO,SAASC,GAAGC,OAAgB;IACjCA,QAAQA,OAAO,CAAC,MAAMC,MAAM,CAAC;QAC3BC,QAAQC,GAAG,CAACL;IACd;AACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { readJsonFile } from '@nx/devkit';
|
|
2
|
+
|
|
3
|
+
const packageJson = readJsonFile('package.json');
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
'@nx/enforce-module-boundaries': [
|
|
9
|
+
'error',
|
|
10
|
+
{
|
|
11
|
+
enforceBuildableLibDependency: true,
|
|
12
|
+
allow: [`${packageJson.name}`],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import nx from '@nx/eslint-plugin';
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
...nx.configs['flat/base'],
|
|
5
|
+
...nx.configs['flat/typescript'],
|
|
6
|
+
...nx.configs['flat/javascript'],
|
|
7
|
+
|
|
8
|
+
{
|
|
9
|
+
ignores: [
|
|
10
|
+
'**/dist',
|
|
11
|
+
'**/out',
|
|
12
|
+
'**/out-tsc',
|
|
13
|
+
'**/generated/*',
|
|
14
|
+
'**/vitest.config.*.timestamp*',
|
|
15
|
+
'**/prisma.config.ts',
|
|
16
|
+
'**/vitet.config.mjs',
|
|
17
|
+
'**/vitest.workspace.ts',
|
|
18
|
+
'**/generated/**',
|
|
19
|
+
'**/eslint.config.mjs',
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
files: ['**/*.json'],
|
|
4
|
+
|
|
5
|
+
rules: {
|
|
6
|
+
'@nx/dependency-checks': [
|
|
7
|
+
'error',
|
|
8
|
+
{
|
|
9
|
+
ignoredDependencies: ['@swc/helpers', 'tslib'],
|
|
10
|
+
ignoredFiles: [
|
|
11
|
+
'{projectRoot}/eslint.config.mjs',
|
|
12
|
+
'{projectRoot}/prisma.config.ts',
|
|
13
|
+
'{projectRoot}/vitest.config.mts',
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
languageOptions: {
|
|
19
|
+
parser: await import('jsonc-eslint-parser'),
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import nx from '@nx/eslint-plugin';
|
|
2
|
+
import common from './common.mjs';
|
|
3
|
+
import dependencyCheck from './dependency-check.mjs';
|
|
4
|
+
import moduleBoundries from './module-boundries.mjs';
|
|
5
|
+
import noUndefined from './no-undefined.mjs';
|
|
6
|
+
import nodeProtocol from './node-protocol.mjs';
|
|
7
|
+
|
|
8
|
+
export default [...common, ...dependencyCheck, ...moduleBoundries, ...noUndefined, ...nodeProtocol];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
files: ['**/*.ts', '**/package.json'],
|
|
4
|
+
rules: {
|
|
5
|
+
'@nx/enforce-module-boundaries': [
|
|
6
|
+
'error',
|
|
7
|
+
{
|
|
8
|
+
enforceBuildableLibDependency: true,
|
|
9
|
+
allow: ['^.*/eslint(\\.base)?\\.config\\.mjs$'],
|
|
10
|
+
depConstraints: [
|
|
11
|
+
{
|
|
12
|
+
sourceTag: 'app:*',
|
|
13
|
+
onlyDependOnLibsWithTags: ['lib:core', 'lib:module', 'lib:shared', 'lib:types'],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
sourceTag: 'app:api',
|
|
17
|
+
onlyDependOnLibsWithTags: ['app:db', 'lib:core', 'lib:module', 'lib:shared', 'lib:types'],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
sourceTag: 'lib:core',
|
|
21
|
+
onlyDependOnLibsWithTags: ['lib:module', 'lib:shared', 'lib:types'],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
sourceTag: 'lib:module',
|
|
25
|
+
onlyDependOnLibsWithTags: ['lib:module', 'lib:shared', 'lib:types'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
sourceTag: 'lib:shared',
|
|
29
|
+
onlyDependOnLibsWithTags: ['lib:shared', 'lib:types'],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
sourceTag: 'lib:types',
|
|
33
|
+
onlyDependOnLibsWithTags: ['no:dependency'],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
rules: {
|
|
4
|
+
'no-restricted-syntax': [
|
|
5
|
+
'error',
|
|
6
|
+
{
|
|
7
|
+
// Catches any function or decorator call where 'undefined' is explicitly passed
|
|
8
|
+
selector:
|
|
9
|
+
"CallExpression[arguments.length=1] > Identifier[name='undefined']",
|
|
10
|
+
message:
|
|
11
|
+
"Do not pass 'undefined' explicitly. Rely on the default parameter value by omitting the argument entirely.",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
# Allow only one concurrent deployment
|
|
14
|
+
concurrency:
|
|
15
|
+
group: "pages"
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
deploy:
|
|
20
|
+
environment:
|
|
21
|
+
name: github-pages
|
|
22
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Install pnpm
|
|
30
|
+
uses: pnpm/action-setup@v4
|
|
31
|
+
with:
|
|
32
|
+
version: 11.3.0
|
|
33
|
+
|
|
34
|
+
- name: Configure cache
|
|
35
|
+
uses: actions/setup-node@v4
|
|
36
|
+
with:
|
|
37
|
+
node-version: 24
|
|
38
|
+
registry-url: "https://registry.npmjs.org"
|
|
39
|
+
cache: "pnpm"
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: pnpm install --frozen-lockfile
|
|
43
|
+
|
|
44
|
+
- name: Lint
|
|
45
|
+
run: |
|
|
46
|
+
pnpm nx run-many -t lint
|
|
47
|
+
|
|
48
|
+
- name: Build
|
|
49
|
+
run: |
|
|
50
|
+
pnpm nx run-many -t build --projects="tag:lib:types"
|
|
51
|
+
pnpm nx run-many -t build --projects="tag:lib:shared"
|
|
52
|
+
pnpm nx run-many -t build --projects="tag:lib:module"
|
|
53
|
+
pnpm nx run-many -t build --projects="tag:lib:core"
|
|
54
|
+
pnpm nx run-many -t build --projects="tag:app:cli"
|
|
55
|
+
pnpm nx run-many -t build --projects="tag:app:db"
|
|
56
|
+
pnpm nx run-many -t build --projects="tag:app:api"
|
|
57
|
+
|
|
58
|
+
- name: Publish libraries to npm registry
|
|
59
|
+
run: pnpm nx release publish
|
|
60
|
+
env:
|
|
61
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
62
|
+
|
|
63
|
+
- name: Nx Graph
|
|
64
|
+
run: pnpm nx graph --file=public/index.html
|
|
65
|
+
|
|
66
|
+
- name: Typedoc to public
|
|
67
|
+
run: pnpm nx run-many -t doc
|
|
68
|
+
|
|
69
|
+
- name: Setup Pages
|
|
70
|
+
uses: actions/configure-pages@v5
|
|
71
|
+
|
|
72
|
+
- name: Upload artifact
|
|
73
|
+
uses: actions/upload-pages-artifact@v3
|
|
74
|
+
with:
|
|
75
|
+
path: public
|
|
76
|
+
|
|
77
|
+
- name: Deploy to GitHub Pages
|
|
78
|
+
id: deployment
|
|
79
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# compiled output
|
|
4
|
+
dist
|
|
5
|
+
tmp
|
|
6
|
+
out
|
|
7
|
+
out-tsc
|
|
8
|
+
public
|
|
9
|
+
|
|
10
|
+
# dependencies
|
|
11
|
+
node_modules
|
|
12
|
+
|
|
13
|
+
**/*.tsbuildinfo*
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# IDEs and editors
|
|
17
|
+
/.idea
|
|
18
|
+
.project
|
|
19
|
+
.classpath
|
|
20
|
+
.c9/
|
|
21
|
+
*.launch
|
|
22
|
+
.settings/
|
|
23
|
+
*.sublime-workspace
|
|
24
|
+
|
|
25
|
+
# IDE - VSCode
|
|
26
|
+
.vscode/*
|
|
27
|
+
!.vscode/settings.json
|
|
28
|
+
!.vscode/tasks.json
|
|
29
|
+
!.vscode/launch.json
|
|
30
|
+
!.vscode/extensions.json
|
|
31
|
+
!.vscode/*.code-snippets
|
|
32
|
+
|
|
33
|
+
# misc
|
|
34
|
+
/.sass-cache
|
|
35
|
+
/connect.lock
|
|
36
|
+
/coverage
|
|
37
|
+
/libpeerconnection.log
|
|
38
|
+
npm-debug.log
|
|
39
|
+
yarn-error.log
|
|
40
|
+
testem.log
|
|
41
|
+
/typings
|
|
42
|
+
|
|
43
|
+
# System Files
|
|
44
|
+
.DS_Store
|
|
45
|
+
Thumbs.db
|
|
46
|
+
|
|
47
|
+
.nx/cache
|
|
48
|
+
.nx/workspace-data
|
|
49
|
+
.claude/worktrees
|
|
50
|
+
.claude/settings.local.json
|
|
51
|
+
|
|
52
|
+
vitest.config.*.timestamp*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
[ "$HUSKY" = "2" ] && set -x
|
|
3
|
+
n=$(basename "$0")
|
|
4
|
+
s=$(dirname "$(dirname "$0")")/$n
|
|
5
|
+
|
|
6
|
+
[ ! -f "$s" ] && exit 0
|
|
7
|
+
|
|
8
|
+
if [ -f "$HOME/.huskyrc" ]; then
|
|
9
|
+
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh"
|
|
10
|
+
fi
|
|
11
|
+
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh"
|
|
12
|
+
[ -f "$i" ] && . "$i"
|
|
13
|
+
|
|
14
|
+
[ "${HUSKY-}" = "0" ] && exit 0
|
|
15
|
+
|
|
16
|
+
export PATH="node_modules/.bin:$PATH"
|
|
17
|
+
sh -e "$s" "$@"
|
|
18
|
+
c=$?
|
|
19
|
+
|
|
20
|
+
[ $c != 0 ] && echo "husky - $n script failed (code $c)"
|
|
21
|
+
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
|
|
22
|
+
exit $c
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
COMMIT_MSG_FILE=$1
|
|
4
|
+
# Read only the first line of the commit message
|
|
5
|
+
COMMIT_MSG_HEADER=$(head -n 1 "$COMMIT_MSG_FILE")
|
|
6
|
+
|
|
7
|
+
# Pattern: type(scope)!: description
|
|
8
|
+
# Fixed the ! position and removed quotes from the variable in the comparison
|
|
9
|
+
REG_EXP='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|release)(\([a-z0-9-]+\))?!?: .+'
|
|
10
|
+
|
|
11
|
+
if [[ ! $COMMIT_MSG_HEADER =~ $REG_EXP ]]; then
|
|
12
|
+
echo "------------------------------------------------------------------"
|
|
13
|
+
echo "❌ ERROR: Invalid commit message format!"
|
|
14
|
+
echo "------------------------------------------------------------------"
|
|
15
|
+
echo "Subject line: $COMMIT_MSG_HEADER"
|
|
16
|
+
echo ""
|
|
17
|
+
echo "Accepted format: <type>(optional-scope): <description>"
|
|
18
|
+
echo "Example: feat(auth)!: add OIDC support"
|
|
19
|
+
echo "------------------------------------------------------------------"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
echo "✅ Commit message follows Conventional Commits standard."
|
|
24
|
+
exit 0
|