@vitus-labs/tools-core 1.5.1 → 1.5.2-alpha.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/.nx/workspace-data/file-map.json +32 -0
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/project-graph.json +8 -0
- package/.nx/workspace-data/project-graph.lock +0 -0
- package/.nx/workspace-data/source-maps.json +1 -0
- package/CHANGELOG.md +16 -0
- package/LICENSE +1 -1
- package/lib/index.js +10 -11
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +7 -6
- package/lib/types/index.d.ts.map +1 -0
- package/package.json +10 -6
- package/src/index.ts +21 -19
- package/tsconfig.json +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6.0",
|
|
3
|
+
"nxVersion": "22.4.5",
|
|
4
|
+
"pathMappings": {
|
|
5
|
+
"~/*": [
|
|
6
|
+
"src/*"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"nxJsonPlugins": [],
|
|
10
|
+
"fileMap": {
|
|
11
|
+
"projectFileMap": {},
|
|
12
|
+
"nonProjectFiles": [
|
|
13
|
+
{
|
|
14
|
+
"file": "LICENSE",
|
|
15
|
+
"hash": "17482154891382589999"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"file": "package.json",
|
|
19
|
+
"hash": "2594283764174125095"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"file": "src/index.ts",
|
|
23
|
+
"hash": "3972003881634916772"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"file": "tsconfig.json",
|
|
27
|
+
"hash": "769188957405827409"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"externalNodesHash": "3244421341483603138"
|
|
32
|
+
}
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [1.5.2-alpha.1](https://github.com/vitus-labs/tools/compare/v1.5.2-alpha.0...v1.5.2-alpha.1) (2026-02-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @vitus-labs/tools-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.5.2-alpha.0](https://github.com/vitus-labs/tools/compare/v1.5.1...v1.5.2-alpha.0) (2026-02-06)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @vitus-labs/tools-core
|
package/LICENSE
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import { createRequire } from 'module';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
3
|
import { findUpSync } from 'find-up';
|
|
4
4
|
import { get as _get, merge } from 'lodash-es';
|
|
5
5
|
const VITUS_LABS_FILE_NAME = 'vl-tools.config.js';
|
|
@@ -14,7 +14,7 @@ const loadFileToJSON = (filename) => {
|
|
|
14
14
|
const file = findFile(filename);
|
|
15
15
|
if (!file)
|
|
16
16
|
return {};
|
|
17
|
-
let data;
|
|
17
|
+
let data = {};
|
|
18
18
|
// try to read an exported module first
|
|
19
19
|
try {
|
|
20
20
|
const importedFile = require(file);
|
|
@@ -22,15 +22,15 @@ const loadFileToJSON = (filename) => {
|
|
|
22
22
|
data = importedFile;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
catch (
|
|
26
|
-
// ignore
|
|
25
|
+
catch (_e) {
|
|
26
|
+
// ignore error
|
|
27
27
|
}
|
|
28
28
|
// try to read a plain json file like tsconfig.json
|
|
29
29
|
if (!data) {
|
|
30
30
|
try {
|
|
31
31
|
data = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
32
32
|
}
|
|
33
|
-
catch (
|
|
33
|
+
catch (_e) {
|
|
34
34
|
// ignore error
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -63,11 +63,11 @@ const getDependenciesList = (types) => {
|
|
|
63
63
|
// example: napespace-package-name => namespacePackageName
|
|
64
64
|
const camelspaceBundleName = (name) => {
|
|
65
65
|
const parsedName = name.replace('@', '').replace('/', '-');
|
|
66
|
-
const
|
|
66
|
+
const toCamelCase = (items) => items.map((item, i) => i === 0
|
|
67
67
|
? item
|
|
68
|
-
: item.charAt(0).toUpperCase() + item.
|
|
69
|
-
const
|
|
70
|
-
const result =
|
|
68
|
+
: item.charAt(0).toUpperCase() + item.slice(1).toLowerCase());
|
|
69
|
+
const parts = parsedName.split('-');
|
|
70
|
+
const result = toCamelCase(parts).join('');
|
|
71
71
|
return result;
|
|
72
72
|
};
|
|
73
73
|
// --------------------------------------------------------
|
|
@@ -105,7 +105,7 @@ const loadVLToolsConfig = () => {
|
|
|
105
105
|
return object;
|
|
106
106
|
},
|
|
107
107
|
get: (param, defaultValue) => _get(object, param, defaultValue || {}),
|
|
108
|
-
merge: (param) => cloneAndEnhance(merge(
|
|
108
|
+
merge: (param) => cloneAndEnhance(merge(object, param)),
|
|
109
109
|
});
|
|
110
110
|
const getOutput = (key) => {
|
|
111
111
|
const result = _get(externalConfig, key, {});
|
|
@@ -114,7 +114,6 @@ const loadVLToolsConfig = () => {
|
|
|
114
114
|
return getOutput;
|
|
115
115
|
};
|
|
116
116
|
const swapGlobals = (globals) => Object.entries(globals).reduce((acc, [key, value]) => {
|
|
117
|
-
// eslint-disable-next-line no-param-reassign
|
|
118
117
|
acc[value] = key;
|
|
119
118
|
return acc;
|
|
120
119
|
}, {});
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA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C,MAAM,eAAe,GAAG,CAAC,MAA2B,EAAE,EAAE,CAAC,CAAC;QACxD,IAAI,MAAM;YACR,OAAO,MAAM,CAAA;QACf,CAAC;QACD,GAAG,EAAE,CAAC,KAAa,EAAE,YAAkB,EAAE,EAAE,CACzC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,IAAI,EAAE,CAAC;QACzC,KAAK,EAAE,CAAC,KAA0B,EAAE,EAAE,CACpC,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACxC,CAAC,CAAA;IAEF,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;QAE5C,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,OAA+B,EAAE,EAAE,CACtD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAC5B,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;IACpB,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAA;IAChB,OAAO,GAAG,CAAA;AACZ,CAAC,EACD,EAAE,CACH,CAAA;AAEH,MAAM,GAAG,GAAG,UAAU,EAAE,CAAA;AACxB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAA;AACrC,MAAM,SAAS,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAA;AAEtD,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,GAAG,EACH,SAAS,EACT,SAAS,GACV,CAAA"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
declare const findFile: (filename: string) => string | undefined;
|
|
2
|
-
declare const loadFileToJSON: (filename: string) => any
|
|
2
|
+
declare const loadFileToJSON: (filename: string) => Record<string, any>;
|
|
3
3
|
declare const loadConfigParam: (filename: string) => (key: string, defaultValue?: {}) => any;
|
|
4
4
|
declare const loadVLToolsConfig: () => (key: string) => {
|
|
5
|
-
readonly config: any
|
|
5
|
+
readonly config: Record<string, any>;
|
|
6
6
|
get: (param: string, defaultValue?: any) => any;
|
|
7
7
|
merge: (param: Record<string, any>) => /*elided*/ any;
|
|
8
8
|
};
|
|
9
|
-
declare const swapGlobals: (globals: Record<string, string>) =>
|
|
10
|
-
declare const PKG: any
|
|
9
|
+
declare const swapGlobals: (globals: Record<string, string>) => Record<string, string>;
|
|
10
|
+
declare const PKG: Record<string, any>;
|
|
11
11
|
declare const VL_CONFIG: (key: string) => {
|
|
12
|
-
readonly config: any
|
|
12
|
+
readonly config: Record<string, any>;
|
|
13
13
|
get: (param: string, defaultValue?: any) => any;
|
|
14
14
|
merge: (param: Record<string, any>) => /*elided*/ any;
|
|
15
15
|
};
|
|
16
|
-
declare const TS_CONFIG: any
|
|
16
|
+
declare const TS_CONFIG: Record<string, any>;
|
|
17
17
|
export { findFile, loadConfigParam, loadFileToJSON, loadVLToolsConfig, swapGlobals, PKG, VL_CONFIG, TS_CONFIG, };
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,QAAQ,GAAI,UAAU,MAAM,uBAA2C,CAAA;AAE7E,QAAA,MAAM,cAAc,GAAI,UAAU,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CA4B5D,CAAA;AA2ED,QAAA,MAAM,eAAe,GAClB,UAAU,MAAM,MAChB,KAAK,MAAM,EAAE,iBAAiB,QAI9B,CAAA;AAEH,QAAA,MAAM,iBAAiB,cAaG,MAAM;;iBANf,MAAM,iBAAiB,GAAG;mBAExB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAWrC,CAAA;AAED,QAAA,MAAM,WAAW,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,2BAOjD,CAAA;AAEH,QAAA,MAAM,GAAG,qBAAe,CAAA;AACxB,QAAA,MAAM,SAAS,QAnBW,MAAM;;iBANf,MAAM,iBAAiB,GAAG;mBAExB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAuBD,CAAA;AACrC,QAAA,MAAM,SAAS,qBAAuC,CAAA;AAEtD,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,GAAG,EACH,SAAS,EACT,SAAS,GACV,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitus-labs/tools-core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Vit Bokisch <vit@bokisch.com>",
|
|
6
6
|
"maintainers": [
|
|
7
7
|
"Vit Bokisch <vit@bokisch.com>"
|
|
8
8
|
],
|
|
9
9
|
"type": "module",
|
|
10
|
-
"exports":
|
|
11
|
-
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/types/index.d.ts",
|
|
13
|
+
"import": "./lib/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
12
16
|
"engines": {
|
|
13
17
|
"node": ">= 22"
|
|
14
18
|
},
|
|
@@ -16,7 +20,7 @@
|
|
|
16
20
|
"access": "public"
|
|
17
21
|
},
|
|
18
22
|
"scripts": {
|
|
19
|
-
"prepublish": "
|
|
23
|
+
"prepublish": "bun run build",
|
|
20
24
|
"build": "tsc"
|
|
21
25
|
},
|
|
22
26
|
"dependencies": {
|
|
@@ -25,8 +29,8 @@
|
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
31
|
"@types/lodash-es": "^4.17.12",
|
|
28
|
-
"@vitus-labs/tools-typescript": "1.5.
|
|
32
|
+
"@vitus-labs/tools-typescript": "1.5.2-alpha.0",
|
|
29
33
|
"typescript": "^5.9.3"
|
|
30
34
|
},
|
|
31
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "5b0b8c0a427559dff76158176367fd9b3588dc60"
|
|
32
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
|
-
import { createRequire } from 'module'
|
|
2
|
+
import { createRequire } from 'node:module'
|
|
3
3
|
import { findUpSync } from 'find-up'
|
|
4
4
|
import { get as _get, merge } from 'lodash-es'
|
|
5
5
|
|
|
@@ -14,12 +14,12 @@ const require = createRequire(import.meta.url)
|
|
|
14
14
|
// --------------------------------------------------------
|
|
15
15
|
const findFile = (filename: string) => findUpSync(filename, { type: 'file' })
|
|
16
16
|
|
|
17
|
-
const loadFileToJSON = (filename: string) => {
|
|
17
|
+
const loadFileToJSON = (filename: string): Record<string, any> => {
|
|
18
18
|
const file = findFile(filename)
|
|
19
19
|
|
|
20
20
|
if (!file) return {}
|
|
21
21
|
|
|
22
|
-
let data
|
|
22
|
+
let data: Record<string, any> = {}
|
|
23
23
|
|
|
24
24
|
// try to read an exported module first
|
|
25
25
|
try {
|
|
@@ -28,15 +28,15 @@ const loadFileToJSON = (filename: string) => {
|
|
|
28
28
|
if (importedFile) {
|
|
29
29
|
data = importedFile
|
|
30
30
|
}
|
|
31
|
-
} catch (
|
|
32
|
-
// ignore
|
|
31
|
+
} catch (_e) {
|
|
32
|
+
// ignore error
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// try to read a plain json file like tsconfig.json
|
|
36
36
|
if (!data) {
|
|
37
37
|
try {
|
|
38
38
|
data = JSON.parse(fs.readFileSync(file, 'utf-8'))
|
|
39
|
-
} catch (
|
|
39
|
+
} catch (_e) {
|
|
40
40
|
// ignore error
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -78,14 +78,14 @@ const getDependenciesList = (types: any) => {
|
|
|
78
78
|
// example: napespace-package-name => namespacePackageName
|
|
79
79
|
const camelspaceBundleName = (name: string) => {
|
|
80
80
|
const parsedName = name.replace('@', '').replace('/', '-')
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const toCamelCase = (items: any) =>
|
|
82
|
+
items.map((item: any, i: any) =>
|
|
83
83
|
i === 0
|
|
84
84
|
? item
|
|
85
|
-
: item.charAt(0).toUpperCase() + item.
|
|
85
|
+
: item.charAt(0).toUpperCase() + item.slice(1).toLowerCase(),
|
|
86
86
|
)
|
|
87
|
-
const
|
|
88
|
-
const result =
|
|
87
|
+
const parts = parsedName.split('-')
|
|
88
|
+
const result = toCamelCase(parts).join('')
|
|
89
89
|
|
|
90
90
|
return result
|
|
91
91
|
}
|
|
@@ -93,7 +93,7 @@ const camelspaceBundleName = (name: string) => {
|
|
|
93
93
|
// --------------------------------------------------------
|
|
94
94
|
// PACKAGE JSON DATA
|
|
95
95
|
// --------------------------------------------------------
|
|
96
|
-
const getPkgData = () => {
|
|
96
|
+
const getPkgData = (): Record<string, any> => {
|
|
97
97
|
const pkg = getPackageJSON()
|
|
98
98
|
const { name } = pkg
|
|
99
99
|
// const namespace = parseNamespace(name)
|
|
@@ -128,14 +128,14 @@ const loadConfigParam =
|
|
|
128
128
|
const loadVLToolsConfig = () => {
|
|
129
129
|
const externalConfig = getExternalConfig()
|
|
130
130
|
|
|
131
|
-
const cloneAndEnhance = (object) => ({
|
|
131
|
+
const cloneAndEnhance = (object: Record<string, any>) => ({
|
|
132
132
|
get config() {
|
|
133
133
|
return object
|
|
134
134
|
},
|
|
135
135
|
get: (param: string, defaultValue?: any) =>
|
|
136
136
|
_get(object, param, defaultValue || {}),
|
|
137
137
|
merge: (param: Record<string, any>) =>
|
|
138
|
-
cloneAndEnhance(merge(
|
|
138
|
+
cloneAndEnhance(merge(object, param)),
|
|
139
139
|
})
|
|
140
140
|
|
|
141
141
|
const getOutput = (key: string) => {
|
|
@@ -148,11 +148,13 @@ const loadVLToolsConfig = () => {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
const swapGlobals = (globals: Record<string, string>) =>
|
|
151
|
-
Object.entries(globals).reduce
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
Object.entries(globals).reduce<Record<string, string>>(
|
|
152
|
+
(acc, [key, value]) => {
|
|
153
|
+
acc[value] = key
|
|
154
|
+
return acc
|
|
155
|
+
},
|
|
156
|
+
{},
|
|
157
|
+
)
|
|
156
158
|
|
|
157
159
|
const PKG = getPkgData()
|
|
158
160
|
const VL_CONFIG = loadVLToolsConfig()
|