@thorprovider/storefront 0.6.0 → 0.6.2
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/scripts/candidate.mjs +36 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thorprovider/storefront",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Deterministic storefront scaffolder and installable OpenCode skill suite for Thor Commerce (Next.js, @thorprovider/blocks, @thorprovider/adapters, Medusa)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "bin/storefront.js",
|
package/scripts/candidate.mjs
CHANGED
|
@@ -43,9 +43,9 @@ export const CANDIDATE_TOOLSET = Object.freeze({
|
|
|
43
43
|
'@json-render/next': '0.21.0',
|
|
44
44
|
}),
|
|
45
45
|
local: Object.freeze({
|
|
46
|
-
'@thorprovider/blocks': '3.0.
|
|
47
|
-
'@thorprovider/adapters': '5.2.
|
|
48
|
-
'@thorprovider/runtime': '0.4.
|
|
46
|
+
'@thorprovider/blocks': '3.0.2',
|
|
47
|
+
'@thorprovider/adapters': '5.2.2',
|
|
48
|
+
'@thorprovider/runtime': '0.4.2',
|
|
49
49
|
'@thorprovider/types': '7.0.0',
|
|
50
50
|
}),
|
|
51
51
|
})
|
|
@@ -340,6 +340,20 @@ export function verifyRegistryArtifact({
|
|
|
340
340
|
const target = `package/${value.replace(/^\.\//, '')}`
|
|
341
341
|
if (!entries[target]) missing.push(target)
|
|
342
342
|
}
|
|
343
|
+
const workspaceLeaks = []
|
|
344
|
+
for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {
|
|
345
|
+
for (const [dependency, range] of Object.entries(manifest[field] ?? {})) {
|
|
346
|
+
if (typeof range === 'string' && range.startsWith('workspace:')) {
|
|
347
|
+
workspaceLeaks.push(`${field}.${dependency}=${range}`)
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (workspaceLeaks.length > 0) {
|
|
352
|
+
return registryFailure(
|
|
353
|
+
'E_WORKSPACE_PROTOCOL_LEAK',
|
|
354
|
+
`${name}@${version}: manifest leaks workspace protocol (${workspaceLeaks.join(', ')})`,
|
|
355
|
+
)
|
|
356
|
+
}
|
|
343
357
|
if (kind === 'blocks') {
|
|
344
358
|
for (const specifier of blockImports) {
|
|
345
359
|
const target = blockSpecifierPath(specifier)
|
|
@@ -406,6 +420,20 @@ export async function resolveRegistryCandidate({
|
|
|
406
420
|
`${name}@${version}: registry metadata declares ${metadata.name}@${metadata.version}`,
|
|
407
421
|
)
|
|
408
422
|
}
|
|
423
|
+
const metadataLeaks = []
|
|
424
|
+
for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {
|
|
425
|
+
for (const [dependency, range] of Object.entries(metadata[field] ?? {})) {
|
|
426
|
+
if (typeof range === 'string' && range.startsWith('workspace:')) {
|
|
427
|
+
metadataLeaks.push(`${field}.${dependency}=${range}`)
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (metadataLeaks.length > 0) {
|
|
432
|
+
return registryFailure(
|
|
433
|
+
'E_WORKSPACE_PROTOCOL_LEAK',
|
|
434
|
+
`${name}@${version}: registry metadata leaks workspace protocol (${metadataLeaks.join(', ')})`,
|
|
435
|
+
)
|
|
436
|
+
}
|
|
409
437
|
const tarballUrl = metadata.dist?.tarball
|
|
410
438
|
if (!tarballUrl) {
|
|
411
439
|
return registryFailure('E_ARTIFACT_INCOMPLETE', `${name}@${version}: metadata has no dist.tarball`)
|
|
@@ -463,7 +491,10 @@ export async function verifyRegistryToolset({
|
|
|
463
491
|
const resolved = {}
|
|
464
492
|
const errors = []
|
|
465
493
|
for (const [name, version] of Object.entries(pins)) {
|
|
466
|
-
const inspect =
|
|
494
|
+
const inspect =
|
|
495
|
+
name === '@thorprovider/blocks' ||
|
|
496
|
+
name === '@thorprovider/runtime' ||
|
|
497
|
+
name === '@thorprovider/adapters'
|
|
467
498
|
const result = await resolveRegistryCandidate({
|
|
468
499
|
name,
|
|
469
500
|
version,
|
|
@@ -481,7 +512,7 @@ export async function verifyRegistryToolset({
|
|
|
481
512
|
tgzPath: result.tgzPath,
|
|
482
513
|
name,
|
|
483
514
|
version,
|
|
484
|
-
kind: name === '@thorprovider/blocks' ? 'blocks' : 'runtime',
|
|
515
|
+
kind: name === '@thorprovider/blocks' ? 'blocks' : name === '@thorprovider/runtime' ? 'runtime' : 'package',
|
|
485
516
|
blockImports,
|
|
486
517
|
runtimeImports,
|
|
487
518
|
})
|