@vfourny/node-toolkit 1.0.2 → 1.0.4
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 +7 -7
- package/package.json +38 -20
- package/{tsconfig.json → tsconfig.base.json} +13 -8
- package/.commitlintrc.js +0 -22
- package/eslint.config.js +0 -47
- package/prettier.config.js +0 -10
- package/release.config.js +0 -27
package/README.md
CHANGED
|
@@ -34,8 +34,8 @@ For `semantic-release` to work properly, certain environment variables must be d
|
|
|
34
34
|
|
|
35
35
|
## Configuration Files
|
|
36
36
|
|
|
37
|
-
- `eslint.config.
|
|
38
|
-
- `prettier.
|
|
37
|
+
- `eslint.config.ts`: ESLint configuration for JavaScript code linting.
|
|
38
|
+
- `prettier.js`: Prettier configuration for JavaScript code formatting.
|
|
39
39
|
- `tsconfig.json`: TypeScript configuration for transpiling TypeScript code.
|
|
40
40
|
- `release.config.js`: Semantic Release configuration for version management.
|
|
41
41
|
- `commitlintrc.js`: Commitlint configuration for commit message validation.
|
|
@@ -45,7 +45,7 @@ For `semantic-release` to work properly, certain environment variables must be d
|
|
|
45
45
|
To import the ESLint configuration into your project, add the following code to your [ESLint](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-file) configuration file:
|
|
46
46
|
|
|
47
47
|
```javascript
|
|
48
|
-
import nodeToolkitEslintConfig from
|
|
48
|
+
import nodeToolkitEslintConfig from '@vfourny/node-toolkit/eslint'
|
|
49
49
|
|
|
50
50
|
export default {
|
|
51
51
|
...nodeToolkitEslintConfig,
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
To import the Prettier configuration into your project, add the following code to your [Prettier](https://prettier.io/docs/en/configuration.html) configuration file:
|
|
59
59
|
|
|
60
60
|
```javascript
|
|
61
|
-
import nodeToolkitPrettierConfig from
|
|
61
|
+
import nodeToolkitPrettierConfig from '@vfourny/node-toolkit/prettier'
|
|
62
62
|
|
|
63
63
|
export default {
|
|
64
64
|
...nodeToolkitPrettierConfig,
|
|
@@ -84,10 +84,10 @@ To import the TypeScript configuration into your project, add the following code
|
|
|
84
84
|
To import the Semantic Release configuration into your project, add the following code to your [Semantic Release](https://semantic-release.gitbook.io/semantic-release) configuration file:
|
|
85
85
|
|
|
86
86
|
```javascript
|
|
87
|
-
import nodeToolkitReleaseConfig from
|
|
87
|
+
import nodeToolkitReleaseConfig from '@vfourny/node-toolkit/release'
|
|
88
88
|
|
|
89
89
|
export default {
|
|
90
|
-
extends:
|
|
90
|
+
extends: '@vfourny/node-toolkit/release',
|
|
91
91
|
// Your custom configurations
|
|
92
92
|
}
|
|
93
93
|
```
|
|
@@ -98,7 +98,7 @@ To import the Commitlint configuration into your project, add the following code
|
|
|
98
98
|
|
|
99
99
|
```javascript
|
|
100
100
|
export default {
|
|
101
|
-
extends:
|
|
101
|
+
extends: '@vfourny/node-toolkit/commitlint',
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
104
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfourny/node-toolkit",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Toolkit for Node.js projects",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "dist/libs/index.js",
|
|
7
|
+
"types": "dist/libs/index.d.ts",
|
|
8
8
|
"private": false,
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "tsc",
|
|
10
|
+
"build": "tsc -b",
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"lint:fix": "eslint --fix .",
|
|
13
13
|
"format": "prettier --write .",
|
|
@@ -16,32 +16,51 @@
|
|
|
16
16
|
"prepare": "husky"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
-
"tsconfig.json",
|
|
20
|
-
"
|
|
21
|
-
"release.config.js",
|
|
22
|
-
"eslint.config.js",
|
|
23
|
-
"prettier.config.js"
|
|
19
|
+
"tsconfig.base.json",
|
|
20
|
+
"dist"
|
|
24
21
|
],
|
|
25
22
|
"exports": {
|
|
26
|
-
"./eslint":
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"./
|
|
23
|
+
"./eslint": {
|
|
24
|
+
"types": "./eslint.config.d.ts",
|
|
25
|
+
"default": "./eslint.config.js"
|
|
26
|
+
},
|
|
27
|
+
"./prettier": {
|
|
28
|
+
"types": "./prettier.config.d.ts",
|
|
29
|
+
"default": "./prettier.config.js"
|
|
30
|
+
},
|
|
31
|
+
"./commitlint": {
|
|
32
|
+
"types": "./.commitlintrc.d.ts",
|
|
33
|
+
"default": "./.commitlintrc.js"
|
|
34
|
+
},
|
|
35
|
+
"./release": {
|
|
36
|
+
"types": "./release.config.d.ts",
|
|
37
|
+
"default": "./release.config.js"
|
|
38
|
+
},
|
|
39
|
+
"./tsconfig": "./tsconfig.base.json"
|
|
31
40
|
},
|
|
32
|
-
"keywords": [
|
|
33
|
-
|
|
41
|
+
"keywords": [
|
|
42
|
+
"eslint",
|
|
43
|
+
"prettier",
|
|
44
|
+
"commitlint",
|
|
45
|
+
"semantic-release",
|
|
46
|
+
"formatting",
|
|
47
|
+
"linting",
|
|
48
|
+
"typescript"
|
|
49
|
+
],
|
|
50
|
+
"author": "Valentin Fourny",
|
|
34
51
|
"license": "ISC",
|
|
35
52
|
"dependencies": {
|
|
36
53
|
"@commitlint/config-angular": "^19.3.0",
|
|
37
54
|
"@semantic-release/changelog": "^6.0.3",
|
|
38
55
|
"@semantic-release/git": "^10.0.1",
|
|
39
56
|
"eslint-config-prettier": "^10.0.1",
|
|
40
|
-
"eslint-plugin-vue": "^9.32.0"
|
|
57
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
58
|
+
"typescript-eslint": "^8.0.0"
|
|
41
59
|
},
|
|
42
60
|
"devDependencies": {
|
|
43
61
|
"@eslint/js": "^9.4.0",
|
|
44
62
|
"@types/eslint__js": "^8.42.3",
|
|
63
|
+
"@types/eslint-config-prettier": "^6.11.3",
|
|
45
64
|
"@types/node": "^22.0.0",
|
|
46
65
|
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
47
66
|
"eslint": "^9.3.0",
|
|
@@ -49,8 +68,7 @@
|
|
|
49
68
|
"husky": "^9.0.11",
|
|
50
69
|
"prettier": "^3.2.5",
|
|
51
70
|
"semantic-release": "^24.0.0",
|
|
52
|
-
"typescript": "^5.4.5"
|
|
53
|
-
"typescript-eslint": "^8.0.0"
|
|
71
|
+
"typescript": "^5.4.5"
|
|
54
72
|
},
|
|
55
73
|
"repository": {
|
|
56
74
|
"type": "git",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"exclude": [
|
|
3
|
-
|
|
2
|
+
"exclude": [
|
|
3
|
+
"${configDir}/node_modules",
|
|
4
|
+
"${configDir}/dist",
|
|
5
|
+
"${configDir}/.nuxt",
|
|
6
|
+
"${configDir}/.output"
|
|
7
|
+
],
|
|
8
|
+
"include": ["${configDir}/src/**/*"],
|
|
4
9
|
"compilerOptions": {
|
|
5
10
|
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
6
11
|
|
|
@@ -27,9 +32,9 @@
|
|
|
27
32
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
28
33
|
|
|
29
34
|
/* Modules */
|
|
30
|
-
"module": "
|
|
31
|
-
//
|
|
32
|
-
"moduleResolution": "
|
|
35
|
+
"module": "ESNext" /* Specify what module code is generated. */,
|
|
36
|
+
// "rootDir": "${configDir}/src" /* Specify the root folder within your source files. */,
|
|
37
|
+
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
33
38
|
// "baseUrl": "." /* Specify the base directory to resolve non-relative module names. */,
|
|
34
39
|
// "paths": {} /* Specify a set of entries that re-map imports to additional lookup locations. */,
|
|
35
40
|
// "rootDirs": [] /* Allow multiple folders to be treated as one when resolving modules. */,
|
|
@@ -52,10 +57,10 @@
|
|
|
52
57
|
|
|
53
58
|
/* Emit */
|
|
54
59
|
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
55
|
-
|
|
60
|
+
"declarationMap": true /* Create sourcemaps for d.ts files. */,
|
|
56
61
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
57
|
-
//
|
|
58
|
-
|
|
62
|
+
// "sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
|
63
|
+
"inlineSourceMap": true /* Include sourcemap files inside the emitted JavaScript. */,
|
|
59
64
|
// "outFile": "./" /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */,
|
|
60
65
|
"outDir": "${configDir}/dist" /* Specify an output folder for all emitted files. */,
|
|
61
66
|
// "removeComments": true, /* Disable emitting comments. */
|
package/.commitlintrc.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
extends: ["@commitlint/config-angular"],
|
|
3
|
-
rules: {
|
|
4
|
-
"type-enum": [
|
|
5
|
-
2,
|
|
6
|
-
"always",
|
|
7
|
-
[
|
|
8
|
-
"build",
|
|
9
|
-
"ci",
|
|
10
|
-
"docs",
|
|
11
|
-
"feat",
|
|
12
|
-
"fix",
|
|
13
|
-
"perf",
|
|
14
|
-
"refactor",
|
|
15
|
-
"revert",
|
|
16
|
-
"style",
|
|
17
|
-
"test",
|
|
18
|
-
"chore",
|
|
19
|
-
],
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
}
|
package/eslint.config.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import eslintJS from '@eslint/js';
|
|
2
|
-
import tseslint from 'typescript-eslint';
|
|
3
|
-
import globals from 'globals';
|
|
4
|
-
import eslintPluginVue from 'eslint-plugin-vue';
|
|
5
|
-
import typescriptEslint from 'typescript-eslint';
|
|
6
|
-
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
7
|
-
|
|
8
|
-
const vueFilesConfig = {
|
|
9
|
-
name: 'eslint-config-seyrinian-tools/vue',
|
|
10
|
-
extends: [...eslintPluginVue.configs['flat/recommended']],
|
|
11
|
-
files: ['**/*.{ts,vue}'],
|
|
12
|
-
languageOptions: {
|
|
13
|
-
ecmaVersion: 'latest',
|
|
14
|
-
sourceType: 'module',
|
|
15
|
-
globals: globals.browser,
|
|
16
|
-
parserOptions: {
|
|
17
|
-
parser: typescriptEslint.parser,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
rules: {},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const defaultConfig = {
|
|
24
|
-
name: 'eslint-config-seyrinian-tools/default',
|
|
25
|
-
languageOptions: {
|
|
26
|
-
globals: {
|
|
27
|
-
...globals.node,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
rules: {
|
|
31
|
-
'no-console': 'error',
|
|
32
|
-
'no-debugger': 'error',
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default tseslint.config(
|
|
37
|
-
eslintJS.configs.recommended,
|
|
38
|
-
...tseslint.configs.recommended,
|
|
39
|
-
...tseslint.configs.strict,
|
|
40
|
-
...tseslint.configs.stylistic,
|
|
41
|
-
vueFilesConfig,
|
|
42
|
-
defaultConfig,
|
|
43
|
-
eslintConfigPrettier,
|
|
44
|
-
{
|
|
45
|
-
ignores: ['node_modules', 'dist/'],
|
|
46
|
-
},
|
|
47
|
-
);
|
package/prettier.config.js
DELETED
package/release.config.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
branches: ['main'],
|
|
3
|
-
plugins: [
|
|
4
|
-
'@semantic-release/commit-analyzer',
|
|
5
|
-
'@semantic-release/release-notes-generator',
|
|
6
|
-
[
|
|
7
|
-
'@semantic-release/changelog',
|
|
8
|
-
{
|
|
9
|
-
changelogFile: 'docs/CHANGELOG.md',
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
'@semantic-release/github',
|
|
13
|
-
[
|
|
14
|
-
'@semantic-release/npm',
|
|
15
|
-
{
|
|
16
|
-
npmPublish: process.env.PUBLISH === 'true',
|
|
17
|
-
pkgRoot: '.',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
[
|
|
21
|
-
'@semantic-release/git',
|
|
22
|
-
{
|
|
23
|
-
assets: ['docs/CHANGELOG.md', 'package.json', 'package-lock.json'],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
],
|
|
27
|
-
};
|