@parcel/feature-flags
Advanced tools
Comparing version 2.12.1-nightly.3142 to 2.13.0
@@ -7,4 +7,19 @@ "use strict"; | ||
exports.DEFAULT_FEATURE_FLAGS = void 0; | ||
exports.getFeatureFlag = getFeatureFlag; | ||
exports.setFeatureFlags = setFeatureFlags; | ||
// We need to do these gymnastics as we don't want flow-to-ts to touch DEFAULT_FEATURE_FLAGS, | ||
// but we want to export FeatureFlags for Flow | ||
const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = { | ||
exampleFeature: false | ||
}; | ||
exampleFeature: false, | ||
useWatchmanWatcher: false, | ||
importRetry: false | ||
}; | ||
let featureFlagValues = { | ||
...DEFAULT_FEATURE_FLAGS | ||
}; | ||
function setFeatureFlags(flags) { | ||
featureFlagValues = flags; | ||
} | ||
function getFeatureFlag(flagName) { | ||
return featureFlagValues[flagName]; | ||
} |
{ | ||
"name": "@parcel/feature-flags", | ||
"version": "2.12.1-nightly.3142+40c370f09", | ||
"description": "Blazing fast, zero configuration web application bundler", | ||
"version": "2.13.0", | ||
"description": "Provides internal feature-flags for the parcel codebase.", | ||
"license": "MIT", | ||
@@ -19,7 +19,11 @@ "publishConfig": { | ||
"source": "src/index.js", | ||
"types": "index.d.ts", | ||
"types": "lib/types.d.ts", | ||
"scripts": { | ||
"build-ts": "mkdir -p lib && flow-to-ts src/types.js > lib/types.d.ts", | ||
"check-ts": "tsc --noEmit lib/types.d.ts" | ||
}, | ||
"engines": { | ||
"node": ">= 16.0.0" | ||
}, | ||
"gitHead": "40c370f09a1c4b7eee5a6ad2b1b74fb95a04f389" | ||
"gitHead": "a53f8f3ba1025c7ea8653e9719e0a61ef9717079" | ||
} |
// @flow strict | ||
export type FeatureFlags = {| | ||
// This feature flag mostly exists to test the feature flag system, and doesn't have any build/runtime effect | ||
+exampleFeature: boolean, | ||
|}; | ||
import type {FeatureFlags as _FeatureFlags} from './types'; | ||
// We need to do these gymnastics as we don't want flow-to-ts to touch DEFAULT_FEATURE_FLAGS, | ||
// but we want to export FeatureFlags for Flow | ||
export type FeatureFlags = _FeatureFlags; | ||
export const DEFAULT_FEATURE_FLAGS: FeatureFlags = { | ||
exampleFeature: false, | ||
useWatchmanWatcher: false, | ||
importRetry: false, | ||
}; | ||
let featureFlagValues: FeatureFlags = {...DEFAULT_FEATURE_FLAGS}; | ||
export function setFeatureFlags(flags: FeatureFlags) { | ||
featureFlagValues = flags; | ||
} | ||
export function getFeatureFlag(flagName: $Keys<FeatureFlags>): boolean { | ||
return featureFlagValues[flagName]; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4507
8
82
1
0