@teispace/next-maker 1.16.1 → 1.17.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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/index.js +207 -201
- package/dist/index.js.map +4 -4
- package/dist/src/manifests/bundle-analyzer.manifest.d.ts.map +1 -1
- package/dist/src/manifests/dark-theme.manifest.d.ts.map +1 -1
- package/dist/src/manifests/i18n.manifest.d.ts.map +1 -1
- package/dist/src/manifests/redux.manifest.d.ts.map +1 -1
- package/dist/src/manifests/runner.d.ts.map +1 -1
- package/dist/src/manifests/transforms/next-config.d.ts +25 -0
- package/dist/src/manifests/transforms/next-config.d.ts.map +1 -0
- package/dist/src/manifests/transforms/unwrap-jsx.d.ts +32 -0
- package/dist/src/manifests/transforms/unwrap-jsx.d.ts.map +1 -0
- package/dist/src/manifests/types.d.ts +16 -3
- package/dist/src/manifests/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-analyzer.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/bundle-analyzer.manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bundle-analyzer.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/bundle-analyzer.manifest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,sBAAsB,EAAE,eAqBpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark-theme.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/dark-theme.manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dark-theme.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/dark-theme.manifest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,iBAAiB,EAAE,eAiB/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/i18n.manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/i18n.manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,YAAY,EAAE,eA4C1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redux.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/redux.manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redux.manifest.d.ts","sourceRoot":"","sources":["../../../src/manifests/redux.manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,eAiC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/manifests/runner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,kBAAkB,EAElB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAuBjB;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,eAAe,EACzB,aAAa,MAAM,KAClB,OAAO,CAAC,kBAAkB,CA8D5B,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,8DAA8D;IAC9D,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAC1B,UAAU,eAAe,EACzB,aAAa,MAAM,EACnB,UAAS;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,KACjC,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/manifests/runner.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,kBAAkB,EAElB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAuBjB;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,eAAe,EACzB,aAAa,MAAM,KAClB,OAAO,CAAC,kBAAkB,CA8D5B,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,8DAA8D;IAC9D,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAC1B,UAAU,eAAe,EACzB,aAAa,MAAM,EACnB,UAAS;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,KACjC,OAAO,CAAC,aAAa,CAmGvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transforms for `next.config.ts` — undo the wraps that `setupI18n` and
|
|
3
|
+
* `setupBundleAnalyzer` apply.
|
|
4
|
+
*
|
|
5
|
+
* Conservative: each helper bails out (returns `null`) if the file's shape
|
|
6
|
+
* has drifted away from the canonical pattern. Better to ask the user to
|
|
7
|
+
* resolve it than to corrupt their config.
|
|
8
|
+
*/
|
|
9
|
+
import type { RemoveTransform } from '../types';
|
|
10
|
+
/**
|
|
11
|
+
* Undo `setupI18n`'s wrap: removes
|
|
12
|
+
* - `import createNextIntlPlugin from 'next-intl/plugin';`
|
|
13
|
+
* - `const withNextIntl = createNextIntlPlugin(...);`
|
|
14
|
+
* - the `withNextIntl(...)` call inside the default export, replacing it
|
|
15
|
+
* with the inner argument.
|
|
16
|
+
*/
|
|
17
|
+
export declare const unwrapNextIntlPlugin: RemoveTransform;
|
|
18
|
+
/**
|
|
19
|
+
* Undo `setupBundleAnalyzer`'s wrap: removes
|
|
20
|
+
* - `import withBundleAnalyzer from '@next/bundle-analyzer';`
|
|
21
|
+
* - the `const bundleAnalyzer = withBundleAnalyzer({ ... });` block.
|
|
22
|
+
* - the `bundleAnalyzer(...)` call inside the default export.
|
|
23
|
+
*/
|
|
24
|
+
export declare const unwrapBundleAnalyzer: RemoveTransform;
|
|
25
|
+
//# sourceMappingURL=next-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-config.d.ts","sourceRoot":"","sources":["../../../../src/manifests/transforms/next-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAsBlC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAmBlC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSX unwrap helpers used by manifests' `removePattern` to undo a provider
|
|
3
|
+
* chain wrap (e.g. unwrap `<NextIntlClientProvider>{children}</NextIntlClientProvider>`
|
|
4
|
+
* back to `{children}`) and clean up the now-orphan import statement.
|
|
5
|
+
*
|
|
6
|
+
* String-only transforms — no AST. Conservative: bail out (return `null`) when
|
|
7
|
+
* the file shape has drifted from the canonical pattern instead of guessing.
|
|
8
|
+
*/
|
|
9
|
+
import type { RemoveTransform } from '../types';
|
|
10
|
+
/**
|
|
11
|
+
* Drop a named or default import for `symbol`. If the import was the only
|
|
12
|
+
* symbol in a named-import block, the whole line is removed; otherwise the
|
|
13
|
+
* symbol is excised from the brace list.
|
|
14
|
+
*/
|
|
15
|
+
export declare const removeNamedImport: (content: string, symbol: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Build a `RemoveTransform` that:
|
|
18
|
+
* 1. Locates `<ComponentName ...>` ... `</ComponentName>` in the file.
|
|
19
|
+
* 2. Replaces the wrap with its body, outdented by one level (2 spaces).
|
|
20
|
+
* 3. Drops the orphan import for `ComponentName`.
|
|
21
|
+
*
|
|
22
|
+
* Returns `null` (→ manual cleanup) when:
|
|
23
|
+
* - The opening tag isn't found.
|
|
24
|
+
* - The opening tag spans multiple lines (attributes broken across lines).
|
|
25
|
+
* - No matching closing tag at the same indent is found.
|
|
26
|
+
*
|
|
27
|
+
* The conservative bail-outs keep auto-removal trustworthy: if the user has
|
|
28
|
+
* customised the file beyond the canonical shape, we surface a manual hint
|
|
29
|
+
* rather than corrupt their JSX.
|
|
30
|
+
*/
|
|
31
|
+
export declare const unwrapJsxChain: (componentName: string) => RemoveTransform;
|
|
32
|
+
//# sourceMappingURL=unwrap-jsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwrap-jsx.d.ts","sourceRoot":"","sources":["../../../../src/manifests/transforms/unwrap-jsx.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,MAgCnE,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,GACxB,eAAe,MAAM,KAAG,eAwCxB,CAAC"}
|
|
@@ -48,6 +48,15 @@ export interface ScriptRequirement {
|
|
|
48
48
|
/** Optional exact-value check. When omitted, only the key's presence is checked. */
|
|
49
49
|
expectedValue?: string;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Custom remove transform.
|
|
53
|
+
*
|
|
54
|
+
* Receives the file's full content; returns either the transformed content
|
|
55
|
+
* (auto-removal succeeded) or `null` to fall back to manual cleanup
|
|
56
|
+
* (the file shape has drifted from what we expected and we'd rather
|
|
57
|
+
* surface it for human review than guess).
|
|
58
|
+
*/
|
|
59
|
+
export type RemoveTransform = (content: string) => string | null;
|
|
51
60
|
export interface CodeBlockRequirement {
|
|
52
61
|
/** File the block lives in, relative to the project root. */
|
|
53
62
|
file: string;
|
|
@@ -56,10 +65,14 @@ export interface CodeBlockRequirement {
|
|
|
56
65
|
/** RegExp that matches when the block is present (for both detection and drift). */
|
|
57
66
|
presence: RegExp;
|
|
58
67
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
68
|
+
* Strategy for removal. Either:
|
|
69
|
+
* - `RegExp`: matched content is replaced with empty string.
|
|
70
|
+
* - `RemoveTransform` function: returns the transformed file content, or
|
|
71
|
+
* `null` to surface as manual cleanup.
|
|
72
|
+
*
|
|
73
|
+
* If omitted entirely, `remove` reports the block as manual cleanup.
|
|
61
74
|
*/
|
|
62
|
-
removePattern?: RegExp;
|
|
75
|
+
removePattern?: RegExp | RemoveTransform;
|
|
63
76
|
}
|
|
64
77
|
export interface FeatureFootprint {
|
|
65
78
|
files: FileRequirement[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/manifests/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,eAAe,C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