@geastack/cli 0.1.102 → 0.1.103
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 +1 -1
- package/src/manifest.mjs +8 -5
package/package.json
CHANGED
package/src/manifest.mjs
CHANGED
|
@@ -319,15 +319,15 @@ function normalizeLauncher(raw) {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
function normalizeManifestRelativePath(value) {
|
|
322
|
+
function normalizeManifestRelativePath(value, allowParent = false) {
|
|
323
323
|
const normalized = path.posix.normalize(String(value || '').replaceAll('\\', '/'))
|
|
324
324
|
if (!normalized || normalized === '.' || normalized === '..') return ''
|
|
325
|
-
if (path.posix.isAbsolute(normalized) || normalized.startsWith('../')) return ''
|
|
326
|
-
if (normalized.includes('/../') || normalized.includes(';')) return ''
|
|
325
|
+
if (path.posix.isAbsolute(normalized) || (allowParent !== true && normalized.startsWith('../'))) return ''
|
|
326
|
+
if ((allowParent !== true && normalized.includes('/../')) || normalized.includes(';')) return ''
|
|
327
327
|
return normalized
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
// A nativeSources entry is either a path
|
|
330
|
+
// A nativeSources entry is either a path relative to the app or a file in one of its
|
|
331
331
|
// packages. App-relative wins when it exists, so nothing already declared can
|
|
332
332
|
// change meaning; anything else is handed to node resolution, which is what
|
|
333
333
|
// lets an app name `@geastack/native-webgl-angle/native/audio_host.mm` instead
|
|
@@ -347,7 +347,10 @@ export function resolveAppSourcePath(root, source) {
|
|
|
347
347
|
|
|
348
348
|
export function normalizeNativeSources(raw) {
|
|
349
349
|
if (!Array.isArray(raw)) return []
|
|
350
|
-
|
|
350
|
+
// Shared native code can live beside an app's directory. These are explicit
|
|
351
|
+
// compiler inputs, unlike app assets, and resolveAppSourcePath/validateApp
|
|
352
|
+
// must see missing sibling files instead of silently dropping the entries.
|
|
353
|
+
const sources = raw.map((source) => normalizeManifestRelativePath(source, true)).filter((source) => /\.(?:c|cc|cpp|cxx|m|mm|S)$/.test(source))
|
|
351
354
|
return [...new Set(sources)]
|
|
352
355
|
}
|
|
353
356
|
|