next-workers-kit 2.0.2 → 2.0.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 +1 -1
- package/dist/eslint.d.ts +1 -1
- package/dist/eslint.js +6 -31
- package/dist/lib/doctor.js +1 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ export default function config(phase: string): NextConfig {
|
|
|
90
90
|
| ------------ | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
91
91
|
| `root` | required | Repo root, for typed linting and import resolution |
|
|
92
92
|
| `typography` | `false` | Text styles only through `src/components/typography.tsx` |
|
|
93
|
-
| `installed` | shadcn paths | Files you install and never edit;
|
|
93
|
+
| `installed` | shadcn paths | Files you install and never edit; never linted |
|
|
94
94
|
| `shared` | `components`, `hooks`, `lib`, `i18n`, `fonts`, `styles`, `types` | Folders under `src/` that count as shared code |
|
|
95
95
|
| `og` | `[]` | Extra files rendered by `next/og`, exempt from the class rules (`opengraph-image`, `twitter-image`, `icon`, `apple-icon` always are) |
|
|
96
96
|
| `ignores` | `[]` | Extra ignored paths |
|
package/dist/eslint.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface Options {
|
|
|
4
4
|
root: string;
|
|
5
5
|
/** Allow text styles only through `src/components/typography.tsx`. */
|
|
6
6
|
typography?: boolean;
|
|
7
|
-
/** Files installed and never edited (shadcn by default);
|
|
7
|
+
/** Files installed and never edited (shadcn by default); never linted. */
|
|
8
8
|
installed?: string[];
|
|
9
9
|
/** Folders under `src/` that count as shared code. */
|
|
10
10
|
shared?: string[];
|
package/dist/eslint.js
CHANGED
|
@@ -124,10 +124,9 @@ function imports() {
|
|
|
124
124
|
},
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function style(
|
|
127
|
+
function style() {
|
|
128
128
|
return {
|
|
129
129
|
files: sources,
|
|
130
|
-
ignores: installed,
|
|
131
130
|
rules: {
|
|
132
131
|
curly: ["error", "all"],
|
|
133
132
|
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
@@ -140,11 +139,11 @@ function style(installed) {
|
|
|
140
139
|
},
|
|
141
140
|
};
|
|
142
141
|
}
|
|
143
|
-
function classes(roles,
|
|
142
|
+
function classes(roles, og) {
|
|
144
143
|
return [
|
|
145
144
|
{
|
|
146
145
|
files: app,
|
|
147
|
-
ignores: [
|
|
146
|
+
ignores: ["src/components/typography.tsx", ...og],
|
|
148
147
|
plugins: { web },
|
|
149
148
|
rules: {
|
|
150
149
|
"web/spacing": "error",
|
|
@@ -167,30 +166,6 @@ function classes(roles, installed, og) {
|
|
|
167
166
|
: []),
|
|
168
167
|
];
|
|
169
168
|
}
|
|
170
|
-
function vendored(installed) {
|
|
171
|
-
return defineConfig({
|
|
172
|
-
files: installed,
|
|
173
|
-
extends: [tseslint.configs.disableTypeChecked],
|
|
174
|
-
rules: {
|
|
175
|
-
"react-hooks/exhaustive-deps": "off",
|
|
176
|
-
"react-hooks/immutability": "off",
|
|
177
|
-
"react-hooks/purity": "off",
|
|
178
|
-
"react-hooks/refs": "off",
|
|
179
|
-
"react-hooks/set-state-in-effect": "off",
|
|
180
|
-
"react-hooks/static-components": "off",
|
|
181
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
182
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
183
|
-
"@typescript-eslint/consistent-type-definitions": "off",
|
|
184
|
-
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
|
185
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
|
186
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
|
187
|
-
"jsx-a11y/heading-has-content": "off",
|
|
188
|
-
"jsx-a11y/anchor-has-content": "off",
|
|
189
|
-
"jsx-a11y/label-has-associated-control": "off",
|
|
190
|
-
"jsx-a11y/no-autofocus": "off",
|
|
191
|
-
},
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
169
|
export function config({ root, typography = false, installed = defaults.installed, shared = defaults.shared, og = [], ignores = [], }) {
|
|
195
170
|
if (!root) {
|
|
196
171
|
throw new Error("Pass the repo root: config({ root: import.meta.dirname }).");
|
|
@@ -205,6 +180,7 @@ export function config({ root, typography = false, installed = defaults.installe
|
|
|
205
180
|
".wrangler/**",
|
|
206
181
|
"next-env.d.ts",
|
|
207
182
|
"cloudflare-env.d.ts",
|
|
183
|
+
...installed,
|
|
208
184
|
...ignores,
|
|
209
185
|
]),
|
|
210
186
|
...nextVitals,
|
|
@@ -229,9 +205,8 @@ export function config({ root, typography = false, installed = defaults.installe
|
|
|
229
205
|
layers(root, shared),
|
|
230
206
|
features(),
|
|
231
207
|
imports(),
|
|
232
|
-
...classes(typography,
|
|
208
|
+
...classes(typography, [...defaults.og, ...og]),
|
|
233
209
|
prettier,
|
|
234
|
-
style(
|
|
235
|
-
...vendored(installed),
|
|
210
|
+
style(),
|
|
236
211
|
]);
|
|
237
212
|
}
|
package/dist/lib/doctor.js
CHANGED
|
@@ -256,10 +256,7 @@ export function doctor(root) {
|
|
|
256
256
|
if (wrangler.observability?.enabled !== true) {
|
|
257
257
|
report("wrangler.jsonc", "set observability.enabled: true");
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
260
|
-
report("wrangler.jsonc", "declare the site's custom domains in routes");
|
|
261
|
-
}
|
|
262
|
-
else if (wrangler.dev?.host !== "localhost") {
|
|
259
|
+
if (wrangler.routes?.length && wrangler.dev?.host !== "localhost") {
|
|
263
260
|
report("wrangler.jsonc", 'set dev.host: "localhost" so local previews do not use the first route');
|
|
264
261
|
}
|
|
265
262
|
const secrets = wrangler.secrets?.required ?? [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-workers-kit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Config, structure rules and drift checks for Next.js on Cloudflare Workers (OpenNext): ESLint, TypeScript, Prettier and a project doctor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "pnilssson",
|