flaglint 0.5.0 → 0.5.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/CHANGELOG.md +18 -0
- package/README.md +4 -3
- package/dist/bin/flaglint.js +28 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## [0.5.1] - 2026-05-27
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Corrected `migrate --dry-run` messaging when all previewed diffs use proven
|
|
15
|
+
OpenFeature client bindings. Dry-run output no longer claims placeholder
|
|
16
|
+
provider/client setup is required when configured imported bindings, aliases,
|
|
17
|
+
or local `OpenFeature.getClient()` bindings are already present.
|
|
18
|
+
- Clarified README and docs scope wording for both supported LaunchDarkly Node.js
|
|
19
|
+
server SDK package names: current `@launchdarkly/node-server-sdk` and legacy
|
|
20
|
+
`launchdarkly-node-server-sdk`.
|
|
21
|
+
- Corrected OpenTelemetry feature-flag semantic-convention guidance to use the
|
|
22
|
+
current `feature_flag.evaluation` event model and current attribute names.
|
|
23
|
+
- Corrected homepage release-state and lower CTA messaging now that `flaglint@0.5.0`
|
|
24
|
+
is published.
|
|
25
|
+
- Narrowed broad flag-debt wording where it could imply comprehensive unused-flag
|
|
26
|
+
lifecycle analysis rather than direct SDK coupling and migration review work.
|
|
27
|
+
|
|
10
28
|
## [0.5.0] - 2026-05-26
|
|
11
29
|
|
|
12
30
|
### Added
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ Docs: [Getting Started](https://flaglint.dev/docs/getting-started) · [Commands]
|
|
|
41
41
|
| Step | Command | Purpose |
|
|
42
42
|
|------|---------|---------|
|
|
43
43
|
| 1 | `flaglint scan` | AST inventory of every direct LD Node server SDK call |
|
|
44
|
-
| 2 | `flaglint migrate --dry-run` | Reviewable before/after diffs
|
|
44
|
+
| 2 | `flaglint migrate --dry-run` | Reviewable before/after diffs; provider setup guidance appears when needed |
|
|
45
45
|
| 3 | `flaglint migrate --apply` | Apply only guarded, provably automatable transformations |
|
|
46
46
|
| 4 | `flaglint validate --no-direct-launchdarkly` | CI gate: exit 1 if direct LD calls remain |
|
|
47
47
|
|
|
@@ -141,7 +141,7 @@ flaglint migrate --exclude-tests # skip test and spec files
|
|
|
141
141
|
| Option | Default | Description |
|
|
142
142
|
|--------|---------|-------------|
|
|
143
143
|
| `--output` | `MIGRATION.md` | Write migration plan to file |
|
|
144
|
-
| `--dry-run` | — | Print reviewable diffs to stdout; includes provider setup guidance |
|
|
144
|
+
| `--dry-run` | — | Print reviewable diffs to stdout; includes provider setup guidance when a diff needs it |
|
|
145
145
|
| `--apply` | — | Apply automatable transformations in-place (requires clean git tree) |
|
|
146
146
|
| `--allow-dirty` | — | Override dirty-tree guard for `--apply` |
|
|
147
147
|
| `--config` | auto-detect | Path to a config file |
|
|
@@ -216,7 +216,8 @@ but they are not automatically transformed.
|
|
|
216
216
|
|
|
217
217
|
## Supported API matrix
|
|
218
218
|
|
|
219
|
-
**Scope: LaunchDarkly Node.js server-side SDK
|
|
219
|
+
**Scope: LaunchDarkly Node.js server-side SDK evaluation calls from
|
|
220
|
+
`@launchdarkly/node-server-sdk` and legacy `launchdarkly-node-server-sdk` imports.**
|
|
220
221
|
|
|
221
222
|
| LaunchDarkly call | Automatable | OpenFeature equivalent |
|
|
222
223
|
|---|---|---|
|
package/dist/bin/flaglint.js
CHANGED
|
@@ -740,7 +740,7 @@ function formatHTML(result, options) {
|
|
|
740
740
|
<div class="card"><div class="card-num orange">${manualCount}</div><div class="card-label">Manual Review (${manualPct}%)</div></div>
|
|
741
741
|
<div class="card"><div class="card-num blue">${detailBulkCount}</div><div class="card-label">Detail/Bulk Calls</div></div>` : "";
|
|
742
742
|
const title = options.title ? esc(options.title) : "FlagLint Scan Report";
|
|
743
|
-
const version = true ? "0.5.
|
|
743
|
+
const version = true ? "0.5.1" : "0.1.0";
|
|
744
744
|
return `<!DOCTYPE html>
|
|
745
745
|
<html lang="en">
|
|
746
746
|
<head>
|
|
@@ -1193,7 +1193,7 @@ function formatMigrationReport(analysis) {
|
|
|
1193
1193
|
unsupportedUnknownCount
|
|
1194
1194
|
} = analysis;
|
|
1195
1195
|
const date = (/* @__PURE__ */ new Date()).toLocaleDateString();
|
|
1196
|
-
const version = true ? "0.5.
|
|
1196
|
+
const version = true ? "0.5.1" : "0.1.0";
|
|
1197
1197
|
const lines = [];
|
|
1198
1198
|
lines.push("# OpenFeature Migration Inventory");
|
|
1199
1199
|
lines.push(`Generated by FlagLint v${version} on ${date}`);
|
|
@@ -1349,7 +1349,7 @@ function itemLabel(item) {
|
|
|
1349
1349
|
}
|
|
1350
1350
|
function formatProviderSetupSection() {
|
|
1351
1351
|
const lines = [];
|
|
1352
|
-
lines.push("## Provider Setup (
|
|
1352
|
+
lines.push("## Provider Setup Guidance (For Diffs Requiring Setup)");
|
|
1353
1353
|
lines.push("");
|
|
1354
1354
|
lines.push("LaunchDarkly remains your feature flag provider.");
|
|
1355
1355
|
lines.push("OpenFeature becomes the evaluation API your application code calls.");
|
|
@@ -1376,7 +1376,7 @@ function formatProviderSetupSection() {
|
|
|
1376
1376
|
lines.push("await OpenFeature.setProviderAndWait(ldProvider);");
|
|
1377
1377
|
lines.push("");
|
|
1378
1378
|
lines.push("// Share this client across your application.");
|
|
1379
|
-
lines.push("// Replace the `openFeatureClient` placeholder in
|
|
1379
|
+
lines.push("// Replace the `openFeatureClient` placeholder in affected diffs.");
|
|
1380
1380
|
lines.push("const openFeatureClient = OpenFeature.getClient();");
|
|
1381
1381
|
lines.push("```");
|
|
1382
1382
|
lines.push("");
|
|
@@ -1417,20 +1417,35 @@ async function formatDryRunDiff(analysis, source, allowedBindings = []) {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
}
|
|
1419
1419
|
const lines = [];
|
|
1420
|
+
const reviewableDiffCount = [...replacementsByFile.values()].reduce((sum, items) => sum + items.length, 0);
|
|
1421
|
+
const setupRequiredCount = [...replacementsByFile.values()].reduce(
|
|
1422
|
+
(sum, items) => sum + items.filter((item) => item.requiresProviderSetup).length,
|
|
1423
|
+
0
|
|
1424
|
+
);
|
|
1420
1425
|
lines.push("# FlagLint migrate --dry-run");
|
|
1421
1426
|
lines.push("");
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1427
|
+
if (reviewableDiffCount > 0 && setupRequiredCount === 0) {
|
|
1428
|
+
lines.push(
|
|
1429
|
+
"The transformations below use proven OpenFeature client bindings already present in the affected files."
|
|
1430
|
+
);
|
|
1431
|
+
} else if (setupRequiredCount > 0 && setupRequiredCount === reviewableDiffCount) {
|
|
1432
|
+
lines.push(
|
|
1433
|
+
"These diffs use the placeholder `openFeatureClient` and require OpenFeature provider/client setup before they can be applied."
|
|
1434
|
+
);
|
|
1435
|
+
} else if (setupRequiredCount > 0) {
|
|
1436
|
+
lines.push(
|
|
1437
|
+
"Some diffs use proven OpenFeature client bindings; diffs using the `openFeatureClient` placeholder require provider/client setup before they can be applied."
|
|
1438
|
+
);
|
|
1439
|
+
}
|
|
1425
1440
|
lines.push("No files are modified by dry-run output.");
|
|
1426
1441
|
lines.push("");
|
|
1427
|
-
lines.push(`Reviewable diffs: ${
|
|
1428
|
-
lines.push(
|
|
1429
|
-
`Diffs requiring provider setup: ${[...replacementsByFile.values()].reduce((sum, items) => sum + items.filter((item) => item.requiresProviderSetup).length, 0)}`
|
|
1430
|
-
);
|
|
1442
|
+
lines.push(`Reviewable diffs: ${reviewableDiffCount}`);
|
|
1443
|
+
lines.push(`Diffs requiring provider setup: ${setupRequiredCount}`);
|
|
1431
1444
|
lines.push(`Skipped usages: ${skipped.length}`);
|
|
1432
1445
|
lines.push("");
|
|
1433
|
-
|
|
1446
|
+
if (setupRequiredCount > 0) {
|
|
1447
|
+
lines.push(...formatProviderSetupSection());
|
|
1448
|
+
}
|
|
1434
1449
|
if (replacementsByFile.size > 0) {
|
|
1435
1450
|
lines.push("## Diffs");
|
|
1436
1451
|
lines.push("```diff");
|
|
@@ -1942,7 +1957,7 @@ Examples:
|
|
|
1942
1957
|
// src/cli.ts
|
|
1943
1958
|
function createCLI() {
|
|
1944
1959
|
const program2 = new Command();
|
|
1945
|
-
program2.name("flaglint").description("LaunchDarkly Node.js server SDK -> OpenFeature migration.").version("0.5.
|
|
1960
|
+
program2.name("flaglint").description("LaunchDarkly Node.js server SDK -> OpenFeature migration.").version("0.5.1", "-v, --version", "output the current version").addHelpText(
|
|
1946
1961
|
"after",
|
|
1947
1962
|
`
|
|
1948
1963
|
Examples:
|