@cubing/dev-config 0.1.0 → 0.1.2
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 +55 -8
- package/esbuild/es2022/index.ts +14 -0
- package/package.json +16 -1
- package/ts/es2022-types/no-dom/tsconfig.json +1 -1
- package/ts/es2022-types/tsconfig.json +6 -3
- package/.github/workflows/publish-github-release.yaml +0 -13
- package/Makefile +0 -15
- package/index.ts +0 -1
- package/tsconfig.json +0 -28
package/README.md
CHANGED
|
@@ -1,15 +1,62 @@
|
|
|
1
|
-
# dev-config
|
|
1
|
+
# `@cubing/dev-config`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Usage
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
### `esbuild`
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { es2022 } from "@cubing/dev-config/esbuild/es2022";
|
|
9
|
+
import { build } from "esbuild";
|
|
10
|
+
|
|
11
|
+
await build({
|
|
12
|
+
...es2022,
|
|
13
|
+
entryPoints: ["src/index.ts"],
|
|
14
|
+
outdir: "./dist/lib/",
|
|
15
|
+
});
|
|
7
16
|
```
|
|
8
17
|
|
|
9
|
-
|
|
18
|
+
### TypeScript
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
### Check types
|
|
21
|
+
|
|
22
|
+
```jsonc
|
|
23
|
+
// tsconfig.json
|
|
24
|
+
{
|
|
25
|
+
"extends": "./node_modules/@cubing/dev-config/ts/es2022-types/tsconfig.json",
|
|
26
|
+
"include": ["./src/"]
|
|
27
|
+
}
|
|
13
28
|
```
|
|
14
29
|
|
|
15
|
-
|
|
30
|
+
```shell
|
|
31
|
+
npx tsc --noEmit --project . # using node
|
|
32
|
+
bun x tsc --noEmit --project . # using bun
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Build types
|
|
36
|
+
|
|
37
|
+
```jsonc
|
|
38
|
+
// tsconfig.json
|
|
39
|
+
{
|
|
40
|
+
"extends": "./node_modules/@cubing/dev-config/ts/es2022-types/tsconfig.json",
|
|
41
|
+
"compilerOptions": {
|
|
42
|
+
"outDir": "./dist/lib/types"
|
|
43
|
+
},
|
|
44
|
+
"include": ["./src/"]
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```shell
|
|
49
|
+
npx tsc --project . # using node
|
|
50
|
+
bun x tsc --project . # using bun
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## No DOM
|
|
54
|
+
|
|
55
|
+
Use the `no-dom` variant instead:
|
|
56
|
+
|
|
57
|
+
```jsonc
|
|
58
|
+
// tsconfig.json
|
|
59
|
+
{
|
|
60
|
+
"extends": "./node_modules/@cubing/dev-config/ts/es2022-types/no-dom/tsconfig.json"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BuildOptions } from "esbuild";
|
|
2
|
+
|
|
3
|
+
export const es2022 = {
|
|
4
|
+
format: "esm",
|
|
5
|
+
target: "es2022",
|
|
6
|
+
|
|
7
|
+
bundle: true,
|
|
8
|
+
splitting: true,
|
|
9
|
+
|
|
10
|
+
chunkNames: "chunks/[name]-[hash]",
|
|
11
|
+
sourcemap: true,
|
|
12
|
+
|
|
13
|
+
packages: "external",
|
|
14
|
+
} as const satisfies BuildOptions;
|
package/package.json
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cubing/dev-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"esbuild": "^0.25.3"
|
|
6
|
+
},
|
|
7
|
+
"devDependencies": {
|
|
8
|
+
"@biomejs/biome": "^1.9.4"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
"./esbuild/es2022": {
|
|
12
|
+
"import": "./esbuild/es2022/index.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"./esbuild/",
|
|
17
|
+
"./ts/"
|
|
18
|
+
]
|
|
4
19
|
}
|
|
@@ -8,13 +8,16 @@
|
|
|
8
8
|
"outDir": "dist/types",
|
|
9
9
|
"declaration": true,
|
|
10
10
|
"emitDeclarationOnly": true,
|
|
11
|
-
|
|
12
11
|
"verbatimModuleSyntax": true,
|
|
13
|
-
|
|
12
|
+
|
|
14
13
|
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noImplicitAny": true,
|
|
15
|
+
"noImplicitOverride": true,
|
|
16
|
+
"noImplicitReturns": true,
|
|
17
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
15
18
|
"noUnusedLocals": true,
|
|
16
19
|
"noUnusedParameters": true,
|
|
17
|
-
"
|
|
20
|
+
"strict": true,
|
|
18
21
|
"strictNullChecks": true
|
|
19
22
|
}
|
|
20
23
|
}
|
package/Makefile
DELETED
package/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log("Hello via Bun!");
|
package/tsconfig.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Environment setup & latest features
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noUncheckedIndexedAccess": true,
|
|
22
|
-
|
|
23
|
-
// Some stricter flags (disabled by default)
|
|
24
|
-
"noUnusedLocals": false,
|
|
25
|
-
"noUnusedParameters": false,
|
|
26
|
-
"noPropertyAccessFromIndexSignature": false
|
|
27
|
-
}
|
|
28
|
-
}
|