@form8ion/javascript 11.6.0 → 11.7.0
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/lib/index.js +34 -20
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +34 -20
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -467,22 +467,38 @@ async function scaffoldPackageType ({
|
|
|
467
467
|
]);
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
function enhanceSlsa ({packageDetails: {publishConfig: {access, provenance}}}) {
|
|
471
|
+
if ('public' === access && provenance) {
|
|
472
|
+
return {
|
|
473
|
+
badges: {
|
|
474
|
+
status: {
|
|
475
|
+
slsa: {
|
|
476
|
+
img: 'https://slsa.dev/images/gh-badge-level2.svg',
|
|
477
|
+
url: 'https://slsa.dev',
|
|
478
|
+
text: 'SLSA Level 2'
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
}
|
|
472
484
|
|
|
473
|
-
return {
|
|
474
|
-
devDependencies: ['publint'],
|
|
475
|
-
scripts: {'lint:publish': 'publint --strict'}
|
|
476
|
-
};
|
|
485
|
+
return {};
|
|
477
486
|
}
|
|
478
487
|
|
|
479
|
-
function
|
|
480
|
-
|
|
488
|
+
async function liftPublishable ({projectRoot, packageDetails}) {
|
|
489
|
+
await mergeIntoExistingPackageJson({projectRoot, config: {publishConfig: {provenance: true}}});
|
|
490
|
+
|
|
491
|
+
return deepmerge(
|
|
492
|
+
enhanceSlsa({packageDetails}),
|
|
493
|
+
{devDependencies: ['publint'], scripts: {'lint:publish': 'publint --strict'}}
|
|
494
|
+
);
|
|
481
495
|
}
|
|
482
496
|
|
|
483
|
-
|
|
484
|
-
|
|
497
|
+
function liftPackage$1 ({projectRoot, packageDetails}) {
|
|
498
|
+
return liftPublishable({projectRoot, packageDetails});
|
|
499
|
+
}
|
|
485
500
|
|
|
501
|
+
async function isPackage ({packageDetails: {exports, publishConfig, bin}}) {
|
|
486
502
|
return !!exports || (!!publishConfig && !bin);
|
|
487
503
|
}
|
|
488
504
|
|
|
@@ -560,14 +576,12 @@ async function scaffoldCliType ({packageName, visibility, projectRoot, dialect,
|
|
|
560
576
|
);
|
|
561
577
|
}
|
|
562
578
|
|
|
563
|
-
async function isCli ({
|
|
564
|
-
const {bin} = JSON.parse(await promises$1.readFile(`${projectRoot}/package.json`, 'utf-8'));
|
|
565
|
-
|
|
579
|
+
async function isCli ({packageDetails: {bin}}) {
|
|
566
580
|
return !!bin;
|
|
567
581
|
}
|
|
568
582
|
|
|
569
|
-
function liftCli ({projectRoot}) {
|
|
570
|
-
return liftPublishable({projectRoot});
|
|
583
|
+
function liftCli ({projectRoot, packageDetails}) {
|
|
584
|
+
return liftPublishable({projectRoot, packageDetails});
|
|
571
585
|
}
|
|
572
586
|
|
|
573
587
|
async function scaffoldProjectType ({
|
|
@@ -615,14 +629,14 @@ async function scaffoldProjectType ({
|
|
|
615
629
|
}
|
|
616
630
|
|
|
617
631
|
async function lifter$1 ({projectRoot, packageDetails}) {
|
|
618
|
-
if (await isPackage({projectRoot})) return liftPackage$1({projectRoot, packageDetails});
|
|
619
|
-
if (await isCli({projectRoot})) return liftCli({projectRoot, packageDetails});
|
|
632
|
+
if (await isPackage({projectRoot, packageDetails})) return liftPackage$1({projectRoot, packageDetails});
|
|
633
|
+
if (await isCli({projectRoot, packageDetails})) return liftCli({projectRoot, packageDetails});
|
|
620
634
|
|
|
621
635
|
return {};
|
|
622
636
|
}
|
|
623
637
|
|
|
624
|
-
async function tester$1 ({projectRoot}) {
|
|
625
|
-
return await isPackage({projectRoot}) || isCli({projectRoot});
|
|
638
|
+
async function tester$1 ({projectRoot, packageDetails}) {
|
|
639
|
+
return await isPackage({projectRoot, packageDetails}) || isCli({projectRoot, packageDetails});
|
|
626
640
|
}
|
|
627
641
|
|
|
628
642
|
var projectTypes = /*#__PURE__*/Object.freeze({
|
|
@@ -982,7 +996,7 @@ async function lift ({projectRoot, vcs, results}) {
|
|
|
982
996
|
}
|
|
983
997
|
|
|
984
998
|
const pluginSchema = joi.object({scaffolder: joi.func().arity(1).required()});
|
|
985
|
-
const pluginMapSchema = joi.object().pattern(
|
|
999
|
+
const pluginMapSchema = joi.object().pattern(joi.string(), pluginSchema);
|
|
986
1000
|
|
|
987
1001
|
const packageBundlersSchema = pluginMapSchema.default({});
|
|
988
1002
|
|