zappie 0.1.4 → 0.1.6
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/CHANGELOG.md +13 -0
- package/dist/cli.js +26 -4
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# zappie
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9b25eb7: The packages now live in zappie/storefront-packages, and each package's repository, homepage and issues links point there. This release is the first one published from that repository.
|
|
8
|
+
|
|
9
|
+
## 0.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 49d3708: The npm package ships each registry item once, under its plain name, instead of also shipping an identical `<name>@<version>.json` copy. The hosted registry keeps both names. When `--registry` points at a local directory without the pinned file, `zappie` reads the plain file and checks that its version matches.
|
|
14
|
+
- 32ecccf: Add report-only storefront security headers, per-request nonces, prerendered-script hashes and V18 security-header verification. The starter now applies the policy to every document response.
|
|
15
|
+
|
|
3
16
|
## 0.1.4
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -608,7 +608,7 @@ import path6 from "path";
|
|
|
608
608
|
import { satisfies as satisfies2 } from "semver";
|
|
609
609
|
|
|
610
610
|
// src/registry.ts
|
|
611
|
-
import { readFile } from "fs/promises";
|
|
611
|
+
import { access, readFile } from "fs/promises";
|
|
612
612
|
import path5 from "path";
|
|
613
613
|
function object(value, label) {
|
|
614
614
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -691,9 +691,18 @@ var Registry = class {
|
|
|
691
691
|
this.source = source2;
|
|
692
692
|
this.cwd = cwd;
|
|
693
693
|
}
|
|
694
|
+
remote() {
|
|
695
|
+
return /^https?:\/\//.test(this.source);
|
|
696
|
+
}
|
|
697
|
+
async exists(file) {
|
|
698
|
+
return access(path5.join(path5.resolve(this.cwd, this.source), file)).then(
|
|
699
|
+
() => true,
|
|
700
|
+
() => false
|
|
701
|
+
);
|
|
702
|
+
}
|
|
694
703
|
async read(file) {
|
|
695
704
|
try {
|
|
696
|
-
if (
|
|
705
|
+
if (this.remote()) {
|
|
697
706
|
const response = await fetch(
|
|
698
707
|
`${this.source.replace(/\/+$/, "")}/${file}`
|
|
699
708
|
);
|
|
@@ -713,8 +722,21 @@ var Registry = class {
|
|
|
713
722
|
return index(await this.read("index.json"));
|
|
714
723
|
}
|
|
715
724
|
async item(name2, version2) {
|
|
716
|
-
|
|
717
|
-
|
|
725
|
+
if (version2 === void 0) {
|
|
726
|
+
return item(await this.read(`items/${name2}.json`));
|
|
727
|
+
}
|
|
728
|
+
const pinned = `items/${name2}@${version2}.json`;
|
|
729
|
+
if (this.remote() || await this.exists(pinned)) {
|
|
730
|
+
return item(await this.read(pinned));
|
|
731
|
+
}
|
|
732
|
+
const current = item(await this.read(`items/${name2}.json`));
|
|
733
|
+
if (current.version !== version2) {
|
|
734
|
+
throw new CliError(
|
|
735
|
+
`We could not read registry ${pinned}: this registry has ${name2} ${current.version} only.`,
|
|
736
|
+
3
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
return current;
|
|
718
740
|
}
|
|
719
741
|
};
|
|
720
742
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zappie",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Install Zappie kit components and check storefront projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/zappie/storefront.git",
|
|
19
|
+
"url": "git+https://github.com/zappie/storefront-packages.git",
|
|
20
20
|
"directory": "packages/cli"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
|
-
"homepage": "https://github.com/zappie/storefront#readme",
|
|
23
|
+
"homepage": "https://github.com/zappie/storefront-packages#readme",
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/zappie/storefront/issues"
|
|
25
|
+
"url": "https://github.com/zappie/storefront-packages/issues"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public",
|