runcloud 0.2.233 → 0.2.234
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/commands/flags.js +8 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/runcloud-0.2.234.tgz +0 -0
- package/runcloud-0.2.233.tgz +0 -0
package/dist/commands/flags.js
CHANGED
|
@@ -178,6 +178,12 @@ export async function runFlagSet(client, projectId, env, key, options, log) {
|
|
|
178
178
|
const { flag } = (await client.patch(flagPath(projectId, env, key), fields));
|
|
179
179
|
log(`Saved ${key} in ${envWord(env)}: ${flag.enabled ? 'on' : 'off'}. Who gets it: ${whoGetsIt(flag)}.`);
|
|
180
180
|
}
|
|
181
|
+
export async function runFlagPromote(client, projectId, key, yes, log) {
|
|
182
|
+
if (!yes)
|
|
183
|
+
throw new Error(`Copying ${key} to production changes who gets it there and what they see, at once if it is on. Run again with --yes to copy it.`);
|
|
184
|
+
const { flag } = (await client.post(`${base(projectId)}/flags/${encodeURIComponent(key)}/promote`));
|
|
185
|
+
log(`Copied ${key} to production: ${flag.enabled ? 'on' : 'off'}. Who gets it: ${whoGetsIt(flag)}.${flag.enabled ? '' : ` Turn it on with: newly flags on ${key} --env prod`}`);
|
|
186
|
+
}
|
|
181
187
|
export async function runFlagDelete(client, projectId, env, key, yes, log) {
|
|
182
188
|
if (env === 'production' && !yes)
|
|
183
189
|
throw new Error(`Deleting ${key} turns it off for every live user. Run again with --yes to delete it from production.`);
|
|
@@ -289,6 +295,8 @@ export function registerFlags(program) {
|
|
|
289
295
|
const c = ctx(o.project);
|
|
290
296
|
await runFlagSet(c.client, c.projectId, flagEnv(o.env), key, { ...o, on: o.on ? true : o.off ? false : undefined }, log);
|
|
291
297
|
}));
|
|
298
|
+
flags.command('promote <key>').description("Copy a Development flag's groups, value and variants to Production (its on/off stays)").option('--yes', 'confirm changing production').option('--project <id>')
|
|
299
|
+
.action((key, o) => run(async () => { const c = ctx(o.project); await runFlagPromote(c.client, c.projectId, key, Boolean(o.yes), log); }));
|
|
292
300
|
flags.command('delete <key>').option('--yes', 'confirm deleting from production').option(...envOption).option('--project <id>')
|
|
293
301
|
.action((key, o) => run(async () => { const c = ctx(o.project); await runFlagDelete(c.client, c.projectId, flagEnv(o.env), key, Boolean(o.yes), log); }));
|
|
294
302
|
flags.command('log <key>').description("Who changed a flag (in Newly, the agent or the CLI), and what").option(...envOption).option('--project <id>')
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.2.
|
|
1
|
+
export const CLI_VERSION = '0.2.234';
|
package/package.json
CHANGED
|
Binary file
|
package/runcloud-0.2.233.tgz
DELETED
|
Binary file
|