@plumeria/next-plugin 19.9.1 → 19.10.1
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 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -1
- package/dist/lint.d.ts +1 -0
- package/dist/lint.js +44 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ export default withPlumeria(nextConfig, {
|
|
|
55
55
|
| `styleProp` | `'classStyle'` | The JSX prop that carries styles. |
|
|
56
56
|
| `withoutLogicalProperties` | `false` | Reject the logical name of a property that also has a physical name. Takes `true` or `{ sizes?: boolean }`. |
|
|
57
57
|
| `withoutPhysicalProperties` | `false` | Reject the physical name of a property that also has a logical name. Takes `true` or `{ sizes?: boolean }`. |
|
|
58
|
+
| `lint` | `true` | Lint with `@plumeria/eslint-plugin` during `next build`, integrated into the build so it needs no setup. `false` builds without it. |
|
|
58
59
|
|
|
59
60
|
The two spelling options contradict each other, so enabling both is a configuration error. See [the docs](https://plumeria.dev/docs/api-reference/plugins/next-plugin) for why the pair has to be settled and how it lines up with the lint rules.
|
|
60
61
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { NextConfig } from 'next';
|
|
2
2
|
import type { LoaderOptions } from '@plumeria/turbopack-loader';
|
|
3
|
-
export
|
|
3
|
+
export type PlumeriaOptions = LoaderOptions & {
|
|
4
|
+
lint?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function withPlumeria(nextConfig?: NextConfig, { lint, ...options }?: PlumeriaOptions): NextConfig;
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.withPlumeria = withPlumeria;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
|
+
const guard_1 = require("@plumeria/eslint-plugin/guard");
|
|
39
|
+
const lint_1 = require("./lint");
|
|
38
40
|
const isRuleConfigItem = (rule) => !Array.isArray(rule) && typeof rule === 'object' && rule !== null;
|
|
39
41
|
function supportsRuleCondition() {
|
|
40
42
|
try {
|
|
@@ -45,7 +47,9 @@ function supportsRuleCondition() {
|
|
|
45
47
|
return false;
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
|
-
function withPlumeria(nextConfig = {}, options = {}) {
|
|
50
|
+
function withPlumeria(nextConfig = {}, { lint = true, ...options } = {}) {
|
|
51
|
+
if (lint)
|
|
52
|
+
(0, lint_1.startNextLintGuard)((0, guard_1.spellingRules)(options));
|
|
49
53
|
const globalRef = global;
|
|
50
54
|
if (!globalRef.__PLUMERIA_RESET_DONE__) {
|
|
51
55
|
globalRef.__PLUMERIA_RESET_DONE__ = true;
|
package/dist/lint.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function startNextLintGuard(rules?: Record<string, unknown>, argv?: string[]): boolean;
|
package/dist/lint.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.startNextLintGuard = startNextLintGuard;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const guard_1 = require("@plumeria/eslint-plugin/guard");
|
|
39
|
+
function startNextLintGuard(rules = {}, argv = process.argv) {
|
|
40
|
+
const [, bin = '', ...args] = argv;
|
|
41
|
+
if (path.basename(bin) !== 'next' || !args.includes('build'))
|
|
42
|
+
return false;
|
|
43
|
+
return (0, guard_1.startLintGuard)(rules);
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/next-plugin",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.10.1",
|
|
4
4
|
"description": "Plumeria Next.js plugin",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"dist/"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@plumeria/
|
|
40
|
+
"@plumeria/eslint-plugin": "19.10.1",
|
|
41
|
+
"@plumeria/turbopack-loader": "19.10.1"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"next": "^16.3.8",
|