@pixelated-tech/components 3.9.10 → 3.9.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/dist/components/general/callout.js +0 -1
- package/dist/components/general/markdown.js +0 -1
- package/dist/components/general/recipe.js +0 -1
- package/dist/components/integrations/contentful.items.components.js +0 -1
- package/dist/components/integrations/socialcard.js +0 -12
- package/dist/components/shoppingcart/ebay.components.js +0 -1
- package/dist/components/shoppingcart/shoppingcart.components.js +1 -3
- package/dist/config/pixelated.config.json.enc +1 -1
- package/dist/scripts/build.sh +21 -8
- package/dist/scripts/create-pixelated-app-template-mapper.js +80 -0
- package/dist/scripts/create-pixelated-app.js +471 -0
- package/dist/scripts/create-pixelated-app.json +32 -0
- package/dist/scripts/release.sh +30 -4
- package/dist/types/components/general/404.d.ts.map +1 -1
- package/dist/types/components/general/callout.d.ts.map +1 -1
- package/dist/types/components/general/markdown.d.ts.map +1 -1
- package/dist/types/components/general/menu-accordion.d.ts.map +1 -1
- package/dist/types/components/general/recipe.d.ts.map +1 -1
- package/dist/types/components/general/resume.d.ts.map +1 -1
- package/dist/types/components/general/timeline.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.items.components.d.ts.map +1 -1
- package/dist/types/components/integrations/socialcard.d.ts.map +1 -1
- package/dist/types/components/integrations/wordpress.components.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/ebay.components.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts.map +1 -1
- package/dist/types/scripts/create-pixelated-app-template-mapper.d.ts +5 -0
- package/dist/types/scripts/create-pixelated-app-template-mapper.d.ts.map +1 -0
- package/dist/types/scripts/create-pixelated-app.d.ts +12 -0
- package/dist/types/scripts/create-pixelated-app.d.ts.map +1 -0
- package/dist/types/tests/config-vault.test.d.ts +2 -0
- package/dist/types/tests/config-vault.test.d.ts.map +1 -0
- package/dist/types/tests/create-pixelated-app-template-mapper.test.d.ts +2 -0
- package/dist/types/tests/create-pixelated-app-template-mapper.test.d.ts.map +1 -0
- package/dist/types/tests/create-pixelated-app.cli.test.d.ts +2 -0
- package/dist/types/tests/create-pixelated-app.cli.test.d.ts.map +1 -0
- package/dist/types/tests/create-pixelated-app.test.d.ts +2 -0
- package/dist/types/tests/create-pixelated-app.test.d.ts.map +1 -0
- package/dist/types/tests/generate-site-images.test.d.ts +2 -0
- package/dist/types/tests/generate-site-images.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated-eslint-plugin.test.d.ts +2 -0
- package/dist/types/tests/pixelated-eslint-plugin.test.d.ts.map +1 -0
- package/dist/types/tests/shell-scripts.test.d.ts +2 -0
- package/dist/types/tests/shell-scripts.test.d.ts.map +1 -0
- package/dist/types/tests/validate-exports.test.d.ts +2 -0
- package/dist/types/tests/validate-exports.test.d.ts.map +1 -0
- package/package.json +7 -6
- package/dist/scripts/validate-exports.cjs +0 -280
- package/dist/types/scripts/validate-exports.d.cts +0 -2
- package/dist/types/scripts/validate-exports.d.cts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shoppingcart.components.d.ts","sourceRoot":"","sources":["../../../../src/components/shoppingcart/shoppingcart.components.tsx"],"names":[],"mappings":"AAIA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAMnD,OAAO,8BAA8B,CAAC;AAStC,OAAO,oBAAoB,CAAC;AAa5B,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACzE,wBAAgB,YAAY,CAAE,KAAK,EAAE,gBAAgB,2CA2LpD;yBA3Le,YAAY;;;;;AAwM5B,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACjF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"shoppingcart.components.d.ts","sourceRoot":"","sources":["../../../../src/components/shoppingcart/shoppingcart.components.tsx"],"names":[],"mappings":"AAIA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAMnD,OAAO,8BAA8B,CAAC;AAStC,OAAO,oBAAoB,CAAC;AAa5B,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACzE,wBAAgB,YAAY,CAAE,KAAK,EAAE,gBAAgB,2CA2LpD;yBA3Le,YAAY;;;;;AAwM5B,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACjF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,2CAmD3D;yBAnDe,gBAAgB;;;;;;;;;;;;AA8EhC,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AAC3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,2CA0CrD;yBA1Ce,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;AAgD7B,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;AACrE,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,2CAiC/C;yBAjCe,UAAU;;;;;AAwC1B,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,mBAAmB,2CAQzD;yBARe,eAAe;;;;;;AAgB/B,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,mBAAmB,2CAkBzD;yBAlBe,eAAe;;;;;;;AAyB/B,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC;AAC7E,wBAAgB,cAAc,CAAC,KAAK,EAAE,kBAAkB,2CAQvD;yBARe,cAAc"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function loadManifest(baseDir?: string): Promise<any>;
|
|
2
|
+
export function findTemplateForSlug(manifest: any, slug: any): any;
|
|
3
|
+
export function pruneTemplateDirs(manifest: any, destPath: any, requestedSlugs?: any[]): Promise<any[]>;
|
|
4
|
+
export function printAvailableTemplates(manifest: any): void;
|
|
5
|
+
//# sourceMappingURL=create-pixelated-app-template-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pixelated-app-template-mapper.d.ts","sourceRoot":"","sources":["../../../src/scripts/create-pixelated-app-template-mapper.js"],"names":[],"mappings":"AAYA,6DAWC;AAED,mEAgBC;AAED,wGA2BC;AAED,6DAOC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export function addRouteEntry(routesJson: any, pageSlug: any, displayName: any, rootDisplayName: any): boolean;
|
|
3
|
+
export function copyTemplateForPage(templatePathArg: any, templateSrc: any, templatePagesHome: any, targetDir: any): Promise<{
|
|
4
|
+
used: string;
|
|
5
|
+
src: any;
|
|
6
|
+
}>;
|
|
7
|
+
export namespace TOKEN_MAP {
|
|
8
|
+
let __SITE_NAME__: string;
|
|
9
|
+
let __SITE_URL__: string;
|
|
10
|
+
let __EMAIL_ADDRESS__: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=create-pixelated-app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pixelated-app.d.ts","sourceRoot":"","sources":["../../../src/scripts/create-pixelated-app.js"],"names":[],"mappings":";AA4MA,+GAaC;AAID;;;GAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-vault.test.d.ts","sourceRoot":"","sources":["../../../src/tests/config-vault.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pixelated-app-template-mapper.test.d.ts","sourceRoot":"","sources":["../../../src/tests/create-pixelated-app-template-mapper.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pixelated-app.cli.test.d.ts","sourceRoot":"","sources":["../../../src/tests/create-pixelated-app.cli.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pixelated-app.test.d.ts","sourceRoot":"","sources":["../../../src/tests/create-pixelated-app.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-site-images.test.d.ts","sourceRoot":"","sources":["../../../src/tests/generate-site-images.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixelated-eslint-plugin.test.d.ts","sourceRoot":"","sources":["../../../src/tests/pixelated-eslint-plugin.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-scripts.test.d.ts","sourceRoot":"","sources":["../../../src/tests/shell-scripts.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-exports.test.d.ts","sourceRoot":"","sources":["../../../src/tests/validate-exports.test.js"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixelated-tech/components",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Pixelated Technologies",
|
|
@@ -82,7 +82,8 @@
|
|
|
82
82
|
"vault": "npx tsx src/scripts/config-vault.ts",
|
|
83
83
|
"config:vault": "npm run vault --",
|
|
84
84
|
"config:encrypt": "npm run config:vault -- encrypt src/config/pixelated.config.json",
|
|
85
|
-
"config:decrypt": "npm run config:vault -- decrypt src/config/pixelated.config.json"
|
|
85
|
+
"config:decrypt": "npm run config:vault -- decrypt src/config/pixelated.config.json",
|
|
86
|
+
"create-pixelated-app": "node src/scripts/create-pixelated-app.js"
|
|
86
87
|
},
|
|
87
88
|
"scripts-20260113": {
|
|
88
89
|
"build": "npm run validate-exports && npm run buildClean && npm run tsc && npm run rsync && npm run tscClean ",
|
|
@@ -145,11 +146,11 @@
|
|
|
145
146
|
"eslint-plugin-react": "^7.37.4",
|
|
146
147
|
"eslint-plugin-storybook": "^10.1.11",
|
|
147
148
|
"file-loader": "^6.2.0",
|
|
148
|
-
"happy-dom": "^20.
|
|
149
|
+
"happy-dom": "^20.3.0",
|
|
149
150
|
"jsdom": "^27.4.0",
|
|
150
151
|
"less-loader": "^12.3.0",
|
|
151
152
|
"mini-css-extract-plugin": "^2.9.4",
|
|
152
|
-
"next": "^16.1.
|
|
153
|
+
"next": "^16.1.2",
|
|
153
154
|
"null-loader": "^4.0.1",
|
|
154
155
|
"prop-types": "^15.8.1",
|
|
155
156
|
"react": "^19.2.3",
|
|
@@ -176,8 +177,8 @@
|
|
|
176
177
|
"react-dom": "^19.2.0"
|
|
177
178
|
},
|
|
178
179
|
"optionalDependencies": {
|
|
179
|
-
"@aws-sdk/client-cloudwatch": "^3.
|
|
180
|
-
"@aws-sdk/client-route-53": "^3.
|
|
180
|
+
"@aws-sdk/client-cloudwatch": "^3.969.0",
|
|
181
|
+
"@aws-sdk/client-route-53": "^3.969.0",
|
|
181
182
|
"googleapis": "^170.0.0",
|
|
182
183
|
"md5": "^2.3.0",
|
|
183
184
|
"puppeteer": "^24.35.0",
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import glob from 'glob';
|
|
3
|
-
import { CLIENT_ONLY_PATTERNS, TS_FILE_IGNORE_PATTERNS, TSX_FILE_IGNORE_PATTERNS, SERVER_ONLY_PATTERNS } from '../components/general/utilities.js';
|
|
4
|
-
|
|
5
|
-
console.log('🔍 Validating exports...\n');
|
|
6
|
-
|
|
7
|
-
// Find all .ts files (excluding .d.ts, test files, stories, examples, types.ts)
|
|
8
|
-
const tsFiles = glob.sync('src/components/**/*.ts', {
|
|
9
|
-
ignore: TS_FILE_IGNORE_PATTERNS
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// Find all .tsx files (excluding test files, stories, examples)
|
|
13
|
-
const tsxFiles = glob.sync('src/components/**/*.tsx', {
|
|
14
|
-
ignore: TSX_FILE_IGNORE_PATTERNS
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// Combine all component files
|
|
18
|
-
const allComponentFiles = [...tsFiles, ...tsxFiles];
|
|
19
|
-
|
|
20
|
-
// Analyze each component file to determine if it's client-required or server-safe
|
|
21
|
-
function analyzeComponentFile(filePath) {
|
|
22
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
23
|
-
|
|
24
|
-
// Server-only patterns that indicate this should only be on server (not client)
|
|
25
|
-
// (Imported from shared utilities)
|
|
26
|
-
|
|
27
|
-
// Client-only patterns that require the component to run on client
|
|
28
|
-
// (Imported from shared utilities)
|
|
29
|
-
|
|
30
|
-
// Check if file contains any server-only patterns
|
|
31
|
-
const isServerOnly = SERVER_ONLY_PATTERNS.some(pattern => pattern.test(content));
|
|
32
|
-
|
|
33
|
-
// Check if file contains any client-only patterns
|
|
34
|
-
const isClientOnly = CLIENT_ONLY_PATTERNS.some(pattern => pattern.test(content));
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
filePath,
|
|
38
|
-
isClientOnly,
|
|
39
|
-
isServerOnly,
|
|
40
|
-
exportPath: filePath.replace('src/', './').replace(/\.tsx?$/, '')
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Analyze all component files
|
|
45
|
-
const analyzedComponents = allComponentFiles.map(analyzeComponentFile);
|
|
46
|
-
|
|
47
|
-
// Special handling for utilities/functions.ts - it's safe for both client and server despite containing pattern definitions
|
|
48
|
-
analyzedComponents.forEach(comp => {
|
|
49
|
-
if (comp.exportPath === './components/utilities/functions') {
|
|
50
|
-
comp.isClientOnly = false;
|
|
51
|
-
comp.isServerOnly = false;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// Separate admin and non-admin components
|
|
56
|
-
const adminComponents = analyzedComponents.filter(comp => comp.exportPath.startsWith('./components/admin/'));
|
|
57
|
-
const nonAdminComponents = analyzedComponents.filter(comp => !comp.exportPath.startsWith('./components/admin/'));
|
|
58
|
-
|
|
59
|
-
// Create arrays of components for each bundle (non-admin only)
|
|
60
|
-
// If a component has server-only patterns, it's server-only; if client-only and not server-only, client-only; else safe
|
|
61
|
-
const serverOnlyComponents = nonAdminComponents.filter(comp => comp.isServerOnly);
|
|
62
|
-
const clientOnlyComponents = nonAdminComponents.filter(comp => comp.isClientOnly && !comp.isServerOnly);
|
|
63
|
-
const clientAndServerSafeComponents = nonAdminComponents.filter(comp => !comp.isClientOnly && !comp.isServerOnly);
|
|
64
|
-
|
|
65
|
-
// Read index files
|
|
66
|
-
const indexServer = fs.readFileSync('src/index.server.js', 'utf8');
|
|
67
|
-
const indexClient = fs.readFileSync('src/index.js', 'utf8');
|
|
68
|
-
const indexAdminServer = fs.readFileSync('src/index.adminserver.js', 'utf8');
|
|
69
|
-
const indexAdminClient = fs.readFileSync('src/index.adminclient.js', 'utf8');
|
|
70
|
-
|
|
71
|
-
// Helper function to extract exports from index file
|
|
72
|
-
function extractExports(content) {
|
|
73
|
-
// Remove comments
|
|
74
|
-
content = content.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
75
|
-
content = content.replace(/\/\/.*$/gm, '');
|
|
76
|
-
|
|
77
|
-
const exports = [];
|
|
78
|
-
|
|
79
|
-
// Handle export * from './path' syntax
|
|
80
|
-
const exportAllRegex = /export\s+\*\s+from\s+['"]([^'"]+)['"]/g;
|
|
81
|
-
let match;
|
|
82
|
-
|
|
83
|
-
while ((match = exportAllRegex.exec(content)) !== null) {
|
|
84
|
-
exports.push(match[1]);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Handle export { ... } from './path' syntax
|
|
88
|
-
const exportRegex = /export\s+{\s*([^}]+)\s*}\s+from\s+['"]([^'"]+)['"]/g;
|
|
89
|
-
while ((match = exportRegex.exec(content)) !== null) {
|
|
90
|
-
const exportList = match[1];
|
|
91
|
-
const exportItems = exportList.split(',').map(item => item.trim());
|
|
92
|
-
exports.push(...exportItems.map(item => match[2])); // Use the from path
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return exports;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Extract exports from all index files
|
|
99
|
-
const serverExports = extractExports(indexServer);
|
|
100
|
-
const clientExports = extractExports(indexClient);
|
|
101
|
-
const adminServerExports = extractExports(indexAdminServer);
|
|
102
|
-
const adminClientExports = extractExports(indexAdminClient);
|
|
103
|
-
|
|
104
|
-
const missing = {
|
|
105
|
-
server: [],
|
|
106
|
-
client: [],
|
|
107
|
-
adminServer: [],
|
|
108
|
-
adminClient: [],
|
|
109
|
-
files: [] // New: exported paths that don't correspond to existing files
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const bundleErrors = {
|
|
113
|
-
server: [], // Client-only components incorrectly in server bundle
|
|
114
|
-
client: [], // Server-only components incorrectly in client bundle
|
|
115
|
-
adminServer: [], // Client-only components incorrectly in admin server bundle
|
|
116
|
-
adminClient: [] // Server-only components incorrectly in admin client bundle
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// Check if exported paths correspond to existing files
|
|
120
|
-
function checkExportPathsExist(exports, bundleName) {
|
|
121
|
-
exports.forEach(exportPath => {
|
|
122
|
-
// Convert export path to file path (./components/... -> src/components/...)
|
|
123
|
-
const filePathBase = exportPath.replace('./', 'src/');
|
|
124
|
-
const tsFile = `${filePathBase}.ts`;
|
|
125
|
-
const tsxFile = `${filePathBase}.tsx`;
|
|
126
|
-
|
|
127
|
-
const tsExists = fs.existsSync(tsFile);
|
|
128
|
-
const tsxExists = fs.existsSync(tsxFile);
|
|
129
|
-
|
|
130
|
-
if (!tsExists && !tsxExists) {
|
|
131
|
-
missing.files.push(`${bundleName}: ${exportPath} (.ts/.tsx files not found)`);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
checkExportPathsExist(serverExports, 'server bundle');
|
|
137
|
-
checkExportPathsExist(clientExports, 'client bundle');
|
|
138
|
-
checkExportPathsExist(adminServerExports, 'admin server bundle');
|
|
139
|
-
checkExportPathsExist(adminClientExports, 'admin client bundle');
|
|
140
|
-
|
|
141
|
-
// Check for missing exports
|
|
142
|
-
clientAndServerSafeComponents.forEach(comp => {
|
|
143
|
-
if (!serverExports.includes(comp.exportPath)) {
|
|
144
|
-
missing.server.push(comp.exportPath);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
serverOnlyComponents.forEach(comp => {
|
|
149
|
-
if (!serverExports.includes(comp.exportPath)) {
|
|
150
|
-
missing.server.push(comp.exportPath);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
clientOnlyComponents.forEach(comp => {
|
|
155
|
-
if (!clientExports.includes(comp.exportPath)) {
|
|
156
|
-
missing.client.push(comp.exportPath);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
clientAndServerSafeComponents.forEach(comp => {
|
|
161
|
-
if (!clientExports.includes(comp.exportPath)) {
|
|
162
|
-
missing.client.push(comp.exportPath);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
// Check admin components - separate server and client bundles
|
|
167
|
-
const serverRelevantAdmin = adminComponents.filter(comp => comp.isServerOnly || !comp.isClientOnly);
|
|
168
|
-
const clientRelevantAdmin = adminComponents.filter(comp => comp.isClientOnly || !comp.isServerOnly);
|
|
169
|
-
|
|
170
|
-
serverRelevantAdmin.forEach(comp => {
|
|
171
|
-
if (!adminServerExports.includes(comp.exportPath)) {
|
|
172
|
-
missing.adminServer.push(comp.exportPath);
|
|
173
|
-
}
|
|
174
|
-
if (serverExports.includes(comp.exportPath) && !comp.isServerOnly) {
|
|
175
|
-
bundleErrors.server.push(comp.exportPath + ' (admin component in server bundle)');
|
|
176
|
-
}
|
|
177
|
-
if (clientExports.includes(comp.exportPath) && !comp.isServerOnly) {
|
|
178
|
-
bundleErrors.client.push(comp.exportPath + ' (admin component in client bundle)');
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
clientRelevantAdmin.forEach(comp => {
|
|
183
|
-
if (!adminClientExports.includes(comp.exportPath)) {
|
|
184
|
-
missing.adminClient.push(comp.exportPath);
|
|
185
|
-
}
|
|
186
|
-
if (serverExports.includes(comp.exportPath) && comp.isClientOnly) {
|
|
187
|
-
bundleErrors.server.push(comp.exportPath + ' (client-only admin component in server bundle)');
|
|
188
|
-
}
|
|
189
|
-
// Allow client-only components in adminserver if they are also server-only (both)
|
|
190
|
-
if (adminServerExports.includes(comp.exportPath) && comp.isClientOnly && !comp.isServerOnly) {
|
|
191
|
-
bundleErrors.adminServer.push(comp.exportPath + ' (client-only admin component in admin server bundle)');
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
// Check for bundle contamination errors
|
|
196
|
-
clientOnlyComponents.forEach(comp => {
|
|
197
|
-
if (serverExports.includes(comp.exportPath)) {
|
|
198
|
-
bundleErrors.server.push(comp.exportPath);
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
serverOnlyComponents.forEach(comp => {
|
|
203
|
-
if (clientExports.includes(comp.exportPath)) {
|
|
204
|
-
bundleErrors.client.push(comp.exportPath + ' (server-only component in client bundle)');
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
// Report results
|
|
209
|
-
console.log('📊 Analysis Results:');
|
|
210
|
-
console.log(` Found ${allComponentFiles.length} component files`);
|
|
211
|
-
console.log(` ${clientOnlyComponents.length} client-only components`);
|
|
212
|
-
console.log(` ${clientAndServerSafeComponents.length} client-and-server-safe components`);
|
|
213
|
-
console.log(` ${serverOnlyComponents.length} server-only components`);
|
|
214
|
-
console.log(` ${adminComponents.length} admin components`);
|
|
215
|
-
if (missing.server.length > 0) {
|
|
216
|
-
console.log('❌ Missing from server bundle (index.server.js):');
|
|
217
|
-
missing.server.forEach(path => console.log(` - ${path}`));
|
|
218
|
-
console.log('');
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (missing.client.length > 0) {
|
|
222
|
-
console.log('❌ Missing from client bundle (index.js):');
|
|
223
|
-
missing.client.forEach(path => console.log(` - ${path}`));
|
|
224
|
-
console.log('');
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
if (missing.adminServer.length > 0) {
|
|
228
|
-
console.log('❌ Missing from admin server bundle (index.adminserver.js):');
|
|
229
|
-
missing.adminServer.forEach(path => console.log(` - ${path}`));
|
|
230
|
-
console.log('');
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (missing.adminClient.length > 0) {
|
|
234
|
-
console.log('❌ Missing from admin client bundle (index.adminclient.js):');
|
|
235
|
-
missing.adminClient.forEach(path => console.log(` - ${path}`));
|
|
236
|
-
console.log('');
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if (bundleErrors.server.length > 0) {
|
|
240
|
-
console.log('🚨 Bundle contamination errors:');
|
|
241
|
-
console.log(' Client-required components incorrectly exported from server bundle:');
|
|
242
|
-
bundleErrors.server.forEach(path => console.log(` - ${path}`));
|
|
243
|
-
console.log('');
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (bundleErrors.client.length > 0) {
|
|
247
|
-
console.log('🚨 Bundle contamination errors:');
|
|
248
|
-
console.log(' Server-required components incorrectly exported from client bundle:');
|
|
249
|
-
bundleErrors.client.forEach(path => console.log(` - ${path}`));
|
|
250
|
-
console.log('');
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (bundleErrors.adminServer.length > 0) {
|
|
254
|
-
console.log('🚨 Bundle contamination errors:');
|
|
255
|
-
console.log(' Client-required components incorrectly exported from admin server bundle:');
|
|
256
|
-
bundleErrors.adminServer.forEach(path => console.log(` - ${path}`));
|
|
257
|
-
console.log('');
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (bundleErrors.adminClient.length > 0) {
|
|
261
|
-
console.log('🚨 Bundle contamination errors:');
|
|
262
|
-
console.log(' Server-only components incorrectly exported from admin client bundle:');
|
|
263
|
-
bundleErrors.adminClient.forEach(path => console.log(` - ${path}`));
|
|
264
|
-
console.log('');
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
if (missing.files.length > 0) {
|
|
268
|
-
console.log('❌ Exported paths that don\'t exist:');
|
|
269
|
-
missing.files.forEach(path => console.log(` - ${path}`));
|
|
270
|
-
console.log('');
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
const hasErrors = missing.server.length > 0 || missing.client.length > 0 || missing.adminServer.length > 0 || missing.adminClient.length > 0 || bundleErrors.server.length > 0 || bundleErrors.client.length > 0 || bundleErrors.adminServer.length > 0 || bundleErrors.adminClient.length > 0 || missing.files.length > 0;
|
|
274
|
-
|
|
275
|
-
if (hasErrors) {
|
|
276
|
-
console.log('❌ Validation failed!');
|
|
277
|
-
process.exit(1);
|
|
278
|
-
} else {
|
|
279
|
-
console.log('✅ All exports validated successfully!');
|
|
280
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-exports.d.cts","sourceRoot":"","sources":["../../../src/scripts/validate-exports.cjs"],"names":[],"mappings":""}
|