create-packer 1.16.2 → 1.17.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.
Files changed (114) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +18 -18
  3. package/bin/clis/createTemp.d.ts +5 -5
  4. package/bin/clis/createTemp.js +58 -58
  5. package/bin/index.d.ts +2 -2
  6. package/bin/index.js +10 -10
  7. package/bin/utils/index.d.ts +4 -4
  8. package/bin/utils/index.js +45 -45
  9. package/package.json +1 -1
  10. package/template/chrome-extension/.editorconfig +14 -0
  11. package/template/chrome-extension/.env +1 -0
  12. package/template/chrome-extension/.env.development +1 -0
  13. package/template/chrome-extension/.eslintrc +82 -0
  14. package/template/chrome-extension/.gitignore +25 -0
  15. package/template/chrome-extension/.husky/commit-msg +4 -0
  16. package/template/chrome-extension/.husky/pre-commit +4 -0
  17. package/template/chrome-extension/.prettierignore +4 -0
  18. package/template/chrome-extension/.prettierrc +18 -0
  19. package/template/chrome-extension/.stylelintrc +23 -0
  20. package/template/chrome-extension/.vscode/extensions.json +7 -0
  21. package/template/chrome-extension/README.md +14 -0
  22. package/template/chrome-extension/commitlint.config.cjs +1 -0
  23. package/template/chrome-extension/jest.config.cjs +55 -0
  24. package/template/chrome-extension/jest.setup.ts +5 -0
  25. package/template/chrome-extension/package.json +77 -0
  26. package/template/chrome-extension/postcss.config.cjs +9 -0
  27. package/template/chrome-extension/src/assets/react.svg +1 -0
  28. package/template/chrome-extension/src/assets/vite.svg +1 -0
  29. package/template/chrome-extension/src/content_script/content.container.tsx +5 -0
  30. package/template/chrome-extension/src/content_script/content.css +3 -0
  31. package/template/chrome-extension/src/content_script/content.spec.tsx +15 -0
  32. package/template/chrome-extension/src/content_script/index.tsx +12 -0
  33. package/template/chrome-extension/src/manifest.json +19 -0
  34. package/template/chrome-extension/src/models/index.ts +1 -0
  35. package/template/chrome-extension/src/models/useVisible.ts +27 -0
  36. package/template/chrome-extension/src/popup/index.tsx +9 -0
  37. package/template/chrome-extension/src/popup/popup.container.tsx +5 -0
  38. package/template/chrome-extension/src/popup/popup.css +3 -0
  39. package/template/chrome-extension/src/popup/popup.html +13 -0
  40. package/template/chrome-extension/src/popup/popup.spec.tsx +15 -0
  41. package/template/chrome-extension/src/providers/defineStore.ts +42 -0
  42. package/template/chrome-extension/src/providers/index.ts +2 -0
  43. package/template/chrome-extension/src/providers/request.ts +7 -0
  44. package/template/chrome-extension/src/vite-env.d.ts +10 -0
  45. package/template/chrome-extension/tailwind.config.cjs +8 -0
  46. package/template/chrome-extension/tsconfig.json +25 -0
  47. package/template/chrome-extension/tsconfig.node.json +9 -0
  48. package/template/chrome-extension/vite.config.ts +26 -0
  49. package/template/docusaurus/.gitignore +20 -20
  50. package/template/docusaurus/.prettierignore +6 -6
  51. package/template/docusaurus/README.md +33 -33
  52. package/template/docusaurus/babel.config.js +3 -3
  53. package/template/docusaurus/blog/2019-05-28-hola.md +11 -11
  54. package/template/docusaurus/blog/2019-05-29-hello-world.md +17 -17
  55. package/template/docusaurus/blog/2019-05-30-welcome.md +13 -13
  56. package/template/docusaurus/docs/doc1/doc1.mdx +201 -201
  57. package/template/docusaurus/docs/doc1/doc2.mdx +5 -5
  58. package/template/docusaurus/docs/doc1/doc3.mdx +13 -13
  59. package/template/docusaurus/docs/doc1/doc4.mdx +23 -23
  60. package/template/docusaurus/docs/doc2/doc1.mdx +200 -200
  61. package/template/docusaurus/docs/doc2/doc2.mdx +5 -5
  62. package/template/docusaurus/docs/doc2/doc3.mdx +13 -13
  63. package/template/docusaurus/docs/doc2/mdx4.mdx +23 -23
  64. package/template/docusaurus/docusaurus.config.js +134 -134
  65. package/template/docusaurus/sidebars.js +14 -14
  66. package/template/docusaurus/static/img/undraw_docusaurus_mountain.svg +170 -170
  67. package/template/docusaurus/static/img/undraw_docusaurus_react.svg +169 -169
  68. package/template/docusaurus/tsconfig.json +4 -4
  69. package/template/lib/.changeset/README.md +8 -8
  70. package/template/lib/.changeset/config.json +11 -11
  71. package/template/lib/.gitignore +35 -35
  72. package/template/lib/packages/test/.gitignore +35 -35
  73. package/template/lib/packages/test/package.json +13 -13
  74. package/template/lib/packages/test/src/index.ts +5 -5
  75. package/template/lib/packages/test/tsconfig.json +17 -17
  76. package/template/lib/pnpm-workspace.yaml +2 -2
  77. package/template/nest/.eslintrc.js +25 -25
  78. package/template/nest/.gitignore +34 -34
  79. package/template/nest/.husky/pre-commit +4 -4
  80. package/template/nest/.prettierrc +6 -6
  81. package/template/nest/README.md +73 -73
  82. package/template/nest/nest-cli.json +5 -5
  83. package/template/nest/src/app.controller.spec.ts +22 -22
  84. package/template/nest/src/app.controller.ts +12 -12
  85. package/template/nest/src/app.module.ts +10 -10
  86. package/template/nest/src/app.service.ts +8 -8
  87. package/template/nest/src/main.ts +10 -10
  88. package/template/nest/src/utils/transform.interceptor.ts +26 -26
  89. package/template/nest/test/app.e2e-spec.ts +24 -24
  90. package/template/nest/test/jest-e2e.json +9 -9
  91. package/template/nest/tsconfig.build.json +5 -5
  92. package/template/nest/tsconfig.json +21 -21
  93. package/template/react/.gitignore +25 -25
  94. package/template/react/.husky/commit-msg +4 -4
  95. package/template/react/.husky/pre-commit +4 -4
  96. package/template/react/.prettierignore +4 -4
  97. package/template/react/commitlint.config.cjs +1 -1
  98. package/template/react/index.html +13 -13
  99. package/template/react/jest.config.cjs +55 -55
  100. package/template/react/jest.setup.ts +5 -5
  101. package/template/react/postcss.config.cjs +9 -9
  102. package/template/react/tailwind.config.cjs +8 -8
  103. package/template/react/tsconfig.json +25 -25
  104. package/template/react/tsconfig.node.json +9 -9
  105. package/template/vue/.husky/commit-msg +4 -4
  106. package/template/vue/.husky/pre-commit +4 -4
  107. package/template/vue/.prettierignore +4 -4
  108. package/template/vue/commitlint.config.cjs +1 -1
  109. package/template/vue/index.html +13 -13
  110. package/template/vue/postcss.config.cjs +9 -9
  111. package/template/vue/src/models/useList.ts +1 -1
  112. package/template/vue/tailwind.config.cjs +8 -8
  113. package/template/vue/tsconfig.json +22 -22
  114. package/template/vue/tsconfig.node.json +9 -9
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 1k
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 1k
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
- # create-packer
2
-
3
- Quickly create project templates。
4
-
5
- ## QuicklyCreate
6
-
7
- ```shell
8
- npx create-packer -c <. || dirname>
9
- yarn create packer -c <. || dirname>
10
- pnpx create-packer -c <. || dirname>
11
- ```
12
-
13
- ## TempInfo
14
-
15
- - docusaurus: Based on [Docusaurus 2](https://v2.docusaurus.io/).
16
- - nest: Based on [nestjs](https://docs.nestjs.com/).
17
- - vue: Based on [vite(3.x)](https://cn.vitejs.dev/), [vue3](https://vuejs.org/).
18
- - react: Based on [vite(3.x)](https://cn.vitejs.dev/), [react18](https://reactjs.org/).
1
+ # create-packer
2
+
3
+ Quickly create project templates。
4
+
5
+ ## QuicklyCreate
6
+
7
+ ```shell
8
+ npx create-packer -c <. || dirname>
9
+ yarn create packer -c <. || dirname>
10
+ pnpx create-packer -c <. || dirname>
11
+ ```
12
+
13
+ ## TempInfo
14
+
15
+ - docusaurus: Based on [Docusaurus 2](https://v2.docusaurus.io/).
16
+ - nest: Based on [nestjs](https://docs.nestjs.com/).
17
+ - vue: Based on [vite(3.x)](https://cn.vitejs.dev/), [vue3](https://vuejs.org/).
18
+ - react: Based on [vite(3.x)](https://cn.vitejs.dev/), [react18](https://reactjs.org/).
@@ -1,5 +1,5 @@
1
- export interface tempInfoType {
2
- name: string;
3
- src: string;
4
- }
5
- export declare function createTemp(dirname: string): Promise<void>;
1
+ export interface tempInfoType {
2
+ name: string;
3
+ src: string;
4
+ }
5
+ export declare function createTemp(dirname: string): Promise<void>;
@@ -1,58 +1,58 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTemp = void 0;
4
- const inquirer = require("inquirer");
5
- const fsExtra = require("fs-extra");
6
- const path = require("path");
7
- const fs = require("fs");
8
- const chalk = require("chalk");
9
- const ora = require("ora");
10
- const child_process_1 = require("child_process");
11
- const utils_1 = require("../utils");
12
- const cwd = process.cwd();
13
- const command = utils_1.onGenCommand();
14
- const excludes = ['node_modules', 'yarn-error.log', 'dist'];
15
- const tempRoot = path.join(__dirname, '../../template');
16
- const tempInfo = utils_1.onGetDir(tempRoot).map(name => {
17
- return {
18
- name,
19
- src: path.join(tempRoot, name)
20
- };
21
- });
22
- function copyTempFile(tempPath, output) {
23
- fsExtra.readdirSync(tempPath).map(name => {
24
- if (!excludes.includes(name)) {
25
- fsExtra.copySync(path.join(tempPath, name), path.join(output, name));
26
- }
27
- });
28
- }
29
- function createTempEnd(output) {
30
- child_process_1.spawnSync(command, ['install'], {
31
- cwd: output,
32
- stdio: 'inherit'
33
- });
34
- }
35
- async function createTemp(dirname) {
36
- const isCurrent = dirname === '.';
37
- const { temp } = await inquirer.prompt([
38
- {
39
- type: 'list',
40
- name: 'temp',
41
- message: 'Select temp.',
42
- choices: tempInfo.map(o => o.name)
43
- }
44
- ]);
45
- const creating = ora(chalk.yellow('Creating...\n')).start();
46
- const output = path.join(cwd, isCurrent ? '' : dirname);
47
- if (!isCurrent && fs.existsSync(output)) {
48
- return console.log(chalk.red(`${dirname} already exists!`));
49
- }
50
- if (!isCurrent) {
51
- fsExtra.mkdirSync(output);
52
- }
53
- const tempPath = path.join(tempRoot, temp);
54
- copyTempFile(tempPath, output);
55
- createTempEnd(output);
56
- creating.succeed();
57
- }
58
- exports.createTemp = createTemp;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTemp = void 0;
4
+ const inquirer = require("inquirer");
5
+ const fsExtra = require("fs-extra");
6
+ const path = require("path");
7
+ const fs = require("fs");
8
+ const chalk = require("chalk");
9
+ const ora = require("ora");
10
+ const child_process_1 = require("child_process");
11
+ const utils_1 = require("../utils");
12
+ const cwd = process.cwd();
13
+ const command = utils_1.onGenCommand();
14
+ const excludes = ['node_modules', 'yarn-error.log', 'dist'];
15
+ const tempRoot = path.join(__dirname, '../../template');
16
+ const tempInfo = utils_1.onGetDir(tempRoot).map(name => {
17
+ return {
18
+ name,
19
+ src: path.join(tempRoot, name)
20
+ };
21
+ });
22
+ function copyTempFile(tempPath, output) {
23
+ fsExtra.readdirSync(tempPath).map(name => {
24
+ if (!excludes.includes(name)) {
25
+ fsExtra.copySync(path.join(tempPath, name), path.join(output, name));
26
+ }
27
+ });
28
+ }
29
+ function createTempEnd(output) {
30
+ child_process_1.spawnSync(command, ['install'], {
31
+ cwd: output,
32
+ stdio: 'inherit'
33
+ });
34
+ }
35
+ async function createTemp(dirname) {
36
+ const isCurrent = dirname === '.';
37
+ const { temp } = await inquirer.prompt([
38
+ {
39
+ type: 'list',
40
+ name: 'temp',
41
+ message: 'Select temp.',
42
+ choices: tempInfo.map(o => o.name)
43
+ }
44
+ ]);
45
+ const creating = ora(chalk.yellow('Creating...\n')).start();
46
+ const output = path.join(cwd, isCurrent ? '' : dirname);
47
+ if (!isCurrent && fs.existsSync(output)) {
48
+ return console.log(chalk.red(`${dirname} already exists!`));
49
+ }
50
+ if (!isCurrent) {
51
+ fsExtra.mkdirSync(output);
52
+ }
53
+ const tempPath = path.join(tempRoot, temp);
54
+ copyTempFile(tempPath, output);
55
+ createTempEnd(output);
56
+ creating.succeed();
57
+ }
58
+ exports.createTemp = createTemp;
package/bin/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ #!/usr/bin/env node
2
+ export {};
package/bin/index.js CHANGED
@@ -1,10 +1,10 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const createTemp_1 = require("./clis/createTemp");
5
- const commander_1 = require("commander");
6
- commander_1.program
7
- .option('-c, --create <dirname>', 'Create project.', dirname => {
8
- return createTemp_1.createTemp(dirname);
9
- })
10
- .parse(process.argv);
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const createTemp_1 = require("./clis/createTemp");
5
+ const commander_1 = require("commander");
6
+ commander_1.program
7
+ .option('-c, --create <dirname>', 'Create project.', dirname => {
8
+ return createTemp_1.createTemp(dirname);
9
+ })
10
+ .parse(process.argv);
@@ -1,4 +1,4 @@
1
- export declare function hasPnpm(): boolean;
2
- export declare function hasYarn(): boolean;
3
- export declare function onGenCommand(): "pnpm" | "yarn" | "npm";
4
- export declare function onGetDir(root: string): string[];
1
+ export declare function hasPnpm(): boolean;
2
+ export declare function hasYarn(): boolean;
3
+ export declare function onGenCommand(): "pnpm" | "yarn" | "npm";
4
+ export declare function onGetDir(root: string): string[];
@@ -1,45 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.onGetDir = exports.onGenCommand = exports.hasYarn = exports.hasPnpm = void 0;
4
- const child_process_1 = require("child_process");
5
- const fs_1 = require("fs");
6
- function hasPnpm() {
7
- try {
8
- child_process_1.execSync('pnpm --version');
9
- return true;
10
- }
11
- catch {
12
- return false;
13
- }
14
- }
15
- exports.hasPnpm = hasPnpm;
16
- function hasYarn() {
17
- try {
18
- child_process_1.execSync('yarnpkg --version');
19
- return true;
20
- }
21
- catch {
22
- return false;
23
- }
24
- }
25
- exports.hasYarn = hasYarn;
26
- function onGenCommand() {
27
- if (hasPnpm()) {
28
- return 'pnpm';
29
- }
30
- if (hasYarn()) {
31
- return 'yarn';
32
- }
33
- return 'npm';
34
- }
35
- exports.onGenCommand = onGenCommand;
36
- function onGetDir(root) {
37
- const dirs = [];
38
- fs_1.readdirSync(root, { withFileTypes: true }).forEach(o => {
39
- if (o.isDirectory()) {
40
- dirs.push(o.name);
41
- }
42
- });
43
- return dirs;
44
- }
45
- exports.onGetDir = onGetDir;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onGetDir = exports.onGenCommand = exports.hasYarn = exports.hasPnpm = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const fs_1 = require("fs");
6
+ function hasPnpm() {
7
+ try {
8
+ child_process_1.execSync('pnpm --version');
9
+ return true;
10
+ }
11
+ catch {
12
+ return false;
13
+ }
14
+ }
15
+ exports.hasPnpm = hasPnpm;
16
+ function hasYarn() {
17
+ try {
18
+ child_process_1.execSync('yarnpkg --version');
19
+ return true;
20
+ }
21
+ catch {
22
+ return false;
23
+ }
24
+ }
25
+ exports.hasYarn = hasYarn;
26
+ function onGenCommand() {
27
+ if (hasPnpm()) {
28
+ return 'pnpm';
29
+ }
30
+ if (hasYarn()) {
31
+ return 'yarn';
32
+ }
33
+ return 'npm';
34
+ }
35
+ exports.onGenCommand = onGenCommand;
36
+ function onGetDir(root) {
37
+ const dirs = [];
38
+ fs_1.readdirSync(root, { withFileTypes: true }).forEach(o => {
39
+ if (o.isDirectory()) {
40
+ dirs.push(o.name);
41
+ }
42
+ });
43
+ return dirs;
44
+ }
45
+ exports.onGetDir = onGetDir;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.16.2",
3
+ "version": "1.17.0",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -0,0 +1,14 @@
1
+ # editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ indent_size = 4
8
+ indent_style = space
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
11
+
12
+
13
+ [*.md]
14
+ trim_trailing_whitespace = false
@@ -0,0 +1 @@
1
+ VITE_API_HOST=https://127.0.0.1
@@ -0,0 +1 @@
1
+ VITE_API_HOST=https://127.0.0.1
@@ -0,0 +1,82 @@
1
+ {
2
+ "root": true,
3
+ "parser": "@typescript-eslint/parser",
4
+ "plugins": ["@typescript-eslint", "prettier"],
5
+ "extends": [
6
+ "eslint:recommended",
7
+ "plugin:react/recommended",
8
+ "plugin:react-hooks/recommended",
9
+ "plugin:import/recommended",
10
+ "plugin:import/typescript"
11
+ ],
12
+ "settings": {
13
+ "import/resolver": {
14
+ "typescript": true,
15
+ "node": true
16
+ },
17
+ "react": {
18
+ "version": "18"
19
+ }
20
+ },
21
+ "env": {
22
+ "browser": true,
23
+ "node": true,
24
+ "es6": true,
25
+ "jest": true
26
+ },
27
+ "parserOptions": {
28
+ "ecmaVersion": 2018,
29
+ "sourceType": "module",
30
+ "ecmaFeatures": {
31
+ "jsx": true
32
+ },
33
+ "useJSXTextNode": true
34
+ },
35
+ "rules": {
36
+ "import/export": "off",
37
+ "import/namespace": "off",
38
+ "import/order": [
39
+ "error",
40
+ {
41
+ "groups": [
42
+ "builtin",
43
+ "external",
44
+ "internal",
45
+ "parent",
46
+ "sibling",
47
+ "index",
48
+ "object",
49
+ "type"
50
+ ]
51
+ }
52
+ ],
53
+ "@typescript-eslint/no-var-requires": 0,
54
+ "@typescript-eslint/explicit-function-return-type": "off",
55
+ "@typescript-eslint/no-explicit-any": 0,
56
+ "@typescript-eslint/no-non-null-assertion": "off",
57
+ "@typescript-eslint/no-inferrable-types": [
58
+ "warn",
59
+ {
60
+ "ignoreParameters": true
61
+ }
62
+ ],
63
+ "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
64
+ "@typescript-eslint/member-delimiter-style": 0,
65
+ "@typescript-eslint/class-name-casing": 0,
66
+ "@typescript-eslint/explicit-module-boundary-types": "off",
67
+ "@typescript-eslint/ban-ts-comment": "off",
68
+ "@typescript-eslint/no-empty-interface": "off",
69
+ "react/prop-types": "off",
70
+ "react/no-find-dom-node": "off",
71
+ "react-hooks/exhaustive-deps": "warn",
72
+ "react/display-name": "off",
73
+ "react/react-in-jsx-scope": "off",
74
+ "prettier/prettier": [
75
+ "error",
76
+ {
77
+ "endOfLine": "auto"
78
+ }
79
+ ],
80
+ "no-constant-condition": "off"
81
+ }
82
+ }
@@ -0,0 +1,25 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .history
19
+ .idea
20
+ .DS_Store
21
+ *.suo
22
+ *.ntvs*
23
+ *.njsproj
24
+ *.sln
25
+ *.sw?
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx --no -- commitlint --edit
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npm run lint
@@ -0,0 +1,4 @@
1
+ **/*.md
2
+ **/*.svg
3
+ **/*.ejs
4
+ **/*.html
@@ -0,0 +1,18 @@
1
+ {
2
+ "overrides": [
3
+ {
4
+ "files": ".prettierrc",
5
+ "options": { "parser": "json" }
6
+ }
7
+ ],
8
+ "printWidth": 100,
9
+ "tabWidth": 4,
10
+ "useTabs": false,
11
+ "semi": false,
12
+ "singleQuote": true,
13
+ "trailingComma": "none",
14
+ "bracketSpacing": true,
15
+ "bracketSameLine": false,
16
+ "arrowParens": "avoid",
17
+ "rangeStart": 0
18
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "extends": "stylelint-config-standard",
3
+ "rules": {
4
+ "comment-empty-line-before": "never",
5
+ "no-empty-source": null,
6
+ "alpha-value-notation": null,
7
+ "color-function-notation": null,
8
+ "no-descending-specificity": null,
9
+ "at-rule-no-unknown": [
10
+ true,
11
+ {
12
+ "ignoreAtRules": ["tailwind", "apply", "use"]
13
+ }
14
+ ],
15
+ "selector-pseudo-class-no-unknown": [
16
+ true,
17
+ {
18
+ "ignorePseudoClasses": ["global"]
19
+ }
20
+ ],
21
+ "selector-class-pattern": null
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "recommendations": [
3
+ "dbaeumer.vscode-eslint",
4
+ "stylelint.vscode-stylelint",
5
+ "esbenp.prettier-vscode"
6
+ ]
7
+ }
@@ -0,0 +1,14 @@
1
+ ## Vite + react18 + Typescript
2
+
3
+ ### Features
4
+ - Vite 3.x
5
+ - React 18.x
6
+ - Typescript 4.x
7
+ - react-router 6.x
8
+ - Zustand 4.x
9
+ - Tailwindcss 3.x
10
+ - Jest 28.x
11
+ - Eslint
12
+ - Prettier
13
+ - axios 1.x
14
+ - Alias @ to <project_root>/src
@@ -0,0 +1 @@
1
+ module.exports = { extends: ['@commitlint/config-conventional'] }
@@ -0,0 +1,55 @@
1
+ /** @type {import('@jest/types').Config.InitialOptions} */
2
+ module.exports = {
3
+ // The test environment that will be used for testing, jsdom for browser environment
4
+ // https://jestjs.io/docs/configuration#testenvironment-string
5
+ testEnvironment: 'jsdom',
6
+
7
+ // A list of paths to directories that Jest should use to search for files in
8
+ // https://jestjs.io/docs/configuration#roots-arraystring
9
+ roots: ['<rootDir>/src/'],
10
+
11
+ // The glob patterns Jest uses to detect test files.
12
+ // https://jestjs.io/docs/configuration#testmatch-arraystring
13
+ testMatch: ['**/*.spec.ts?(x)'],
14
+
15
+ // Jest transformations
16
+ // https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object
17
+ transform: {
18
+ '^.+\\.tsx?$': 'ts-jest' // Transform TypeScript files using ts-jest
19
+ },
20
+
21
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test file in the suite is executed
22
+ // https://jestjs.io/docs/configuration#setupfilesafterenv-array
23
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
24
+
25
+ // Code coverage config
26
+ // https://jestjs.io/docs/configuration#collectcoveragefrom-array
27
+ coverageDirectory: '<rootDir>/coverage/',
28
+ collectCoverageFrom: [
29
+ '<rootDir>/src/**/*.{ts,tsx}',
30
+ '!**/__mocks__/**',
31
+ '!**/node_modules/**',
32
+ '!**/*.d.ts'
33
+ ],
34
+
35
+ // Important: order matters, specific rules should be defined first
36
+ // https://jestjs.io/fr/docs/configuration#modulenamemapper-objectstring-string--arraystring
37
+ moduleNameMapper: {
38
+ // Handle CSS imports (with CSS modules)
39
+ // https://jestjs.io/docs/webpack#mocking-css-modules
40
+ '^.+\\.module\\.(css|sass|scss|less)$': 'identity-obj-proxy',
41
+
42
+ // Handle CSS imports (without CSS modules)
43
+ '^.+\\.(css|sass|scss|less)$': '<rootDir>/__mocks__/styleMock.js',
44
+
45
+ // Handle static assets
46
+ // https://jestjs.io/docs/webpack#handling-static-assets
47
+ '^.+\\.(jpg|jpeg|png|gif|webp|avif|svg|ttf|woff|woff2)$': `<rootDir>/__mocks__/fileMock.js`,
48
+
49
+ // Handle TypeScript path aliases
50
+ '^@/(.*)$': '<rootDir>/src/$1'
51
+ },
52
+
53
+ verbose: true,
54
+ testTimeout: 30000
55
+ }
@@ -0,0 +1,5 @@
1
+ // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
+ // allows you to do things like:
3
+ // expect(element).toHaveTextContent(/react/i)
4
+ // learn more: https://github.com/testing-library/jest-dom
5
+ import '@testing-library/jest-dom'