@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 CHANGED
@@ -1,15 +1,62 @@
1
- # dev-config
1
+ # `@cubing/dev-config`
2
2
 
3
- To install dependencies:
3
+ ## Usage
4
4
 
5
- ```bash
6
- bun install
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
- To run:
18
+ ### TypeScript
10
19
 
11
- ```bash
12
- bun run index.ts
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
- This project was created using `bun init` in bun v1.2.11. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
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.0"
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
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "extends": "../tsconfig.json",
3
3
  "compilerOptions": {
4
- "lib": ["es2022"],
4
+ "lib": ["es2022"]
5
5
  }
6
6
  }
@@ -8,13 +8,16 @@
8
8
  "outDir": "dist/types",
9
9
  "declaration": true,
10
10
  "emitDeclarationOnly": true,
11
-
12
11
  "verbatimModuleSyntax": true,
13
- "strict": true,
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
- "noPropertyAccessFromIndexSignature": true,
20
+ "strict": true,
18
21
  "strictNullChecks": true
19
22
  }
20
23
  }
@@ -1,13 +0,0 @@
1
- name: Publish GitHub release
2
-
3
- on:
4
- push:
5
- tags:
6
- - v*
7
-
8
- jobs:
9
- Publish:
10
- permissions:
11
- contents: write
12
- if: startsWith(github.ref, 'refs/tags/v')
13
- uses: cubing/actions-workflows/.github/workflows/publish-github-release.yaml@main
package/Makefile DELETED
@@ -1,15 +0,0 @@
1
- .PHONY: setup
2
- setup:
3
- bun install --frozen-lockfile
4
-
5
- .PHONY: publish
6
- publish:
7
- npm publish
8
-
9
- .PHONY: clean
10
- clean:
11
- # no-op
12
-
13
- .PHONY: reset
14
- reset: clean
15
- rm -rf ./node_modules
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
- }