@w5s/dev 2.2.7 → 2.2.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/project.d.ts DELETED
@@ -1,89 +0,0 @@
1
- export declare namespace Project {
2
- /**
3
- * A type of a file extension
4
- */
5
- type Extension = `.${string}`;
6
- /**
7
- * Object hash of all well-known file extension category to file extensions mapping
8
- */
9
- interface ExtensionRegistry {
10
- graphql: readonly Extension[];
11
- jpeg: readonly Extension[];
12
- javascript: readonly Extension[];
13
- javascriptreact: readonly Extension[];
14
- typescript: readonly Extension[];
15
- typescriptreact: readonly Extension[];
16
- yaml: readonly Extension[];
17
- }
18
- /**
19
- * A list of "vscode-like" language identifiers (i.e. "javascript", "javascriptreact")
20
- */
21
- type LanguageId = keyof ExtensionRegistry;
22
- /**
23
- * Supported ECMA version
24
- *
25
- * @example
26
- * ```ts
27
- * Project.ecmaVersion() // 2022
28
- * ```
29
- */
30
- function ecmaVersion(): 2022;
31
- /**
32
- * Return a list of extensions
33
- *
34
- * @example
35
- * ```ts
36
- * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
37
- * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
38
- * ```
39
- *
40
- * @param languages
41
- */
42
- function queryExtensions(languages: LanguageId[]): readonly Extension[];
43
- /**
44
- * Supported file extensions
45
- *
46
- * @example
47
- * ```ts
48
- * Project.sourceExtensions() // ['.ts', '.js', ...]
49
- * ```
50
- */
51
- function sourceExtensions(): readonly `.${string}`[];
52
- /**
53
- * Resource file extensions
54
- *
55
- * @example
56
- * ```ts
57
- * Project.resourceExtensions() // ['.css', '.sass', ...]
58
- * ```
59
- */
60
- function resourceExtensions(): readonly `.${string}`[];
61
- /**
62
- * Files and folders to always ignore
63
- *
64
- * @example
65
- * ```ts
66
- * IGNORED // ['node_modules/', 'build/', ...]
67
- * ```
68
- */
69
- function ignored(): readonly string[];
70
- /**
71
- * Return a RegExp that will match any list of extensions
72
- *
73
- * @example
74
- * ```ts
75
- * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
76
- * ```
77
- */
78
- function extensionsToMatcher(extensions: readonly Extension[]): RegExp;
79
- /**
80
- * Return a glob matcher that will match any list of extensions
81
- *
82
- * @example
83
- * ```ts
84
- * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
85
- * ```
86
- */
87
- function extensionsToGlob(extensions: readonly Extension[]): string;
88
- }
89
- //# sourceMappingURL=project.d.ts.map
package/dist/project.js DELETED
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Project = void 0;
4
- function escapeRegExp(value) {
5
- return value.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&'); // $& means the whole matched string
6
- }
7
- var Project;
8
- (function (Project) {
9
- /**
10
- * Supported ECMA version
11
- *
12
- * @example
13
- * ```ts
14
- * Project.ecmaVersion() // 2022
15
- * ```
16
- */
17
- function ecmaVersion() {
18
- return 2022;
19
- }
20
- Project.ecmaVersion = ecmaVersion;
21
- const registry = {
22
- graphql: ['.gql', '.graphql'],
23
- jpeg: ['.jpg', '.jpeg'],
24
- javascript: ['.js', '.cjs', '.mjs'],
25
- javascriptreact: ['.jsx'],
26
- typescript: ['.ts', '.cts', '.mts'],
27
- typescriptreact: ['.tsx'],
28
- yaml: ['.yaml', '.yml'],
29
- };
30
- /**
31
- * Return a list of extensions
32
- *
33
- * @example
34
- * ```ts
35
- * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...]
36
- * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx']
37
- * ```
38
- *
39
- * @param languages
40
- */
41
- function queryExtensions(languages) {
42
- return languages
43
- .reduce(
44
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
45
- (previousValue, currentValue) => previousValue.concat(registry[currentValue] ?? []), [])
46
- .sort();
47
- }
48
- Project.queryExtensions = queryExtensions;
49
- /**
50
- * Supported file extensions
51
- *
52
- * @example
53
- * ```ts
54
- * Project.sourceExtensions() // ['.ts', '.js', ...]
55
- * ```
56
- */
57
- function sourceExtensions() {
58
- return queryExtensions(['javascript', 'javascriptreact', 'typescript', 'typescriptreact']);
59
- }
60
- Project.sourceExtensions = sourceExtensions;
61
- const RESOURCE_EXTENSIONS = Object.freeze([
62
- '.css',
63
- '.sass',
64
- '.scss',
65
- '.less',
66
- '.gif',
67
- '.png',
68
- '.svg',
69
- ...queryExtensions(['graphql', 'jpeg', 'yaml']),
70
- ]);
71
- /**
72
- * Resource file extensions
73
- *
74
- * @example
75
- * ```ts
76
- * Project.resourceExtensions() // ['.css', '.sass', ...]
77
- * ```
78
- */
79
- function resourceExtensions() {
80
- return RESOURCE_EXTENSIONS;
81
- }
82
- Project.resourceExtensions = resourceExtensions;
83
- const IGNORED = Object.freeze([
84
- 'node_modules/',
85
- 'build/',
86
- 'cjs/',
87
- 'coverage/',
88
- 'dist/',
89
- 'dts/',
90
- 'esm/',
91
- 'lib/',
92
- 'mjs/',
93
- 'umd/',
94
- ]);
95
- /**
96
- * Files and folders to always ignore
97
- *
98
- * @example
99
- * ```ts
100
- * IGNORED // ['node_modules/', 'build/', ...]
101
- * ```
102
- */
103
- function ignored() {
104
- return IGNORED;
105
- }
106
- Project.ignored = ignored;
107
- /**
108
- * Return a RegExp that will match any list of extensions
109
- *
110
- * @example
111
- * ```ts
112
- * Project.extensionsToMatcher(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/
113
- * ```
114
- */
115
- function extensionsToMatcher(extensions) {
116
- return new RegExp(`(${extensions.map(escapeRegExp).join('|')})$`);
117
- }
118
- Project.extensionsToMatcher = extensionsToMatcher;
119
- /**
120
- * Return a glob matcher that will match any list of extensions
121
- *
122
- * @example
123
- * ```ts
124
- * Project.extensionsToGlob(['.js', '.ts']) // '*.+(js|ts)'
125
- * ```
126
- */
127
- function extensionsToGlob(extensions) {
128
- return `*.+(${extensions.map((_) => _.replace(/^\./, '')).join('|')})`;
129
- }
130
- Project.extensionsToGlob = extensionsToGlob;
131
- })(Project || (exports.Project = Project = {}));
132
- //# sourceMappingURL=project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":";;;AAAA,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC,oCAAoC;AAC9F,CAAC;AAED,IAAiB,OAAO,CAsJvB;AAtJD,WAAiB,OAAO;IAwBtB;;;;;;;OAOG;IACH,SAAgB,WAAW;QACzB,OAAO,IAAa,CAAC;IACvB,CAAC;IAFe,mBAAW,cAE1B,CAAA;IAED,MAAM,QAAQ,GAAsB;QAClC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;QAC7B,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;QACvB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;QACnC,eAAe,EAAE,CAAC,MAAM,CAAC;QACzB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;QACnC,eAAe,EAAE,CAAC,MAAM,CAAC;QACzB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF;;;;;;;;;;OAUG;IACH,SAAgB,eAAe,CAAC,SAAuB;QACrD,OAAO,SAAS;aACb,MAAM;QACL,uEAAuE;QACvE,CAAC,aAAa,EAAE,YAAY,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAK,EAAkB,CAAC,EACpG,EAAE,CACH;aACA,IAAI,EAAE,CAAC;IACZ,CAAC;IARe,uBAAe,kBAQ9B,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,gBAAgB;QAC9B,OAAO,eAAe,CAAC,CAAC,YAAY,EAAE,iBAAiB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
- /**
2
- * Project common scripts
3
- */
4
- export declare const ProjectScript: {
5
- readonly Build: "build";
6
- readonly Clean: "clean";
7
- readonly CodeAnalysis: "code-analysis";
8
- readonly Coverage: "coverage";
9
- readonly Develop: "develop";
10
- readonly Docs: "docs";
11
- readonly Format: "format";
12
- readonly Install: "install";
13
- readonly Lint: "lint";
14
- readonly Prepare: "prepare";
15
- readonly Release: "release";
16
- readonly Rescue: "rescue";
17
- readonly Spellcheck: "spellcheck";
18
- readonly Test: "test";
19
- readonly Validate: "validate";
20
- };
21
- export type ProjectScript = (typeof ProjectScript)[keyof typeof ProjectScript];
22
- //# sourceMappingURL=projectScript.d.ts.map
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProjectScript = void 0;
4
- /**
5
- * Project common scripts
6
- */
7
- exports.ProjectScript = {
8
- Build: 'build',
9
- Clean: 'clean',
10
- CodeAnalysis: 'code-analysis',
11
- Coverage: 'coverage',
12
- Develop: 'develop',
13
- Docs: 'docs',
14
- Format: 'format',
15
- Install: 'install',
16
- Lint: 'lint',
17
- Prepare: 'prepare',
18
- Release: 'release',
19
- Rescue: 'rescue',
20
- Spellcheck: 'spellcheck',
21
- Test: 'test',
22
- Validate: 'validate',
23
- };
24
- //# sourceMappingURL=projectScript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projectScript.js","sourceRoot":"","sources":["../src/projectScript.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,eAAe;IAC7B,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;CACZ,CAAC"}