@gate-forge/pack-react-router 0.0.0-stage → 0.13.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/LICENSE +202 -0
- package/README.md +13 -2
- package/dist/detector.d.ts +52 -0
- package/dist/detector.d.ts.map +1 -0
- package/dist/detector.js +250 -0
- package/dist/detector.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +45 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 UKD
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gate-forge/pack-react-router
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Reads React Router JSX `<Route>` trees and `createBrowserRouter` / `useRoutes` route objects, resolves relative children, and emits plane-qualified `ui.page` resources with path parameters and source locations. Redirect-only and catch-all routes are excluded; unreadable paths become `PAGE_ROUTE_UNRESOLVED` entries.
|
|
4
|
+
|
|
5
|
+
Configure `pages.router: react-router` and owner-declared `pages.audiences` in `.gateforge.yml`. Frameworks without React Router can use `pages.router: manual` and `.gateforge/pages.yml`:
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
pages:
|
|
9
|
+
- path: /orders/:id
|
|
10
|
+
audience: tenant
|
|
11
|
+
source: src/routes.tsx:12
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The manual inventory requires an absolute route path, audience name, and repo-relative `file:line` source. Each plane-resolved page creates `page:loads` and `page:data-ok` obligations; both remain missing until a page proof channel is available.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface PageResource {
|
|
2
|
+
schemaVersion: 1;
|
|
3
|
+
id: string;
|
|
4
|
+
kind: 'ui.page';
|
|
5
|
+
source: string;
|
|
6
|
+
location: {
|
|
7
|
+
file: string;
|
|
8
|
+
line: number;
|
|
9
|
+
col: number;
|
|
10
|
+
};
|
|
11
|
+
detectorVersion: string;
|
|
12
|
+
attributes: {
|
|
13
|
+
path: string;
|
|
14
|
+
params: string[];
|
|
15
|
+
audience: string;
|
|
16
|
+
source: string;
|
|
17
|
+
resourceName: string;
|
|
18
|
+
plane?: 'tenant' | 'master' | 'global';
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface PageDetector {
|
|
22
|
+
discover(paths: readonly string[], context?: {
|
|
23
|
+
root?: string;
|
|
24
|
+
sections?: Record<string, unknown>;
|
|
25
|
+
}): {
|
|
26
|
+
resources: PageResource[];
|
|
27
|
+
unresolved: Array<{
|
|
28
|
+
code: string;
|
|
29
|
+
detail: string;
|
|
30
|
+
location: {
|
|
31
|
+
file: string;
|
|
32
|
+
line: number;
|
|
33
|
+
col: number;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
findings: Array<{
|
|
37
|
+
code: string;
|
|
38
|
+
detail: string;
|
|
39
|
+
locations: Array<{
|
|
40
|
+
file: string;
|
|
41
|
+
line: number;
|
|
42
|
+
col: number;
|
|
43
|
+
}>;
|
|
44
|
+
}>;
|
|
45
|
+
classificationSignals: [];
|
|
46
|
+
scannedPaths: string[];
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare function createPageDetector(options?: {
|
|
50
|
+
root?: string;
|
|
51
|
+
}): PageDetector;
|
|
52
|
+
//# sourceMappingURL=detector.d.ts.map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SAAS,EAAE,KAAK,CAAC;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAC;gBAAC,GAAG,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE,CAAC,CAAC;QAAC,qBAAqB,EAAE,EAAE,CAAC;QAAC,YAAY,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE;AAsBrb,wBAAgB,kBAAkB,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,YAAY,CAoLhF"}
|
package/dist/detector.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
|
+
import { relative, resolve, sep } from 'node:path';
|
|
4
|
+
import ts from 'typescript';
|
|
5
|
+
import { parse as parseYaml } from 'yaml';
|
|
6
|
+
const EXT = /\.(tsx?|jsx?)$/;
|
|
7
|
+
function files(input, root) {
|
|
8
|
+
const out = [];
|
|
9
|
+
const skipDirectories = { node_modules: true, dist: true, build: true, coverage: true, '.git': true, '.next': true, '.turbo': true, '.cache': true, __tests__: true, test: true, tests: true, e2e: true };
|
|
10
|
+
const walk = (p) => {
|
|
11
|
+
let st;
|
|
12
|
+
try {
|
|
13
|
+
st = statSync(p);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (st.isDirectory()) {
|
|
19
|
+
for (const name of readdirSync(p).sort())
|
|
20
|
+
if (skipDirectories[name] !== true)
|
|
21
|
+
walk(resolve(p, name));
|
|
22
|
+
}
|
|
23
|
+
else if (EXT.test(p) && !/\.(?:test|spec)\.[^.]+$/.test(p))
|
|
24
|
+
out.push(p);
|
|
25
|
+
};
|
|
26
|
+
for (const p of input)
|
|
27
|
+
walk(resolve(root, p));
|
|
28
|
+
return [...new Set(out)].sort();
|
|
29
|
+
}
|
|
30
|
+
function literal(node) { return node && ts.isStringLiteralLike(node) ? node.text : undefined; }
|
|
31
|
+
function cleanJoin(parent, child) { if (child.startsWith('/'))
|
|
32
|
+
return child; return `${parent.replace(/\/$/, '')}/${child}`.replace(/\/+/g, '/').replace(/\/$/, '') || '/'; }
|
|
33
|
+
const ROUTER_TAGS = { BrowserRouter: true, HashRouter: true, MemoryRouter: true };
|
|
34
|
+
const ROUTER_ROOT_TAGS = { ...ROUTER_TAGS, RouterProvider: true };
|
|
35
|
+
const ROUTER_FACTORIES = { createBrowserRouter: true, createHashRouter: true };
|
|
36
|
+
function withPrefix(prefix, path) { const base = prefix.replace(/\/+$/, ''); if (base === '')
|
|
37
|
+
return path; return `${base.startsWith('/') ? base : `/${base}`}${path === '/' ? '' : path}`.replace(/\/{2,}/g, '/').replace(/\/+$/, '') || '/'; }
|
|
38
|
+
function params(path) { return [...path.matchAll(/:([A-Za-z_$][\w$]*)/g)].map(m => m[1]); }
|
|
39
|
+
export function createPageDetector(options = {}) {
|
|
40
|
+
return { discover(paths, context) {
|
|
41
|
+
const root = options.root ?? context?.root ?? process.cwd();
|
|
42
|
+
const resources = [], unresolved = [];
|
|
43
|
+
const findings = [];
|
|
44
|
+
const scannedPaths = [];
|
|
45
|
+
const pageConfig = context?.sections?.pages;
|
|
46
|
+
const audiences = pageConfig?.audiences ?? [];
|
|
47
|
+
const basePath = pageConfig?.basePath ?? '';
|
|
48
|
+
const basenameDeclarations = [];
|
|
49
|
+
const add = (path, file, line, guard, redirect, catchall) => {
|
|
50
|
+
if (catchall || redirect || pageConfig?.exclude?.includes(path))
|
|
51
|
+
return;
|
|
52
|
+
const audienceConfig = audiences.find(a => (a.guard && a.guard === guard) || (a.pathPrefix && (path === a.pathPrefix || path.startsWith(`${a.pathPrefix.replace(/\/$/, '')}/`))));
|
|
53
|
+
const audience = audienceConfig?.name ?? 'unknown';
|
|
54
|
+
const slug = path.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'index';
|
|
55
|
+
const hash = createHash('sha256').update(`${audience}:${path}`).digest('hex').slice(0, 8);
|
|
56
|
+
const location = { file, line, col: 0 };
|
|
57
|
+
const resourceName = `page-${slug}-${hash}`;
|
|
58
|
+
const plane = audienceConfig?.plane ?? (['tenant', 'master', 'global'].includes(audience) ? audience : undefined);
|
|
59
|
+
const attributes = { path, params: params(path), audience, source: `${file}:${line}`, resourceName, ...(plane === undefined ? {} : { plane }) };
|
|
60
|
+
resources.push({ schemaVersion: 1, id: `${audience}.${resourceName}`, kind: 'ui.page', source: file, location, detectorVersion: '0.13.0', attributes });
|
|
61
|
+
};
|
|
62
|
+
if (pageConfig?.router === 'manual') {
|
|
63
|
+
const manualPath = resolve(root, '.gateforge/pages.yml');
|
|
64
|
+
if (!existsSync(manualPath)) {
|
|
65
|
+
unresolved.push({ code: 'PAGE_CONFIG_INVALID', detail: "pages.router is 'manual' but .gateforge/pages.yml is missing", location: { file: '.gateforge/pages.yml', line: 1, col: 0 } });
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
try {
|
|
69
|
+
const document = parseYaml(readFileSync(manualPath, 'utf8'));
|
|
70
|
+
if (!Array.isArray(document.pages))
|
|
71
|
+
throw new Error("expected 'pages' array");
|
|
72
|
+
for (const page of document.pages) {
|
|
73
|
+
if (typeof page.path !== 'string' || !page.path.startsWith('/') || typeof page.audience !== 'string' || typeof page.source !== 'string')
|
|
74
|
+
throw new Error('each page requires absolute path, audience and source');
|
|
75
|
+
const split = page.source.lastIndexOf(':');
|
|
76
|
+
if (split < 1)
|
|
77
|
+
throw new Error(`source must be file:line, got '${page.source}'`);
|
|
78
|
+
const sourceFile = page.source.slice(0, split);
|
|
79
|
+
const sourceLine = Number(page.source.slice(split + 1));
|
|
80
|
+
if (sourceFile.startsWith('/') || sourceFile.split('/').includes('..') || !Number.isInteger(sourceLine) || sourceLine < 1)
|
|
81
|
+
throw new Error(`invalid source location '${page.source}'`);
|
|
82
|
+
const pagePath = withPrefix(basePath, page.path);
|
|
83
|
+
if (pageConfig.exclude?.includes(pagePath))
|
|
84
|
+
continue;
|
|
85
|
+
const slug = pagePath.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'index';
|
|
86
|
+
const hash = createHash('sha256').update(`${page.audience}:${pagePath}`).digest('hex').slice(0, 8);
|
|
87
|
+
const resourceName = `page-${slug}-${hash}`;
|
|
88
|
+
const plane = audiences.find(a => a.name === page.audience)?.plane ?? (['tenant', 'master', 'global'].includes(page.audience) ? page.audience : undefined);
|
|
89
|
+
const attributes = { path: pagePath, params: params(pagePath), audience: page.audience, source: page.source, resourceName, ...(plane === undefined ? {} : { plane }) };
|
|
90
|
+
resources.push({ schemaVersion: 1, id: `${page.audience}.${resourceName}`, kind: 'ui.page', source: sourceFile, location: { file: sourceFile, line: sourceLine, col: 0 }, detectorVersion: '0.13.0', attributes });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
unresolved.push({ code: 'PAGE_CONFIG_INVALID', detail: `invalid .gateforge/pages.yml: ${error instanceof Error ? error.message : String(error)}`, location: { file: '.gateforge/pages.yml', line: 1, col: 0 } });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return { resources, unresolved, findings, classificationSignals: [], scannedPaths };
|
|
98
|
+
}
|
|
99
|
+
for (const full of files(paths, root)) {
|
|
100
|
+
let text;
|
|
101
|
+
try {
|
|
102
|
+
text = readFileSync(full, 'utf8');
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const file = relative(root, full).split(sep).join('/');
|
|
108
|
+
scannedPaths.push(file);
|
|
109
|
+
const source = ts.createSourceFile(file, text, ts.ScriptTarget.Latest, true, file.endsWith('x') ? ts.ScriptKind.TSX : ts.ScriptKind.TS);
|
|
110
|
+
let hasRouterRoot = false;
|
|
111
|
+
const scanForRouterRoot = (node) => {
|
|
112
|
+
if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) {
|
|
113
|
+
const tagNode = ts.isJsxElement(node) ? node.openingElement.tagName : node.tagName;
|
|
114
|
+
if (ROUTER_ROOT_TAGS[tagNode.getText(source).split('.').pop() ?? ''] === true) {
|
|
115
|
+
hasRouterRoot = true;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (ts.isCallExpression(node) && ROUTER_FACTORIES[node.expression.getText(source)] === true)
|
|
120
|
+
hasRouterRoot = true;
|
|
121
|
+
if (!hasRouterRoot)
|
|
122
|
+
ts.forEachChild(node, scanForRouterRoot);
|
|
123
|
+
};
|
|
124
|
+
scanForRouterRoot(source);
|
|
125
|
+
const visit = (node, parentPath = '', inheritedGuard, basename = '', dead = false) => {
|
|
126
|
+
if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) {
|
|
127
|
+
const tagName = ts.isJsxElement(node) ? node.openingElement.tagName : node.tagName;
|
|
128
|
+
const attributes = ts.isJsxElement(node) ? node.openingElement.attributes : node.attributes;
|
|
129
|
+
const tag = tagName.getText(source).split('.').pop();
|
|
130
|
+
if (tag !== undefined && ROUTER_TAGS[tag] === true) {
|
|
131
|
+
const basenameAttribute = attributes.properties.filter(ts.isJsxAttribute).find(a => a.name.getText(source) === 'basename');
|
|
132
|
+
if (basenameAttribute) {
|
|
133
|
+
const initializer = basenameAttribute.initializer;
|
|
134
|
+
const expression = initializer && ts.isJsxExpression(initializer) ? initializer.expression : initializer;
|
|
135
|
+
const value = literal(expression);
|
|
136
|
+
const routerLoc = source.getLineAndCharacterOfPosition(basenameAttribute.getStart(source));
|
|
137
|
+
if (value === undefined) {
|
|
138
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `computed or unreadable basename in ${file}:${routerLoc.line + 1}`, location: { file, line: routerLoc.line + 1, col: routerLoc.character } });
|
|
139
|
+
dead = true;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
basenameDeclarations.push({ value, file, line: routerLoc.line + 1, col: routerLoc.character });
|
|
143
|
+
basename = value;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (tag === 'Route') {
|
|
148
|
+
const attrs = attributes.properties.filter(ts.isJsxAttribute);
|
|
149
|
+
const pathAttr = attrs.find(a => a.name.getText(source) === 'path');
|
|
150
|
+
const pathInitializer = pathAttr?.initializer;
|
|
151
|
+
const pathExpression = pathInitializer && ts.isJsxExpression(pathInitializer) ? pathInitializer.expression : pathInitializer;
|
|
152
|
+
const path = pathExpression && ts.isStringLiteralLike(pathExpression) ? pathExpression.text : undefined;
|
|
153
|
+
const index = attrs.some(a => a.name.getText(source) === 'index');
|
|
154
|
+
const element = attrs.find(a => a.name.getText(source) === 'element')?.initializer;
|
|
155
|
+
const redirect = !!element && element.getText(source).includes('Navigate');
|
|
156
|
+
const guard = element?.getText(source).match(/<\s*([\w$.]*(?:Guard|ProtectedRoute))\b/)?.[1]?.split('.').pop() ?? inheritedGuard;
|
|
157
|
+
const loc = source.getLineAndCharacterOfPosition(node.getStart(source));
|
|
158
|
+
if (pathAttr && !path && !index)
|
|
159
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `computed or unreadable route path in ${file}:${loc.line + 1}`, location: { file, line: loc.line + 1, col: loc.character } });
|
|
160
|
+
if (path !== undefined && !path.startsWith('/') && path !== '*' && parentPath === '' && !hasRouterRoot) {
|
|
161
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `relative route '${path}' in ${file}:${loc.line + 1} has no parent route in this file; Gateforge cannot tell which prefix it is rendered under (make it absolute, or wrap it under its parent route)`, location: { file, line: loc.line + 1, col: loc.character } });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (!dead && (path || index))
|
|
165
|
+
add(withPrefix(basePath, withPrefix(basename, index ? (parentPath || '/') : cleanJoin(parentPath, path))), file, loc.line + 1, guard, redirect, path === '*' || (path !== undefined && path.endsWith('/*')));
|
|
166
|
+
const childParent = index ? parentPath : path ? cleanJoin(parentPath, path) : parentPath;
|
|
167
|
+
if (ts.isJsxElement(node))
|
|
168
|
+
for (const child of node.children)
|
|
169
|
+
visit(child, childParent, guard, basename, dead);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (ts.isCallExpression(node) && (node.expression.getText(source) === 'useRoutes' || ROUTER_FACTORIES[node.expression.getText(source)] === true)) {
|
|
174
|
+
const arg = node.arguments[0];
|
|
175
|
+
if (arg) {
|
|
176
|
+
let callBasename = basename;
|
|
177
|
+
let callDead = dead;
|
|
178
|
+
if (ROUTER_FACTORIES[node.expression.getText(source)] === true) {
|
|
179
|
+
const optionsArgument = node.arguments[1];
|
|
180
|
+
const basenameProperty = optionsArgument !== undefined && ts.isObjectLiteralExpression(optionsArgument)
|
|
181
|
+
? optionsArgument.properties.find(p => ts.isPropertyAssignment(p) && p.name.getText(source).replace(/['"]/g, '') === 'basename')
|
|
182
|
+
: undefined;
|
|
183
|
+
if (basenameProperty) {
|
|
184
|
+
const value = literal(basenameProperty.initializer);
|
|
185
|
+
const factoryLoc = source.getLineAndCharacterOfPosition(basenameProperty.getStart(source));
|
|
186
|
+
if (value === undefined) {
|
|
187
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `computed or unreadable basename in ${file}:${factoryLoc.line + 1}`, location: { file, line: factoryLoc.line + 1, col: factoryLoc.character } });
|
|
188
|
+
callDead = true;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
basenameDeclarations.push({ value, file, line: factoryLoc.line + 1, col: factoryLoc.character });
|
|
192
|
+
callBasename = value;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
visitObjectRoutes(arg, parentPath, callBasename, callDead);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
ts.forEachChild(node, child => visit(child, parentPath, inheritedGuard, basename, dead));
|
|
200
|
+
};
|
|
201
|
+
const visitObjectRoutes = (expr, base, basename = '', dead = false) => {
|
|
202
|
+
if (!ts.isArrayLiteralExpression(expr)) {
|
|
203
|
+
const loc = source.getLineAndCharacterOfPosition(expr.getStart(source));
|
|
204
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `unreadable route array in ${file}:${loc.line + 1}`, location: { file, line: loc.line + 1, col: loc.character } });
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
for (const el of expr.elements) {
|
|
208
|
+
if (!ts.isObjectLiteralExpression(el)) {
|
|
209
|
+
const loc = source.getLineAndCharacterOfPosition(el.getStart(source));
|
|
210
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `spread or unreadable route in ${file}:${loc.line + 1}`, location: { file, line: loc.line + 1, col: loc.character } });
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const prop = (n) => el.properties.find(p => ts.isPropertyAssignment(p) && p.name.getText(source).replace(/['"]/g, '') === n);
|
|
214
|
+
const pathProperty = prop('path');
|
|
215
|
+
const path = literal(pathProperty?.initializer);
|
|
216
|
+
const index = prop('index')?.initializer?.kind === ts.SyntaxKind.TrueKeyword;
|
|
217
|
+
const element = prop('element')?.initializer ?? prop('Component')?.initializer ?? prop('lazy')?.initializer;
|
|
218
|
+
const redirect = !!element && element.getText(source).includes('Navigate');
|
|
219
|
+
const loc = source.getLineAndCharacterOfPosition(el.getStart(source));
|
|
220
|
+
if (pathProperty && !path && !index)
|
|
221
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `computed or unreadable route path in ${file}:${loc.line + 1}`, location: { file, line: loc.line + 1, col: loc.character } });
|
|
222
|
+
else if (path !== undefined && !path.startsWith('/') && path !== '*' && base === '' && !hasRouterRoot) {
|
|
223
|
+
unresolved.push({ code: 'PAGE_ROUTE_UNRESOLVED', detail: `relative route '${path}' in ${file}:${loc.line + 1} has no parent route in this file; Gateforge cannot tell which prefix it is rendered under (make it absolute, or wrap it under its parent route)`, location: { file, line: loc.line + 1, col: loc.character } });
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
else if (!dead && (path || index))
|
|
227
|
+
add(withPrefix(basePath, withPrefix(basename, index ? (base || '/') : cleanJoin(base, path))), file, loc.line + 1, undefined, redirect, path === '*' || (path !== undefined && path.endsWith('/*')));
|
|
228
|
+
const children = prop('children')?.initializer;
|
|
229
|
+
if (children)
|
|
230
|
+
visitObjectRoutes(children, index ? base : path ? cleanJoin(base, path) : base, basename, dead);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
visit(source);
|
|
234
|
+
}
|
|
235
|
+
const basenameValues = new Map();
|
|
236
|
+
for (const declaration of basenameDeclarations) {
|
|
237
|
+
const locations = basenameValues.get(declaration.value) ?? [];
|
|
238
|
+
locations.push({ file: declaration.file, line: declaration.line, col: declaration.col });
|
|
239
|
+
basenameValues.set(declaration.value, locations);
|
|
240
|
+
}
|
|
241
|
+
if (basenameValues.size > 1)
|
|
242
|
+
findings.push({
|
|
243
|
+
code: 'AMBIGUOUS_BASENAME',
|
|
244
|
+
detail: `router basename is declared with ${basenameValues.size} different values (${[...basenameValues.keys()].sort().map(value => `'${value}'`).join(', ')}); page prefixes are ambiguous across the project — align the basenames or drop the one you do not mean`,
|
|
245
|
+
locations: [...basenameValues.values()].flat().sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line || a.col - b.col),
|
|
246
|
+
});
|
|
247
|
+
return { resources, unresolved, findings, classificationSignals: [], scannedPaths };
|
|
248
|
+
} };
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../src/detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OA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CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PACK_PLUGIN_ID, PACK_VERSION } from './version.js';
|
|
2
|
+
export { createPageDetector, type PageDetector, type PageResource } from './detector.js';
|
|
3
|
+
declare const _default: import("./detector.js").PageDetector;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;;AACzF,wBAAoC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAwC,MAAM,eAAe,CAAC;AACzF,eAAe,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,gCAAgC,CAAC;AAC5D,eAAO,MAAM,YAAY,WAAW,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gate-forge/pack-react-router",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.13.1",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "Generic React Router page reader: JSX and object route trees become ui.page resources (page:loads, page:data-ok obligations).",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"README.md",
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.build.json",
|
|
25
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
|
+
"test": "vitest run"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@gate-forge/core": "^0.13.1",
|
|
30
|
+
"@gate-forge/plugin-protocol": "^0.13.1",
|
|
31
|
+
"typescript": "^5.9.2",
|
|
32
|
+
"yaml": "^2.9.0",
|
|
33
|
+
"zod": "^4.1.5"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/umiddey/gateforge.git",
|
|
41
|
+
"directory": "packages/pack-react-router"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/umiddey/gateforge/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/umiddey/gateforge#readme"
|
|
47
|
+
}
|