@oondemand/create-central-oon 0.4.12 → 0.4.13
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/package.json
CHANGED
package/src/conformance.js
CHANGED
|
@@ -105,7 +105,20 @@ function checkAppManifest(root, issues) {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
function appKind(root) {
|
|
109
|
+
try {
|
|
110
|
+
return JSON.parse(readText(root, "central.app.json")).appKind;
|
|
111
|
+
} catch {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function isPortalExtension(candidate) {
|
|
117
|
+
return candidate.startsWith("frontend/src/portal/");
|
|
118
|
+
}
|
|
119
|
+
|
|
108
120
|
function checkBootstrap(root, files, issues) {
|
|
121
|
+
const portalCockpit = appKind(root) === "portal-cockpit";
|
|
109
122
|
const file = files.find((candidate) => /^frontend\/src\/main\.(?:t|j)sx?$/.test(candidate));
|
|
110
123
|
if (!file) {
|
|
111
124
|
addIssue(issues, "FRONTEND_BOOTSTRAP_REQUIRED", "frontend/src/main.tsx", "bootstrap gerado não encontrado.");
|
|
@@ -136,19 +149,23 @@ function checkBootstrap(root, files, issues) {
|
|
|
136
149
|
const localImports = [...source.matchAll(/from\s+["'](\.\.?\/[^"']+)["']/g)]
|
|
137
150
|
.map((match) => match[1])
|
|
138
151
|
.filter((value) => !value.endsWith(".json"));
|
|
139
|
-
|
|
152
|
+
const forbiddenLocalImports = portalCockpit
|
|
153
|
+
? localImports.filter((value) => !value.startsWith("./portal/"))
|
|
154
|
+
: localImports;
|
|
155
|
+
if (forbiddenLocalImports.length) {
|
|
140
156
|
addIssue(
|
|
141
157
|
issues,
|
|
142
158
|
"FRONTEND_BOOTSTRAP_LOCAL_CODE",
|
|
143
159
|
file,
|
|
144
|
-
`imports locais executáveis não permitidos: ${
|
|
160
|
+
`imports locais executáveis não permitidos: ${forbiddenLocalImports.join(", ")}.`,
|
|
145
161
|
);
|
|
146
162
|
}
|
|
147
163
|
|
|
148
164
|
const extraFrontendSources = files.filter(
|
|
149
165
|
(candidate) => candidate.startsWith("frontend/src/")
|
|
150
166
|
&& candidate !== file
|
|
151
|
-
&& candidate !== "frontend/src/vite-env.d.ts"
|
|
167
|
+
&& candidate !== "frontend/src/vite-env.d.ts"
|
|
168
|
+
&& !(portalCockpit && isPortalExtension(candidate)),
|
|
152
169
|
);
|
|
153
170
|
for (const extra of extraFrontendSources) {
|
|
154
171
|
addIssue(issues, "FRONTEND_LOCAL_EXTENSION", extra, "frontend declarativo deve manter somente o bootstrap gerado.");
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"sync:metadata": "oonCore-front sync:metadata"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@oondemand/oon-core-front": "^0.4.
|
|
14
|
+
"@oondemand/oon-core-front": "^0.4.13",
|
|
15
15
|
"@chakra-ui/react": "^3.13.0",
|
|
16
16
|
"@emotion/react": "^11.14.0",
|
|
17
17
|
"@tanstack/react-query": "^5.65.0",
|