@carbon/feature-flags 1.1.0 → 1.2.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.
- package/es/index.js +245 -498
- package/lib/index.js +246 -499
- package/package.json +6 -11
- package/types/FeatureFlagScope.d.ts +0 -39
- package/types/generated/feature-flags.d.ts +0 -5
- package/types/index.d.ts +0 -15
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/feature-flags",
|
|
3
3
|
"description": "Build with feature flags in Carbon",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"provenance": true
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "yarn clean && node tasks/build.
|
|
37
|
-
"clean": "rimraf es lib
|
|
38
|
-
"watch": "
|
|
36
|
+
"build": "yarn clean && node tasks/build.mjs && tsdown --config tsdown.config.mts",
|
|
37
|
+
"clean": "rimraf es lib scss/generated src/generated",
|
|
38
|
+
"watch": "node tasks/build.mjs && tsdown --config tsdown.config.mts --watch",
|
|
39
39
|
"postinstall": "ibmtelemetry --config=telemetry.yml"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -46,16 +46,11 @@
|
|
|
46
46
|
"@babel/template": "^7.27.2",
|
|
47
47
|
"@babel/types": "^7.27.3",
|
|
48
48
|
"@carbon/scss-generator": "^10.20.0",
|
|
49
|
-
"@rollup/plugin-babel": "^6.0.0",
|
|
50
|
-
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
51
49
|
"change-case-all": "^2.1.0",
|
|
52
50
|
"fs-extra": "^11.0.0",
|
|
53
51
|
"js-yaml": "^4.1.0",
|
|
54
52
|
"rimraf": "^6.0.1",
|
|
55
|
-
"
|
|
56
|
-
"rollup-plugin-strip-banner": "^3.0.0",
|
|
57
|
-
"typescript": "^5.7.3",
|
|
58
|
-
"typescript-config-carbon": "^0.9.0"
|
|
53
|
+
"tsdown": "^0.20.3"
|
|
59
54
|
},
|
|
60
55
|
"sideEffects": false,
|
|
61
56
|
"babel": {
|
|
@@ -67,5 +62,5 @@
|
|
|
67
62
|
"dependencies": {
|
|
68
63
|
"@ibm/telemetry-js": "^1.5.0"
|
|
69
64
|
},
|
|
70
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "aeaaa31889990fc76c7e0e8a29ec0bf96ce33f82"
|
|
71
66
|
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2015, 2026
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
export type FeatureFlagRecord = Record<string, boolean>;
|
|
8
|
-
/** @deprecated Use `FeatureFlagRecord` instead. */
|
|
9
|
-
export type FeatureFlags = FeatureFlagRecord;
|
|
10
|
-
export declare class FeatureFlagScope {
|
|
11
|
-
flags: Map<string, boolean>;
|
|
12
|
-
constructor(flags?: FeatureFlagRecord);
|
|
13
|
-
/**
|
|
14
|
-
* Check to see if a flag exists
|
|
15
|
-
*/
|
|
16
|
-
checkForFlag(name: string): void;
|
|
17
|
-
/**
|
|
18
|
-
* Add a feature flag
|
|
19
|
-
*/
|
|
20
|
-
add(name: string, enabled: boolean): void;
|
|
21
|
-
/**
|
|
22
|
-
* Enable a feature flag
|
|
23
|
-
*/
|
|
24
|
-
enable(name: string): void;
|
|
25
|
-
/**
|
|
26
|
-
* Disable a feature flag
|
|
27
|
-
*/
|
|
28
|
-
disable(name: string): void;
|
|
29
|
-
/**
|
|
30
|
-
* Merge the given feature flags with the current set of feature flags.
|
|
31
|
-
* Duplicate keys will be set to the value in the given feature flags.
|
|
32
|
-
*/
|
|
33
|
-
merge(flags: FeatureFlagRecord): void;
|
|
34
|
-
mergeWithScope(scope: FeatureFlagScope): void;
|
|
35
|
-
/**
|
|
36
|
-
* Check if a feature flag is enabled
|
|
37
|
-
*/
|
|
38
|
-
enabled(name: string): boolean;
|
|
39
|
-
}
|
package/types/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2015, 2026
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import { FeatureFlagScope, type FeatureFlagRecord } from './FeatureFlagScope';
|
|
8
|
-
export type { FeatureFlagRecord } from './FeatureFlagScope';
|
|
9
|
-
export declare const createScope: (flags?: FeatureFlagRecord) => FeatureFlagScope;
|
|
10
|
-
export declare const FeatureFlags: FeatureFlagScope;
|
|
11
|
-
export declare const add: (name: string, enabled: boolean) => void;
|
|
12
|
-
export declare const enable: (name: string) => void;
|
|
13
|
-
export declare const disable: (name: string) => void;
|
|
14
|
-
export declare const enabled: (name: string) => boolean;
|
|
15
|
-
export declare const merge: (flags: FeatureFlagRecord) => void;
|