@p8ec/shared 1.3.3 → 1.4.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.
- package/dist/cjs/bin/p8-shared-cli.js +9 -6
- package/dist/cjs/eslintConfigRecommended.js +40 -29
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/prettierConfigRecommended.js +1 -1
- package/dist/esm/eslintConfigRecommended.js +14 -29
- package/dist/esm/index.js +1 -1
- package/dist/esm/prettierConfigRecommended.js +1 -1
- package/dist/types/eslintConfigRecommended.d.ts +3 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/prettierConfigRecommended.d.ts +1 -1
- package/package.json +12 -92
- /package/dist/assets/{.commitlintrc.cjs → commitlint.config.cjs} +0 -0
- /package/dist/assets/{.commitlintrc.mjs → commitlint.config.mjs} +0 -0
- /package/dist/assets/{.eslintrc.cjs → eslint.config.cjs} +0 -0
- /package/dist/assets/{.eslintrc.mjs → eslint.config.mjs} +0 -0
- /package/dist/assets/{.prettierrc.cjs → prettier.config.cjs} +0 -0
- /package/dist/assets/{.prettierrc.mjs → prettier.config.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 2024 Copyright P8 Enterprise Components, Inc.
|
|
5
5
|
* All Rights Reserved.
|
|
6
6
|
*/
|
|
7
7
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -51,9 +51,13 @@ Usage: ${self} [command] [options]
|
|
|
51
51
|
|
|
52
52
|
Commands:
|
|
53
53
|
init [cleanup]
|
|
54
|
-
Initializes a new P8
|
|
54
|
+
Initializes a new P8 repo.
|
|
55
55
|
Options:
|
|
56
56
|
cleanup: Removes redundant configurations from package.json.
|
|
57
|
+
dirn [levelsUp]
|
|
58
|
+
Returns the directory name of the caller.
|
|
59
|
+
Options:
|
|
60
|
+
levelsUp: The number of levels up to return the directory name.
|
|
57
61
|
`);
|
|
58
62
|
if (IS_DEV) {
|
|
59
63
|
writeLn(`DEVELOPMENT MODE`);
|
|
@@ -81,11 +85,11 @@ const initCleanup = (packageJson) => {
|
|
|
81
85
|
const init = (option) => {
|
|
82
86
|
const packageJson = JSON.parse(String(fs.readFileSync(path.join(process.cwd(), 'package.json'))));
|
|
83
87
|
const moduleType = packageJson['type'] === 'module' ? 'mjs' : 'cjs';
|
|
84
|
-
writeLn(`Creating .
|
|
88
|
+
writeLn(`Creating eslint.config.${moduleType}...`);
|
|
85
89
|
copyAsset(`.eslintrc.${moduleType}`);
|
|
86
|
-
writeLn(`Creating .
|
|
90
|
+
writeLn(`Creating prettier.config.${moduleType}...`);
|
|
87
91
|
copyAsset(`.prettierrc.${moduleType}`);
|
|
88
|
-
writeLn(`Creating .
|
|
92
|
+
writeLn(`Creating commitlint.config.${moduleType}...`);
|
|
89
93
|
copyAsset(`.commitlintrc.${moduleType}`);
|
|
90
94
|
writeLn('Creating lefthook.yml...');
|
|
91
95
|
copyAsset('lefthook.yml');
|
|
@@ -110,7 +114,6 @@ switch (args[0]) {
|
|
|
110
114
|
writeLn(dirn(args[1]));
|
|
111
115
|
break;
|
|
112
116
|
default:
|
|
113
|
-
// eslint-disable-next-line no-console
|
|
114
117
|
console.error(`Unknown command: ${args[0]}`);
|
|
115
118
|
process.exit(1);
|
|
116
119
|
}
|
|
@@ -1,43 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 2024 Copyright P8 Enterprise Components, Inc.
|
|
4
4
|
* All Rights Reserved.
|
|
5
5
|
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
6
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
33
|
/**
|
|
8
34
|
* Recommended ESLint configuration for TypeScript projects.
|
|
9
35
|
*/
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
|
|
19
|
-
root: true,
|
|
20
|
-
env: {
|
|
21
|
-
node: true,
|
|
22
|
-
jest: true,
|
|
36
|
+
const js_1 = __importDefault(require("@eslint/js"));
|
|
37
|
+
const tslint = __importStar(require("typescript-eslint"));
|
|
38
|
+
const recommended_1 = __importDefault(require("eslint-plugin-prettier/recommended"));
|
|
39
|
+
// @ts-expect-error - importing from a JS file to TS:
|
|
40
|
+
const eslint_plugin_headers_1 = __importDefault(require("eslint-plugin-headers"));
|
|
41
|
+
exports.default = tslint.config(js_1.default.configs.recommended, ...tslint.configs.recommended, recommended_1.default, {
|
|
42
|
+
plugins: {
|
|
43
|
+
headers: eslint_plugin_headers_1.default,
|
|
23
44
|
},
|
|
24
45
|
rules: {
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
28
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
29
|
-
'@typescript-eslint/no-unused-vars': [
|
|
30
|
-
'error',
|
|
46
|
+
'headers/header-format': [
|
|
47
|
+
2,
|
|
31
48
|
{
|
|
32
|
-
|
|
49
|
+
source: 'string',
|
|
50
|
+
content: '2024 Copyright P8 Enterprise Components, Inc. \nAll Rights Reserved.',
|
|
33
51
|
},
|
|
34
52
|
],
|
|
35
|
-
'header/header': [
|
|
36
|
-
2,
|
|
37
|
-
'block',
|
|
38
|
-
['*', ' * 2023 Copyright P8 Enterprise Components, Inc.', ' * All Rights Reserved.', ' '],
|
|
39
|
-
2,
|
|
40
|
-
],
|
|
41
53
|
},
|
|
42
|
-
};
|
|
43
|
-
exports.default = eslintConfigRecommended;
|
|
54
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,41 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 2024 Copyright P8 Enterprise Components, Inc.
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Recommended ESLint configuration for TypeScript projects.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
|
|
17
|
-
root: true,
|
|
18
|
-
env: {
|
|
19
|
-
node: true,
|
|
20
|
-
jest: true,
|
|
8
|
+
import eslint from '@eslint/js';
|
|
9
|
+
import * as tslint from 'typescript-eslint';
|
|
10
|
+
import eslintPluginPrettierRecommendedConfig from 'eslint-plugin-prettier/recommended';
|
|
11
|
+
// @ts-expect-error - importing from a JS file to TS:
|
|
12
|
+
import eslintPluginHeaders from 'eslint-plugin-headers';
|
|
13
|
+
export default tslint.config(eslint.configs.recommended, ...tslint.configs.recommended, eslintPluginPrettierRecommendedConfig, {
|
|
14
|
+
plugins: {
|
|
15
|
+
headers: eslintPluginHeaders,
|
|
21
16
|
},
|
|
22
17
|
rules: {
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
26
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
27
|
-
'@typescript-eslint/no-unused-vars': [
|
|
28
|
-
'error',
|
|
18
|
+
'headers/header-format': [
|
|
19
|
+
2,
|
|
29
20
|
{
|
|
30
|
-
|
|
21
|
+
source: 'string',
|
|
22
|
+
content: '2024 Copyright P8 Enterprise Components, Inc. \nAll Rights Reserved.',
|
|
31
23
|
},
|
|
32
24
|
],
|
|
33
|
-
'header/header': [
|
|
34
|
-
2,
|
|
35
|
-
'block',
|
|
36
|
-
['*', ' * 2023 Copyright P8 Enterprise Components, Inc.', ' * All Rights Reserved.', ' '],
|
|
37
|
-
2,
|
|
38
|
-
],
|
|
39
25
|
},
|
|
40
|
-
};
|
|
41
|
-
export default eslintConfigRecommended;
|
|
26
|
+
});
|
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 2024 Copyright P8 Enterprise Components, Inc.
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* Recommended ESLint configuration for TypeScript projects.
|
|
8
|
-
*/
|
|
9
|
-
declare const eslintConfigRecommended: Partial<ClassicConfig.Config>;
|
|
10
|
-
export default eslintConfigRecommended;
|
|
5
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
6
|
+
export default _default;
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@p8ec/shared",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "P(8) Global Shared Library",
|
|
5
|
-
"license": "MIT",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "P(8) Global Shared Library for Javascript",
|
|
6
5
|
"repository": {
|
|
7
6
|
"type": "git",
|
|
8
7
|
"url": "git+https://github.com/p8ec/p8-shared.git"
|
|
@@ -19,8 +18,6 @@
|
|
|
19
18
|
"build:assets": "cp -R src/assets dist",
|
|
20
19
|
"clean": "rm -rf dist docs coverage",
|
|
21
20
|
"cli": "NODE_ENV=development ts-node src/bin/p8-shared-cli.ts",
|
|
22
|
-
"reset": "npm run clean && rm -rf node_modules && npm install",
|
|
23
|
-
"postinstall": "lefthook install",
|
|
24
21
|
"test": "jest --no-cache --runInBand",
|
|
25
22
|
"test:cov": "jest --coverage --no-cache --runInBand",
|
|
26
23
|
"lint": "eslint --cache \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
@@ -36,93 +33,16 @@
|
|
|
36
33
|
"main": "dist/cjs/index.js",
|
|
37
34
|
"module": "dist/esm/index.js",
|
|
38
35
|
"types": "dist/types/index.d.ts",
|
|
36
|
+
"license": "MIT",
|
|
39
37
|
"dependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"eslint": "^
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"eslint
|
|
49
|
-
"prettier": "^3.3.3"
|
|
50
|
-
},
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"@types/jest": "^29.5.12",
|
|
53
|
-
"jest": "^29.7.0",
|
|
54
|
-
"lint-staged": "^15.2.5",
|
|
55
|
-
"rimraf": "^5.0.7",
|
|
56
|
-
"ts-node": "^10.9.2",
|
|
57
|
-
"typescript": "^5.4.5"
|
|
58
|
-
},
|
|
59
|
-
"peerDependencies": {
|
|
60
|
-
"ferramenta": "^1.3.0"
|
|
61
|
-
},
|
|
62
|
-
"eslintConfig": {
|
|
63
|
-
"env": {
|
|
64
|
-
"node": true,
|
|
65
|
-
"jest": true
|
|
66
|
-
},
|
|
67
|
-
"parser": "@typescript-eslint/parser",
|
|
68
|
-
"plugins": [
|
|
69
|
-
"@typescript-eslint",
|
|
70
|
-
"header"
|
|
71
|
-
],
|
|
72
|
-
"extends": [
|
|
73
|
-
"eslint:recommended",
|
|
74
|
-
"plugin:@typescript-eslint/recommended",
|
|
75
|
-
"plugin:prettier/recommended"
|
|
76
|
-
],
|
|
77
|
-
"ignorePatterns": [
|
|
78
|
-
"node_modules",
|
|
79
|
-
"build",
|
|
80
|
-
"dist",
|
|
81
|
-
"docs",
|
|
82
|
-
"*.config.ts",
|
|
83
|
-
"*.config.js",
|
|
84
|
-
"*rc.ts",
|
|
85
|
-
"*rc.js",
|
|
86
|
-
"src/assets"
|
|
87
|
-
],
|
|
88
|
-
"rules": {
|
|
89
|
-
"@typescript-eslint/interface-name-prefix": "off",
|
|
90
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
91
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
92
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
93
|
-
"@typescript-eslint/no-unused-vars": [
|
|
94
|
-
"error",
|
|
95
|
-
{
|
|
96
|
-
"varsIgnorePattern": "^_"
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
"header/header": [
|
|
100
|
-
2,
|
|
101
|
-
"block",
|
|
102
|
-
[
|
|
103
|
-
"*",
|
|
104
|
-
" * 2023 Copyright P8 Enterprise Components, Inc.",
|
|
105
|
-
" * All Rights Reserved.",
|
|
106
|
-
" "
|
|
107
|
-
],
|
|
108
|
-
2
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"lint-staged": {
|
|
113
|
-
"*.{js,jsx,ts,tsx}": "npm run lint:fix"
|
|
114
|
-
},
|
|
115
|
-
"prettier": {
|
|
116
|
-
"singleQuote": true,
|
|
117
|
-
"trailingComma": "all",
|
|
118
|
-
"tabWidth": 2,
|
|
119
|
-
"useTabs": true,
|
|
120
|
-
"printWidth": 120,
|
|
121
|
-
"bracketSpacing": true
|
|
122
|
-
},
|
|
123
|
-
"commitlint": {
|
|
124
|
-
"extends": [
|
|
125
|
-
"@commitlint/config-conventional"
|
|
126
|
-
]
|
|
38
|
+
"@eslint/js": "^9.11.1",
|
|
39
|
+
"@types/eslint__js": "^8.42.3",
|
|
40
|
+
"eslint": "^9.11.1",
|
|
41
|
+
"eslint-config-prettier": "^9.1.0",
|
|
42
|
+
"eslint-plugin-headers": "^1.1.2",
|
|
43
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
44
|
+
"ferramenta": "^1.3.2",
|
|
45
|
+
"prettier": "^3.3.3",
|
|
46
|
+
"typescript-eslint": "^8.7.0"
|
|
127
47
|
}
|
|
128
48
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|