esmate 0.0.4 → 0.0.6
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/cli/index.js +0 -0
- package/cli/modes.js +7 -1
- package/eslint/node.d.ts +1 -1
- package/eslint/react.d.ts +1 -1
- package/eslint/react.js +6 -8
- package/eslint/shared.d.ts +1 -1
- package/package.json +4 -3
- package/prettier/shared.d.ts +1 -1
- package/prettier/shared.js +5 -2
- package/prettier/tailwind.d.ts +1 -1
- package/utils.d.ts +1 -0
- package/utils.js +3 -0
- package/vite/index.d.ts +1 -1
- package/vite/index.js +1 -1
- package/vite/react.d.ts +2 -1
- package/vite/react.js +7 -2
package/cli/index.js
CHANGED
|
File without changes
|
package/cli/modes.js
CHANGED
|
@@ -74,11 +74,17 @@ export function lib(program) {
|
|
|
74
74
|
esmate.build();
|
|
75
75
|
yield executeMany([
|
|
76
76
|
{
|
|
77
|
-
name: '
|
|
77
|
+
name: 'esmate',
|
|
78
78
|
command: 'npx tsc --watch',
|
|
79
79
|
args: [],
|
|
80
80
|
prefixColor: 'blue',
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
name: 'esmate',
|
|
84
|
+
command: 'npx tsc-alias --watch',
|
|
85
|
+
args: [],
|
|
86
|
+
prefixColor: 'cyan',
|
|
87
|
+
},
|
|
82
88
|
]);
|
|
83
89
|
// https://www.npmjs.com/package/glob-watcher
|
|
84
90
|
// watch files to fix and format
|
package/eslint/node.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function node(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
1
|
+
export declare function node(): import("../eslint").Linter.Config<import("../eslint").Linter.RulesRecord>[];
|
package/eslint/react.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function react(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
1
|
+
export declare function react(): import("../eslint").Linter.Config<import("../eslint").Linter.RulesRecord>[];
|
package/eslint/react.js
CHANGED
|
@@ -11,14 +11,12 @@ export function react() {
|
|
|
11
11
|
{
|
|
12
12
|
files: ['**/*.?(c|m)[jt]s?(x)'],
|
|
13
13
|
languageOptions: Object.assign(Object.assign({}, languageOptions), { globals: globals.browser }),
|
|
14
|
-
extends: [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
prettier(),
|
|
21
|
-
],
|
|
14
|
+
extends: [gitIgnore(), javaScript.configs.recommended, ...typeScript.configs.recommended, prettier()],
|
|
15
|
+
plugins: {
|
|
16
|
+
'react-hooks': reactHooks,
|
|
17
|
+
'react-refresh': reactRefresh,
|
|
18
|
+
},
|
|
19
|
+
rules: Object.assign(Object.assign({}, reactHooks.configs.recommended.rules), { 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }] }),
|
|
22
20
|
},
|
|
23
21
|
]);
|
|
24
22
|
}
|
package/eslint/shared.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esmate",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"esmate": "lib",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"prettier": "^3.5.3",
|
|
24
24
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
25
25
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
26
|
+
"tsc-alias": "^1.8.15",
|
|
26
27
|
"typescript": "^5.8.3",
|
|
27
28
|
"typescript-eslint": "^8.29.0",
|
|
28
29
|
"vite": "^6.2.5",
|
|
@@ -31,8 +32,8 @@
|
|
|
31
32
|
"zod": "^3.24.2"
|
|
32
33
|
},
|
|
33
34
|
"bin": {
|
|
34
|
-
"esm": "
|
|
35
|
-
"esmate": "
|
|
35
|
+
"esm": "cli/index.js",
|
|
36
|
+
"esmate": "cli/index.js"
|
|
36
37
|
},
|
|
37
38
|
"exports": {
|
|
38
39
|
"./eslint": {
|
package/prettier/shared.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Config } from 'prettier';
|
|
1
|
+
import { Config } from '../prettier';
|
|
2
2
|
export declare function defineConfig(configs: Config[]): Config;
|
package/prettier/shared.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { uniq } from 'es-toolkit';
|
|
2
2
|
export function defineConfig(configs) {
|
|
3
3
|
const defaultConfig = {
|
|
4
|
-
tabWidth: 2,
|
|
5
4
|
semi: true,
|
|
5
|
+
tabWidth: 2,
|
|
6
6
|
printWidth: 120,
|
|
7
7
|
singleQuote: true,
|
|
8
|
-
trailingComma: '
|
|
8
|
+
trailingComma: 'none',
|
|
9
9
|
plugins: ['prettier-plugin-organize-imports'],
|
|
10
10
|
};
|
|
11
11
|
for (const config of configs) {
|
|
@@ -15,6 +15,9 @@ export function defineConfig(configs) {
|
|
|
15
15
|
const plugins = defaultConfig.plugins || [];
|
|
16
16
|
defaultConfig.plugins = uniq([...plugins, ...value]);
|
|
17
17
|
}
|
|
18
|
+
else {
|
|
19
|
+
defaultConfig[key] = value;
|
|
20
|
+
}
|
|
18
21
|
// if (isJSONArray(value)) {
|
|
19
22
|
// const array = (defaultConfig[key] as undefined) || [];
|
|
20
23
|
// defaultConfig[key] = uniq([...array, ...value]);
|
package/prettier/tailwind.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ interface Options {
|
|
|
6
6
|
tailwindPreserveWhitespace?: boolean;
|
|
7
7
|
tailwindPreserveDuplicates?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare function tailwind(options: Options): import("prettier").Config;
|
|
9
|
+
export declare function tailwind(options: Options): import("../prettier").Config;
|
|
10
10
|
export {};
|
package/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const rootDir: string;
|
package/utils.js
ADDED
package/vite/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineConfig } from 'vite';
|
|
1
|
+
export { defineConfig } from '../vite';
|
|
2
2
|
export * as react from './react.js';
|
package/vite/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineConfig } from 'vite';
|
|
1
|
+
export { defineConfig } from '../vite';
|
|
2
2
|
export * as react from './react.js';
|
package/vite/react.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export declare function spa(options?: SpaOptions): {
|
|
|
13
13
|
build: {
|
|
14
14
|
outDir: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
publicDir: string;
|
|
17
|
+
plugins: (import("../vite").Plugin<any> | import("../vite").PluginOption[])[];
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
20
|
export declare function lib(): {};
|
package/vite/react.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import pages from 'vite-plugin-pages';
|
|
2
2
|
import paths from 'vite-tsconfig-paths';
|
|
3
3
|
import react from '@vitejs/plugin-react-swc';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { rootDir } from '../utils.js';
|
|
4
6
|
export function spa(options) {
|
|
5
7
|
return {
|
|
6
8
|
name: 'react-app',
|
|
7
9
|
config: () => ({
|
|
8
|
-
root: '
|
|
9
|
-
build: {
|
|
10
|
+
root: path.join(rootDir, 'src'),
|
|
11
|
+
build: {
|
|
12
|
+
outDir: path.join(rootDir, 'dist'),
|
|
13
|
+
},
|
|
14
|
+
publicDir: path.join(rootDir, 'public'),
|
|
10
15
|
plugins: [paths(options === null || options === void 0 ? void 0 : options.paths), pages(options === null || options === void 0 ? void 0 : options.pages), react(options === null || options === void 0 ? void 0 : options.react)],
|
|
11
16
|
}),
|
|
12
17
|
};
|