@quonfig/cli 0.4.0 → 0.6.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.
Files changed (53) hide show
  1. package/README.md +229 -77
  2. package/dist/agent/skill-bundle.generated.d.ts +1 -1
  3. package/dist/agent/skill-bundle.generated.js +4 -4
  4. package/dist/codegen/code-generators/base-typescript-generator.d.ts +1 -1
  5. package/dist/codegen/schema-extractor.d.ts +1 -1
  6. package/dist/commands/config-schema.js +9 -2
  7. package/dist/commands/create.d.ts +3 -1
  8. package/dist/commands/create.js +93 -20
  9. package/dist/commands/environments.d.ts +8 -0
  10. package/dist/commands/environments.js +32 -0
  11. package/dist/commands/get.d.ts +1 -0
  12. package/dist/commands/get.js +40 -3
  13. package/dist/commands/info.d.ts +1 -0
  14. package/dist/commands/info.js +69 -32
  15. package/dist/commands/set-default.d.ts +2 -0
  16. package/dist/commands/set-default.js +98 -35
  17. package/dist/commands/set-rollout.js +2 -2
  18. package/dist/index.d.ts +6 -0
  19. package/dist/index.js +35 -3
  20. package/dist/interactive-prompt.d.ts +18 -0
  21. package/dist/interactive-prompt.js +11 -2
  22. package/dist/migrate/quonfig-target/operators.js +4 -2
  23. package/dist/migrate/quonfig-target/ruleset.d.ts +48 -0
  24. package/dist/migrate/quonfig-target/ruleset.js +132 -8
  25. package/dist/migrate/sources/flagsmith/translate.js +11 -0
  26. package/dist/migrate/sources/launchdarkly/translate.js +19 -16
  27. package/dist/push/git-pack.d.ts +12 -0
  28. package/dist/push/git-pack.js +27 -3
  29. package/dist/push/run-push.d.ts +2 -1
  30. package/dist/push/run-push.js +1 -2
  31. package/dist/ui/get-confirmation.d.ts +10 -1
  32. package/dist/ui/get-confirmation.js +13 -4
  33. package/dist/ui/get-string.d.ts +18 -1
  34. package/dist/ui/get-string.js +20 -5
  35. package/dist/ui/get-value.d.ts +3 -1
  36. package/dist/ui/get-value.js +7 -7
  37. package/dist/util/clone-and-stack-push.js +8 -3
  38. package/dist/util/encryption.js +11 -20
  39. package/dist/util/git-ops.d.ts +4 -2
  40. package/dist/util/git-ops.js +4 -2
  41. package/dist/util/redact.d.ts +56 -0
  42. package/dist/util/redact.js +98 -0
  43. package/dist/util/value-source.d.ts +30 -0
  44. package/dist/util/value-source.js +81 -0
  45. package/dist/verify/regex-dialect.d.ts +39 -0
  46. package/dist/verify/regex-dialect.js +278 -0
  47. package/dist/verify/standalone.d.ts +3 -1
  48. package/dist/verify/standalone.js +4 -19
  49. package/dist/verify/validate.js +20 -0
  50. package/dist/version.d.ts +1 -1
  51. package/dist/version.js +1 -1
  52. package/oclif.manifest.json +218 -97
  53. package/package.json +18 -16
@@ -35,7 +35,9 @@ export declare function hookVersion(env?: HookEnv): string;
35
35
  * old oid that is an ancestor of the new oid. A delete and a create are both
36
36
  * rejected (provisioning creates `main` with auto_init; no writer creates it by
37
37
  * push, and the zero-oid door is the only way to delete-then-recreate).
38
- * Other refs are untouched. See plan 2026-09-17-tree-derived-cache 5.6.
38
+ * Other refs are untouched. Enforced on every repo, unconditionally: the
39
+ * QUONFIG_HOOK_FF_ENFORCE rollout switch is gone (qfg-jxml.29), so no env var
40
+ * can turn the rule off. See plan 2026-09-17-tree-derived-cache 5.6.
39
41
  */
40
42
  export declare function checkAppendOnlyMain(refs: readonly RefUpdate[], env: HookEnv, cwd?: string): {
41
43
  bypassReason?: string;
@@ -127,11 +127,13 @@ const REWRITE_OPTION = 'quonfig-rewrite=';
127
127
  * old oid that is an ancestor of the new oid. A delete and a create are both
128
128
  * rejected (provisioning creates `main` with auto_init; no writer creates it by
129
129
  * push, and the zero-oid door is the only way to delete-then-recreate).
130
- * Other refs are untouched. See plan 2026-09-17-tree-derived-cache 5.6.
130
+ * Other refs are untouched. Enforced on every repo, unconditionally: the
131
+ * QUONFIG_HOOK_FF_ENFORCE rollout switch is gone (qfg-jxml.29), so no env var
132
+ * can turn the rule off. See plan 2026-09-17-tree-derived-cache 5.6.
131
133
  */
132
134
  export function checkAppendOnlyMain(refs, env, cwd) {
133
135
  const mainUpdates = refs.filter((ref) => ref.refName === MAIN_REF);
134
- if (mainUpdates.length === 0 || !ffEnforcedForRepo(env))
136
+ if (mainUpdates.length === 0)
135
137
  return { errors: [] };
136
138
  const bypassReason = operatorBypassReason(env);
137
139
  if (bypassReason)
@@ -159,23 +161,6 @@ export function checkAppendOnlyMain(refs, env, cwd) {
159
161
  }
160
162
  return { errors };
161
163
  }
162
- /** Rollout switch: enforce only for repos named in the allowlist; `*` = all. */
163
- function ffEnforcedForRepo(env) {
164
- const allowlist = (env.QUONFIG_HOOK_FF_ENFORCE ?? '')
165
- .split(',')
166
- .map((entry) => entry.trim().toLowerCase())
167
- .filter(Boolean);
168
- if (allowlist.length === 0)
169
- return false;
170
- if (allowlist.includes('*'))
171
- return true;
172
- // Gitea 1.25 hands the hook its repo via these (modules/repository/env.go).
173
- const owner = (env.GITEA_REPO_USER_NAME ?? '').trim().toLowerCase();
174
- const name = (env.GITEA_REPO_NAME ?? '').trim().toLowerCase();
175
- if (!owner || !name)
176
- return false;
177
- return allowlist.includes(`${owner}/${name}`);
178
- }
179
164
  /**
180
165
  * Operator bypass, two keys, BOTH required: the pusher is the operator admin
181
166
  * account (the app pushes as admin too, so identity only excludes customers)
@@ -28,6 +28,7 @@
28
28
  import { z } from 'zod';
29
29
  import { findMapKeyOrderWarnings, navigate, scanOrderedJson } from './map-key-order.js';
30
30
  import { compileSchema, validateAgainstSchema } from './schema-validator.js';
31
+ import { checkRegexV1, REGEX_V1_DOCS_URL } from './regex-dialect.js';
31
32
  import { DURATION_FORMAT_HINT, INT_RANGE_FORMAT_HINT, isValidIntRange, isValidIsoDuration, isValidSemver, isValidTimestamp, parseDoubleValue, parseIntValue, SEMVER_FORMAT_HINT, TIMESTAMP_FORMAT_HINT, } from './value-grammar.js';
32
33
  // Inlined to keep this directory self-contained for the standalone bun-compile
33
34
  // build that runs as the qfg-verify pre-receive hook in app-gitea — that build
@@ -1341,6 +1342,25 @@ function criterionValueShapeIssue(criterion) {
1341
1342
  return { hint: SEMVER_FORMAT_HINT, problem: `needs a version string; got ${vtm.type} ${shown}` };
1342
1343
  return undefined;
1343
1344
  }
1345
+ case 'PROP_DOES_NOT_MATCH':
1346
+ case 'PROP_MATCHES': {
1347
+ // Quonfig regex v1 (qfg-ktkr.2): an out-of-dialect pattern compiles in
1348
+ // some SDKs and not others (or runs in exponential time), so the rule
1349
+ // silently diverges across SDKs. One check here covers qfg verify, the
1350
+ // Git hook and both push engines.
1351
+ if (vtm.type !== 'string' || typeof vtm.value !== 'string')
1352
+ return {
1353
+ hint: `Store the pattern as {"type": "string", "value": "<pattern>"}. See ${REGEX_V1_DOCS_URL}`,
1354
+ problem: `needs a string pattern; got ${vtm.type} ${shown}`,
1355
+ };
1356
+ const violation = checkRegexV1(vtm.value);
1357
+ if (violation)
1358
+ return {
1359
+ hint: `${violation.hint} See ${REGEX_V1_DOCS_URL}`,
1360
+ problem: `pattern ${shown} is outside Quonfig regex v1 (${violation.reason})`,
1361
+ };
1362
+ return undefined;
1363
+ }
1344
1364
  default: {
1345
1365
  return undefined;
1346
1366
  }
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.4.0";
1
+ declare const _default: "0.6.0";
2
2
  export default _default;
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // AUTO-GENERATED from package.json by scripts/generate-version.mjs — do not edit.
2
- export default '0.4.0';
2
+ export default '0.6.0';