flaghoist 0.1.2 → 0.1.3
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/dist/index.js +15 -4
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -332,13 +332,24 @@ function runInit(args) {
|
|
|
332
332
|
console.log("Next: `flaghoist deploy` to ship it, or `flaghoist eject` to own the code.");
|
|
333
333
|
}
|
|
334
334
|
function writeProject(config, dir) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
335
|
+
const files = [
|
|
336
|
+
["src/index.ts", generateWorkerEntry(config)],
|
|
337
|
+
["wrangler.toml", generateWranglerToml(config)],
|
|
338
|
+
["package.json", generatePackageJson(config)]
|
|
339
|
+
];
|
|
340
|
+
const existing = files.map(([name]) => name).filter((name) => existsSync(join(dir, name)));
|
|
341
|
+
if (existing.length > 0) {
|
|
342
|
+
throw new Error(
|
|
343
|
+
`Refusing to overwrite ${existing.join(", ")} in this directory.
|
|
344
|
+
Flaghoist deploys as its own service, so give it a directory of its own:
|
|
345
|
+
npm create flaghoist@latest team-flags`
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
for (const [name, contents] of files) writeFileSafe(join(dir, name), contents);
|
|
338
349
|
}
|
|
339
350
|
function runEject() {
|
|
340
351
|
const config = loadConfig();
|
|
341
|
-
if (existsSync("src/index.ts")) throw new Error("src/index.ts already exists
|
|
352
|
+
if (existsSync("src/index.ts")) throw new Error("src/index.ts already exists. Already ejected?");
|
|
342
353
|
writeProject(config, ".");
|
|
343
354
|
console.log("Ejected to a code project you own: src/index.ts, wrangler.toml, package.json");
|
|
344
355
|
if (config.storage === "cloudflare-kv") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flaghoist",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Scaffold, deploy, and manage your Flaghoist feature-flag service from the terminal.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"smol-toml": "^1.
|
|
26
|
+
"smol-toml": "^1.8.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@flaghoist/adapter-memory": "0.1.1",
|
|
30
30
|
"@flaghoist/core": "0.1.1",
|
|
31
|
-
"@flaghoist/server": "0.1.
|
|
31
|
+
"@flaghoist/server": "0.1.2"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|