@clubays/clubgate-sdk 0.1.0 → 0.1.1
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/README.md +2 -2
- package/bin/pack.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @clubays/clubgate-sdk
|
|
2
2
|
|
|
3
|
-
SDK for building Clubays
|
|
3
|
+
SDK for building Clubays clubgate applications.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -36,4 +36,4 @@ pnpm build
|
|
|
36
36
|
pnpm clubgate-pack
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Creates `<id>-<version>.zip` from `dist/` and `
|
|
39
|
+
Creates `<id>-<version>.zip` from `dist/` and `clubgate.json`.
|
package/bin/pack.js
CHANGED
|
@@ -21,15 +21,15 @@ if (!fs.existsSync(path.join(dist, "index.html"))) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// 2. manifest must exist and be valid
|
|
24
|
-
const manifestPath = path.join(cwd, "
|
|
24
|
+
const manifestPath = path.join(cwd, "clubgate.json");
|
|
25
25
|
if (!fs.existsSync(manifestPath))
|
|
26
|
-
fail("
|
|
26
|
+
fail("clubgate.json not found in the project root.");
|
|
27
27
|
|
|
28
28
|
let manifest;
|
|
29
29
|
try {
|
|
30
30
|
manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
31
31
|
} catch {
|
|
32
|
-
fail("
|
|
32
|
+
fail("clubgate.json is not valid JSON.");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const errors = [];
|
|
@@ -48,7 +48,7 @@ if (!Array.isArray(manifest.scopes)) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
if (errors.length)
|
|
51
|
-
fail("
|
|
51
|
+
fail("clubgate.json problems:\n - " + errors.join("\n - "));
|
|
52
52
|
|
|
53
53
|
// 3. refuse files that must never ship (secrets, source maps are fine to drop)
|
|
54
54
|
const BLOCKED = [/^\.env/, /\.pem$/, /\.key$/, /^node_modules$/];
|
|
@@ -61,7 +61,7 @@ const walk = (dir) =>
|
|
|
61
61
|
});
|
|
62
62
|
walk(dist);
|
|
63
63
|
|
|
64
|
-
// 4. zip dist/ contents at the zip root, plus
|
|
64
|
+
// 4. zip dist/ contents at the zip root, plus clubgate.json
|
|
65
65
|
const outName = `${manifest.id}-${manifest.version}.zip`;
|
|
66
66
|
const outPath = path.join(cwd, outName);
|
|
67
67
|
const output = fs.createWriteStream(outPath);
|
|
@@ -82,5 +82,5 @@ archive.on("error", (e) => fail(e.message));
|
|
|
82
82
|
|
|
83
83
|
archive.pipe(output);
|
|
84
84
|
archive.directory(dist, false);
|
|
85
|
-
archive.file(manifestPath, { name: "
|
|
85
|
+
archive.file(manifestPath, { name: "clubgate.json" });
|
|
86
86
|
archive.finalize();
|