@cubing/dev-config 0.3.2 → 0.3.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 +51 -7
- package/biome/biome.json +22 -0
- package/esbuild/es2022/index.js +2 -21
- package/esbuild/es2022/index.js.map +7 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
### `esbuild`
|
|
6
6
|
|
|
7
|
+
```shell
|
|
8
|
+
# using node
|
|
9
|
+
npm install --save-dev esbuild @cubing/dev-config
|
|
10
|
+
|
|
11
|
+
# using bun
|
|
12
|
+
bun add esbuild @cubing/dev-config
|
|
13
|
+
```
|
|
14
|
+
|
|
7
15
|
```js
|
|
8
16
|
// Or use `es2022Lib`
|
|
9
17
|
import { es2022App } from "@cubing/dev-config/esbuild/es2022";
|
|
@@ -16,9 +24,35 @@ await build({
|
|
|
16
24
|
});
|
|
17
25
|
```
|
|
18
26
|
|
|
27
|
+
### Biome
|
|
28
|
+
|
|
29
|
+
```jsonc
|
|
30
|
+
// biome.json
|
|
31
|
+
{
|
|
32
|
+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
33
|
+
"extends": ["./node_modules/@cubing/dev-config/biome/biome.json"],
|
|
34
|
+
"files": {
|
|
35
|
+
"ignore": [
|
|
36
|
+
"./dist",
|
|
37
|
+
"./package.json"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
# using node
|
|
45
|
+
npm install --save-dev @biomejs/biome @cubing/dev-config
|
|
46
|
+
npx @biomejs/biome check
|
|
47
|
+
|
|
48
|
+
# using bun
|
|
49
|
+
bun add @biomejs/biome @cubing/dev-config
|
|
50
|
+
bun x @biomejs/biome check
|
|
51
|
+
```
|
|
52
|
+
|
|
19
53
|
### TypeScript
|
|
20
54
|
|
|
21
|
-
|
|
55
|
+
#### Check types
|
|
22
56
|
|
|
23
57
|
```jsonc
|
|
24
58
|
// tsconfig.json
|
|
@@ -29,11 +63,16 @@ await build({
|
|
|
29
63
|
```
|
|
30
64
|
|
|
31
65
|
```shell
|
|
32
|
-
|
|
33
|
-
|
|
66
|
+
# using node
|
|
67
|
+
npm install --save-dev typescript @cubing/dev-config
|
|
68
|
+
npx tsc --noEmit --project .
|
|
69
|
+
|
|
70
|
+
# using bun
|
|
71
|
+
bun add --dev typescript @cubing/dev-config
|
|
72
|
+
bun x tsc --noEmit --project .
|
|
34
73
|
```
|
|
35
74
|
|
|
36
|
-
|
|
75
|
+
#### Build types
|
|
37
76
|
|
|
38
77
|
```jsonc
|
|
39
78
|
// tsconfig.json
|
|
@@ -47,11 +86,16 @@ bun x tsc --noEmit --project . # using bun
|
|
|
47
86
|
```
|
|
48
87
|
|
|
49
88
|
```shell
|
|
50
|
-
|
|
51
|
-
|
|
89
|
+
# using node
|
|
90
|
+
npm install --save-dev typescript @cubing/dev-config
|
|
91
|
+
npx tsc --project .
|
|
92
|
+
|
|
93
|
+
# using bun
|
|
94
|
+
bun add --dev typescript @cubing/dev-config
|
|
95
|
+
bun x tsc --project .
|
|
52
96
|
```
|
|
53
97
|
|
|
54
|
-
|
|
98
|
+
#### No DOM
|
|
55
99
|
|
|
56
100
|
Use the `no-dom` variant instead:
|
|
57
101
|
|
package/biome/biome.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
+
"formatter": {
|
|
4
|
+
"indentStyle": "space",
|
|
5
|
+
"indentWidth": 2
|
|
6
|
+
},
|
|
7
|
+
"linter": {
|
|
8
|
+
"rules": {
|
|
9
|
+
"style": {
|
|
10
|
+
"useBlockStatements": "error"
|
|
11
|
+
},
|
|
12
|
+
"correctness": {
|
|
13
|
+
"noUnusedImports": "error"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"vcs": {
|
|
18
|
+
"clientKind": "git",
|
|
19
|
+
"enabled": true,
|
|
20
|
+
"useIgnoreFile": true
|
|
21
|
+
}
|
|
22
|
+
}
|
package/esbuild/es2022/index.js
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
format: "esm",
|
|
4
|
-
target: "es2022",
|
|
5
|
-
bundle: true,
|
|
6
|
-
splitting: true,
|
|
7
|
-
chunkNames: "chunks/[name]-[hash]",
|
|
8
|
-
sourcemap: true
|
|
9
|
-
};
|
|
10
|
-
export function es2022App(options) {
|
|
11
|
-
return {
|
|
12
|
-
...common,
|
|
13
|
-
minify: !options?.dev
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export function es2022Lib() {
|
|
17
|
-
return {
|
|
18
|
-
...es2022App,
|
|
19
|
-
packages: "external"
|
|
20
|
-
};
|
|
21
|
-
}
|
|
1
|
+
var t={format:"esm",target:"es2022",bundle:!0,splitting:!0,chunkNames:"chunks/[name]-[hash]",sourcemap:!0};function n(e){return{...t,minify:!e?.dev}}function s(){return{...n(),packages:"external"}}export{n as es2022App,s as es2022Lib};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/esbuild/es2022/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type { BuildOptions } from \"esbuild\";\n\nconst common = {\n format: \"esm\",\n target: \"es2022\",\n\n bundle: true,\n splitting: true,\n\n chunkNames: \"chunks/[name]-[hash]\",\n sourcemap: true,\n} as const satisfies BuildOptions;\n\nexport function es2022App(options?: { dev?: boolean }): BuildOptions {\n return {\n ...common,\n minify: !options?.dev,\n };\n}\n\nexport function es2022Lib(): BuildOptions {\n return {\n ...es2022App(),\n packages: \"external\",\n };\n}\n"],
|
|
5
|
+
"mappings": "AAEA,IAAMA,EAAS,CACb,OAAQ,MACR,OAAQ,SAER,OAAQ,GACR,UAAW,GAEX,WAAY,uBACZ,UAAW,EACb,EAEO,SAASC,EAAUC,EAA2C,CACnE,MAAO,CACL,GAAGF,EACH,OAAQ,CAACE,GAAS,GACpB,CACF,CAEO,SAASC,GAA0B,CACxC,MAAO,CACL,GAAGF,EAAU,EACb,SAAU,UACZ,CACF",
|
|
6
|
+
"names": ["common", "es2022App", "options", "es2022Lib"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cubing/dev-config",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"esbuild": "^0.25.3"
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"prepublishOnly": "make prepublishOnly"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
+
"./biome/",
|
|
23
24
|
"./esbuild/",
|
|
24
25
|
"./ts/"
|
|
25
26
|
]
|