@lzear/forge 4.0.2 → 4.1.0

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 ADDED
@@ -0,0 +1,152 @@
1
+ # @lzear/forge
2
+
3
+ [![npm](https://img.shields.io/npm/v/@lzear/forge)](https://www.npmjs.com/package/@lzear/forge)
4
+ [![license](https://img.shields.io/npm/l/@lzear/forge)](../../LICENSE)
5
+
6
+ Umbrella package for lzear dev tooling. One dependency gives you ESLint config, shared build configs, commitlint config, repo compliance checks, and the `forge` CLI.
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install -D @lzear/forge
12
+ # or
13
+ yarn add -D @lzear/forge
14
+ ```
15
+
16
+ Requires Node ≥ 20.
17
+
18
+ ## CLI
19
+
20
+ ```sh
21
+ yarn forge check # audit this repo against forge standards
22
+ yarn forge setup # check and set required GitHub secrets
23
+ yarn forge sync # pull shared files from forge into this repo
24
+ ```
25
+
26
+ ### `forge check`
27
+
28
+ Audits the current repo (or a list of remote repos) against forge standards: README, badges, license, CI workflow, package hygiene (`publint`, `attw`, `knip`), and up-to-date dependencies.
29
+
30
+ ```sh
31
+ forge check # current repo
32
+ forge check --repos lzear/votes # remote repo (clones via gh)
33
+ forge check --repos lzear/a,lzear/b # multiple repos
34
+ forge check --json # machine-readable output
35
+ forge check --skip-remote # skip GitHub secret checks
36
+ ```
37
+
38
+ ### `forge setup`
39
+
40
+ Checks and sets the required GitHub secrets (`NPM_TOKEN`, `CODACY_PROJECT_TOKEN`) for a repo.
41
+
42
+ ```sh
43
+ forge setup # auto-detects repo from git remote
44
+ forge setup --repo lzear/my-repo
45
+ forge setup --dry # check only, do not prompt
46
+ ```
47
+
48
+ ### `forge sync`
49
+
50
+ Fetches shared template files from the forge `main` branch and writes them locally.
51
+
52
+ ```sh
53
+ forge sync # write .editorconfig, .codacy.yml, lefthook.yml
54
+ forge sync --dry # preview without writing
55
+ ```
56
+
57
+ ## ESLint config
58
+
59
+ ```ts
60
+ // eslint.config.ts
61
+ import lzearConfig from '@lzear/forge/eslint'
62
+
63
+ export default await lzearConfig()
64
+ ```
65
+
66
+ See [`@lzear/eslint-config`](https://www.npmjs.com/package/@lzear/eslint-config) for full options and extension examples.
67
+
68
+ ## tsconfig
69
+
70
+ ```json
71
+ {
72
+ "extends": "@lzear/forge/tsconfig/lib"
73
+ }
74
+ ```
75
+
76
+ Presets: `lib`, `app`, `react`.
77
+
78
+ ## tsup
79
+
80
+ ```ts
81
+ // tsup.config.ts
82
+ import { defineLibConfig } from '@lzear/forge/tsup'
83
+
84
+ export default defineLibConfig({ index: 'src/index.ts' })
85
+ ```
86
+
87
+ ## vitest
88
+
89
+ ```ts
90
+ // vitest.config.ts
91
+ import config from '@lzear/forge/vitest'
92
+
93
+ export default config
94
+ ```
95
+
96
+ For React: `@lzear/forge/vitest/react`.
97
+
98
+ ## vite
99
+
100
+ ```ts
101
+ // vite.config.ts
102
+ import config from '@lzear/forge/vite'
103
+
104
+ export default config
105
+ ```
106
+
107
+ ## commitlint
108
+
109
+ ```ts
110
+ // commitlint.config.ts
111
+ import config from '@lzear/forge/commitlint'
112
+
113
+ export default config
114
+ ```
115
+
116
+ Enforces [Conventional Commits](https://www.conventionalcommits.org/) with `header-max-length` of 100. Pair with `lefthook.yml` (via `forge sync`) to run on every commit.
117
+
118
+ Require every commit to start with an emoji:
119
+
120
+ ```ts
121
+ import emoji from '@lzear/forge/commitlint/emoji'
122
+
123
+ export default emoji
124
+ ```
125
+
126
+ Combine both:
127
+
128
+ ```ts
129
+ import base from '@lzear/forge/commitlint'
130
+ import emoji from '@lzear/forge/commitlint/emoji'
131
+
132
+ export default {
133
+ ...base,
134
+ plugins: [...(base.plugins ?? []), ...(emoji.plugins ?? [])],
135
+ rules: { ...base.rules, ...emoji.rules },
136
+ }
137
+ ```
138
+
139
+ ## Repo compliance
140
+
141
+ Programmatic access to the checks run by `forge check`:
142
+
143
+ ```ts
144
+ import { checkLocal, checkRepo } from '@lzear/forge/repo-lint'
145
+
146
+ const report = await checkLocal()
147
+ console.log(report.results)
148
+ ```
149
+
150
+ ## Source
151
+
152
+ [github.com/lzear/forge](https://github.com/lzear/forge)
package/dist/bin.js CHANGED
@@ -212,7 +212,8 @@ program.command("setup").description("check and set required GitHub secrets for
212
212
  });
213
213
  var SYNC_FILES = [
214
214
  { src: "template/.editorconfig", dest: ".editorconfig" },
215
- { src: "template/.codacy.yml", dest: ".codacy.yml" }
215
+ { src: "template/.codacy.yml", dest: ".codacy.yml" },
216
+ { src: "template/lefthook.yml", dest: "lefthook.yml" }
216
217
  ];
217
218
  var RAW_BASE = "https://raw.githubusercontent.com/lzear/forge/main";
218
219
  program.command("sync").description("sync template files from forge into this repo").option("--dry", "print what would change, do not write", false).action(async (opts) => {
@@ -0,0 +1,8 @@
1
+ export { default } from '@lzear/configs/commitlint';
2
+ import '@lzear/configs/commitlint/emoji';
3
+ import '@lzear/eslint-config';
4
+ import '@lzear/configs/vitest';
5
+ import '@lzear/configs/vitest/react';
6
+ import '@lzear/configs/tsup';
7
+ import '@lzear/configs/vite';
8
+ import '@lzear/repo-lint';
@@ -0,0 +1 @@
1
+ export { default } from '@lzear/configs/commitlint/emoji';
@@ -0,0 +1,5 @@
1
+ // src/commitlint-emoji.ts
2
+ import { default as default2 } from "@lzear/configs/commitlint/emoji";
3
+ export {
4
+ default2 as default
5
+ };
@@ -0,0 +1,5 @@
1
+ // src/commitlint.ts
2
+ import { default as default2 } from "@lzear/configs/commitlint";
3
+ export {
4
+ default2 as default
5
+ };
package/dist/eslint.d.ts CHANGED
@@ -1,6 +1 @@
1
1
  export { default } from '@lzear/eslint-config';
2
- import '@lzear/configs/vitest';
3
- import '@lzear/configs/vitest/react';
4
- import '@lzear/configs/tsup';
5
- import '@lzear/configs/vite';
6
- import '@lzear/repo-lint';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lzear/forge",
3
- "version": "4.0.2",
3
+ "version": "4.1.0",
4
4
  "description": "Umbrella package for all lzear dev tooling",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,6 +12,14 @@
12
12
  "sideEffects": false,
13
13
  "type": "module",
14
14
  "exports": {
15
+ "./commitlint": {
16
+ "types": "./dist/commitlint.d.ts",
17
+ "default": "./dist/commitlint.js"
18
+ },
19
+ "./commitlint/emoji": {
20
+ "types": "./dist/commitlint.emoji.d.ts",
21
+ "default": "./dist/commitlint.emoji.js"
22
+ },
15
23
  "./eslint": {
16
24
  "types": "./dist/eslint.d.ts",
17
25
  "default": "./dist/eslint.js"
@@ -52,9 +60,9 @@
52
60
  },
53
61
  "dependencies": {
54
62
  "@clack/prompts": "^1",
55
- "@lzear/configs": "4.0.2",
56
- "@lzear/eslint-config": "4.0.2",
57
- "@lzear/repo-lint": "4.0.2",
63
+ "@lzear/configs": "4.1.0",
64
+ "@lzear/eslint-config": "4.1.0",
65
+ "@lzear/repo-lint": "4.1.0",
58
66
  "commander": "^14",
59
67
  "picocolors": "^1"
60
68
  },
@@ -62,7 +70,6 @@
62
70
  "@types/node": "^25",
63
71
  "@vitejs/plugin-react": "^6",
64
72
  "eslint": "^9",
65
- "jsdom": "^29",
66
73
  "tsup": "^8",
67
74
  "typescript": "^6",
68
75
  "vite": "^8",
@@ -71,7 +78,6 @@
71
78
  "peerDependencies": {
72
79
  "@vitejs/plugin-react": "^6",
73
80
  "eslint": "^9",
74
- "jsdom": "^29",
75
81
  "tsup": "^8",
76
82
  "vite": "^8",
77
83
  "vitest": "^4"