@warp-drive-mirror/build-config 5.4.0-alpha.150 → 5.4.0-alpha.152

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.
@@ -1,5 +1,5 @@
1
- import { L as LOGGING } from './debugging-PCb4hczb.js';
2
- import { C as CURRENT_FEATURES } from './canary-features-BzGSGY5j.js';
1
+ import { L as LOGGING } from './debugging-CX6Ul3W_.js';
2
+ import { C as CURRENT_FEATURES } from './canary-features-Bpa1abyy.js';
3
3
  import { C as CURRENT_DEPRECATIONS } from './deprecations-ChFQtx-4.js';
4
4
 
5
5
  const features = Object.keys(CURRENT_FEATURES);
@@ -1,4 +1,10 @@
1
1
  /**
2
+ *
3
+ * @module @warp-drive-mirror/build-config
4
+ */
5
+
6
+ /**
7
+ *
2
8
  * ## Canary Features
3
9
  *
4
10
  * EmberData allows users to test features that are implemented but not yet
@@ -31,24 +37,22 @@
31
37
  *
32
38
  * ```cli
33
39
  * # Activate a single flag
34
- * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG ember build
40
+ * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG ember build
35
41
  *
36
42
  * # Activate multiple flags by separating with commas
37
- * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build
43
+ * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build
38
44
  *
39
45
  * # Activate all flags
40
- * EMBER_DATA_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
46
+ * WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
41
47
  * ```
42
48
  *
43
49
  * or by setting the appropriate flag in your `ember-cli-build` file:
44
50
  *
45
51
  * ```ts
46
- * let app = new EmberApp(defaults, {
47
- * emberData: {
48
- * features: {
49
- * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature
50
- * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior
51
- * }
52
+ * setConfig(app, __dirname, {
53
+ * features: {
54
+ * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature
55
+ * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior
52
56
  * }
53
57
  * })
54
58
  * ```
@@ -70,21 +74,17 @@
70
74
  * }
71
75
  * ```
72
76
  *
73
- @module @warp-drive-mirror/build-config/canary-features
74
- @main @warp-drive-mirror/build-config/canary-features
75
- */
76
- /**
77
- This is the current list of features used at build time for canary releases.
78
- If empty there are no features currently gated by feature flags.
79
-
80
- The valid values are:
81
-
82
- - `true` | The feature is **enabled** at all times, and cannot be disabled.
83
- - `false` | The feature is **disabled** at all times, and cannot be enabled.
84
- - `null` | The feature is **disabled by default**, but can be enabled via configuration.
85
-
86
- @class CanaryFeatureFlags
87
- @public
77
+ * The current list of features used at build time for canary releases is defined below.
78
+ * If empty there are no features currently gated by feature flags.
79
+ *
80
+ * The valid values are:
81
+ *
82
+ * - `true` | The feature is **enabled** at all times, and cannot be disabled.
83
+ * - `false` | The feature is **disabled** at all times, and cannot be enabled.
84
+ * - `null` | The feature is **disabled by default**, but can be enabled via configuration.
85
+ *
86
+ * @class CanaryFeatures
87
+ * @public
88
88
  */
89
89
  const SAMPLE_FEATURE_FLAG = null;
90
90
 
@@ -94,4 +94,4 @@ const CURRENT_FEATURES = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePr
94
94
  }, Symbol.toStringTag, { value: 'Module' }));
95
95
 
96
96
  export { CURRENT_FEATURES as C, SAMPLE_FEATURE_FLAG as S };
97
- //# sourceMappingURL=canary-features-BzGSGY5j.js.map
97
+ //# sourceMappingURL=canary-features-Bpa1abyy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canary-features-Bpa1abyy.js","sources":["../src/canary-features.ts"],"sourcesContent":["/**\n *\n * @module @warp-drive-mirror/build-config\n */\n\n/**\n *\n * ## Canary Features\n *\n * EmberData allows users to test features that are implemented but not yet\n * available even in canary.\n *\n * Typically these features represent work that might introduce a new concept,\n * new API, change an API, or risk an unintended change in behavior to consuming\n * applications.\n *\n * Such features have their implementations guarded by a \"feature flag\", and the\n * flag is only activated once the core-data team is prepared to ship the work\n * in a canary release.\n *\n * ### Installing Canary\n *\n * To test a feature you MUST be using a canary build. Canary builds are published\n * to `npm` and can be installed using a precise tag (such as `ember-data@3.16.0-alpha.1`)\n * or by installing the latest dist-tag published to the `canary` channel using your javascript\n * package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n ```cli\n pnpm add ember-data@canary\n ```\n *\n * ### Activating a Canary Feature\n *\n * Once you have installed canary, feature-flags can be activated at build-time\n *\n * by setting an environment variable:\n *\n * ```cli\n * # Activate a single flag\n * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG ember build\n *\n * # Activate multiple flags by separating with commas\n * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build\n *\n * # Activate all flags\n * WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build\n * ```\n *\n * or by setting the appropriate flag in your `ember-cli-build` file:\n *\n * ```ts\n * setConfig(app, __dirname, {\n * features: {\n * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature\n * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior\n * }\n * })\n * ```\n *\n * **The \"off\" branch of feature-flagged code is always stripped from production builds.**\n *\n * The list of available feature-flags is located [here](https://github.com/emberjs/data/tree/main/packages/build-config/src/virtual/canary-features.ts \"List of EmberData FeatureFlags\")\n *\n *\n * ### Preparing a Project to use a Canary Feature\n *\n * For most projects, simple version detection should be enough.\n * Using the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)\n * the following can be done:\n *\n * ```js\n * if (macroCondition(dependencySatisfies('@ember-data-mirror/store', '5.0'))) {\n * // do thing\n * }\n * ```\n *\n * The current list of features used at build time for canary releases is defined below.\n * If empty there are no features currently gated by feature flags.\n *\n * The valid values are:\n *\n * - `true` | The feature is **enabled** at all times, and cannot be disabled.\n * - `false` | The feature is **disabled** at all times, and cannot be enabled.\n * - `null` | The feature is **disabled by default**, but can be enabled via configuration.\n *\n * @class CanaryFeatures\n * @public\n*/\nexport const SAMPLE_FEATURE_FLAG: boolean | null = null;\n"],"names":["SAMPLE_FEATURE_FLAG"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,mBAAmC,GAAG;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- export { S as SAMPLE_FEATURE_FLAG } from './canary-features-BzGSGY5j.js';
1
+ export { S as SAMPLE_FEATURE_FLAG } from './canary-features-Bpa1abyy.js';
2
2
  //# sourceMappingURL=canary-features.js.map
@@ -32,6 +32,9 @@ function getEnv() {
32
32
  };
33
33
  }
34
34
 
35
+ /**
36
+ * @module @warp-drive-mirror/build-config
37
+ */
35
38
  // ========================
36
39
  // FOR CONTRIBUTING AUTHORS
37
40
  //
@@ -51,7 +54,7 @@ function getEnv() {
51
54
  //
52
55
 
53
56
  /**
54
- * ## Deprecations
57
+ * ## Deprecation Management
55
58
  *
56
59
  * EmberData allows users to opt-in and remove code that exists to support deprecated
57
60
  * behaviors.
@@ -69,54 +72,26 @@ function getEnv() {
69
72
  * with `3.12`. This would remove any deprecations that were present in or before `3.12`
70
73
  * but keep support for anything deprecated in or above `3.13`.
71
74
  *
72
- * ### Configuring Compatibility
73
- *
74
- * To configure your compatibility version, set the `compatWith` to the version you
75
- * are compatible with on the `emberData` config in your `ember-cli-build.js` file.
76
- *
77
- * ```js
78
- * const { setConfig } = await import('@warp-drive-mirror/build-config');
79
- *
80
- * let app = new EmberApp(defaults, {});
81
- *
82
- * setConfig(app, __dirname, { compatWith: '3.12' });
83
- * ```
84
- *
85
- * Alternatively, individual deprecations can be resolved (and thus have its support stripped)
86
- * via one of the flag names listed below. For instance, given a flag named `DEPRECATE_FOO_BEHAVIOR`.
87
- *
88
- * This capability is interopable with `compatWith`. You may set `compatWith` and then selectively resolve
89
- * additional deprecations, or set compatWith and selectively un-resolve specific deprecations.
90
- *
91
- * Note: EmberData does not test against permutations of deprecations being stripped, our tests run against
92
- * "all deprecated code included" and "all deprecated code removed". Unspecified behavior may sometimes occur
93
- * when removing code for only some deprecations associated to a version number.
94
- *
95
- * ```js
96
- * const { setConfig } = await import('@warp-drive-mirror/build-config');
97
- *
98
- * let app = new EmberApp(defaults, {});
75
+ * You may also specify that specific deprecations are resolved. These approaches
76
+ * may be used together.
99
77
  *
78
+ * ```ts
100
79
  * setConfig(app, __dirname, {
80
+ * // declare that all deprecations through "5.0" have been fully resolved
81
+ * compatWith: '5.0',
82
+ *
83
+ * // mark individual deprecations as resolved by setting them to `false`
101
84
  * deprecations: {
102
- * DEPRECATE_FOO_BEHAVIOR: false // set to false to strip this code
103
- * DEPRECATE_BAR_BEHAVIOR: true // force to true to not strip this code
104
- * }
85
+ * // resolve individual deprecations here
86
+ * },
105
87
  * });
106
88
  * ```
107
89
  *
108
- * The complete list of which versions specific deprecations will be removed in
109
- * can be found [here](https://github.com/emberjs/data/blob/main/packages/build-config/src/virtual/deprecation-versions.ts "List of EmberData Deprecations")
110
- *
111
- * @module @warp-drive-mirror/build-config/deprecations
112
- * @main @warp-drive-mirror/build-config/deprecations
113
- */
114
-
115
- /**
116
- * The following list represents deprecations currently active.
117
- *
118
- * Some deprecation flags guard multiple deprecation IDs. All
119
- * associated IDs are listed.
90
+ * > [!TIP]
91
+ * > EmberData does not test against permutations of deprecations
92
+ * > being stripped, our tests run against "all deprecated code included"
93
+ * > and "all deprecated code removed". Unspecified behavior may sometimes occur
94
+ * > when removing code for only some deprecations associated to a version number.
120
95
  *
121
96
  * @class CurrentDeprecations
122
97
  * @public
@@ -570,6 +545,12 @@ function getDeprecations(compatVersion, deprecations) {
570
545
  }
571
546
 
572
547
  /**
548
+ *
549
+ * @module @warp-drive-mirror/build-config
550
+ */
551
+
552
+ /**
553
+ *
573
554
  * ## Canary Features
574
555
  *
575
556
  * EmberData allows users to test features that are implemented but not yet
@@ -602,24 +583,22 @@ function getDeprecations(compatVersion, deprecations) {
602
583
  *
603
584
  * ```cli
604
585
  * # Activate a single flag
605
- * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG ember build
586
+ * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG ember build
606
587
  *
607
588
  * # Activate multiple flags by separating with commas
608
- * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build
589
+ * WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build
609
590
  *
610
591
  * # Activate all flags
611
- * EMBER_DATA_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
592
+ * WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
612
593
  * ```
613
594
  *
614
595
  * or by setting the appropriate flag in your `ember-cli-build` file:
615
596
  *
616
597
  * ```ts
617
- * let app = new EmberApp(defaults, {
618
- * emberData: {
619
- * features: {
620
- * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature
621
- * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior
622
- * }
598
+ * setConfig(app, __dirname, {
599
+ * features: {
600
+ * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature
601
+ * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior
623
602
  * }
624
603
  * })
625
604
  * ```
@@ -641,21 +620,17 @@ function getDeprecations(compatVersion, deprecations) {
641
620
  * }
642
621
  * ```
643
622
  *
644
- @module @warp-drive-mirror/build-config/canary-features
645
- @main @warp-drive-mirror/build-config/canary-features
646
- */
647
- /**
648
- This is the current list of features used at build time for canary releases.
649
- If empty there are no features currently gated by feature flags.
650
-
651
- The valid values are:
652
-
653
- - `true` | The feature is **enabled** at all times, and cannot be disabled.
654
- - `false` | The feature is **disabled** at all times, and cannot be enabled.
655
- - `null` | The feature is **disabled by default**, but can be enabled via configuration.
656
-
657
- @class CanaryFeatureFlags
658
- @public
623
+ * The current list of features used at build time for canary releases is defined below.
624
+ * If empty there are no features currently gated by feature flags.
625
+ *
626
+ * The valid values are:
627
+ *
628
+ * - `true` | The feature is **enabled** at all times, and cannot be disabled.
629
+ * - `false` | The feature is **disabled** at all times, and cannot be enabled.
630
+ * - `null` | The feature is **disabled by default**, but can be enabled via configuration.
631
+ *
632
+ * @class CanaryFeatures
633
+ * @public
659
634
  */
660
635
  const SAMPLE_FEATURE_FLAG = null;
661
636
 
@@ -681,7 +656,7 @@ function getFeatures(isProd) {
681
656
  }
682
657
  return features;
683
658
  }
684
- const FEATURE_OVERRIDES = process.env.EMBER_DATA_FEATURE_OVERRIDE;
659
+ const FEATURE_OVERRIDES = process.env.WARP_DRIVE_FEATURE_OVERRIDE;
685
660
  if (FEATURE_OVERRIDES === 'ENABLE_ALL_OPTIONAL') {
686
661
  // enable all features with a current value of `null`
687
662
  for (const feature of keys) {
@@ -720,41 +695,35 @@ function getFeatures(isProd) {
720
695
  }
721
696
 
722
697
  /**
723
- * ## Debugging
698
+ @module @warp-drive-mirror/build-config
699
+ */
700
+ /**
701
+ * ## Debug Logging
724
702
  *
725
703
  * Many portions of the internals are helpfully instrumented with logging that can be activated
726
704
  * at build time. This instrumentation is always removed from production builds or any builds
727
705
  * that has not explicitly activated it. To activate it set the appropriate flag to `true`.
728
706
  *
729
- @module @warp-drive-mirror/build-config/debugging
730
- @main @warp-drive-mirror/build-config/debugging
731
- */
732
- /**
707
+ * ```ts
708
+ * setConfig(__dirname, app, {
709
+ * debug: {
710
+ * LOG_PAYLOADS: false, // data store received to update cache with
711
+ * LOG_OPERATIONS: false, // updates to cache remote state
712
+ * LOG_MUTATIONS: false, // updates to cache local state
713
+ * LOG_NOTIFICATIONS: false,
714
+ * LOG_REQUESTS: false,
715
+ * LOG_REQUEST_STATUS: false,
716
+ * LOG_IDENTIFIERS: false,
717
+ * LOG_GRAPH: false,
718
+ * LOG_INSTANCE_CACHE: false,
719
+ * LOG_METRIC_COUNTS: false,
720
+ * DEBUG_RELATIONSHIP_NOTIFICATIONS: false,
721
+ * }
722
+ * });
723
+ * ```
733
724
  *
734
- * Many portions of the internals are helpfully instrumented with logging that can be activated
735
- at build time. This instrumentation is always removed from production builds or any builds
736
- that has not explicitly activated it. To activate it set the appropriate flag to `true`.
737
-
738
- ```ts
739
- let app = new EmberApp(defaults, {
740
- emberData: {
741
- debug: {
742
- LOG_PAYLOADS: false, // data store received to update cache with
743
- LOG_OPERATIONS: false, // updates to cache remote state
744
- LOG_MUTATIONS: false, // updates to cache local state
745
- LOG_NOTIFICATIONS: false,
746
- LOG_REQUESTS: false,
747
- LOG_REQUEST_STATUS: false,
748
- LOG_IDENTIFIERS: false,
749
- LOG_GRAPH: false,
750
- LOG_INSTANCE_CACHE: false,
751
- }
752
- }
753
- });
754
- ```
755
-
756
- @class DebugLogging
757
- @public
725
+ * @class DebugLogging
726
+ * @public
758
727
  */
759
728
  /**
760
729
  * log payloads received by the store
@@ -882,6 +851,65 @@ function createLoggingConfig(env, debug) {
882
851
  return config;
883
852
  }
884
853
 
854
+ /**
855
+ * Settings configuration for deprecations, optional features, development/testing
856
+ * support and debug logging is done using `setConfig` in `ember-cli-build`.
857
+ *
858
+ * ```ts
859
+ * 'use strict';
860
+ *
861
+ * const EmberApp = require('ember-cli/lib/broccoli/ember-app');
862
+ *
863
+ * module.exports = async function (defaults) {
864
+ * const { setConfig } = await import('@warp-drive-mirror/build-config');
865
+ *
866
+ * const app = new EmberApp(defaults, {});
867
+ *
868
+ * setConfig(app, __dirname, {
869
+ * // settings here
870
+ * });
871
+ *
872
+ * const { Webpack } = require('@embroider/webpack');
873
+ * return require('@embroider/compat').compatBuild(app, Webpack, {});
874
+ * };
875
+ *
876
+ * ```
877
+ *
878
+ * Available settings include:
879
+ *
880
+ * - [Debug Logging](../classes/DebugLogging)
881
+ * - [Deprecated Code Removal](../classes/CurrentDeprecations)
882
+ * - [Canary Feature Activation](../classes/CanaryFeatures)
883
+ *
884
+ * As well as:
885
+ *
886
+ * ### polyfillUUID
887
+ *
888
+ * If you are using the library in an environment that does not support `window.crypto.randomUUID`
889
+ * you can enable a polyfill for it.
890
+ *
891
+ * ```ts
892
+ * setConfig(app, __dirname, {
893
+ * polyfillUUID: true
894
+ * });
895
+ * ```
896
+ *
897
+ * ### includeDataAdapterInProduction
898
+ *
899
+ * By default, the integration required to support the ember inspector browser extension
900
+ * is included in production builds only when using the `ember-data` package. Otherwise
901
+ * the default is to exclude it. This setting allows to explicitly enable/disable it in
902
+ * production builds.
903
+ *
904
+ * ```ts
905
+ * setConfig(app, __dirname, {
906
+ * includeDataAdapterInProduction: true
907
+ * });
908
+ * ```
909
+ *
910
+ * @module @warp-drive-mirror/build-config
911
+ * @main @warp-drive-mirror/build-config
912
+ */
885
913
  const _MacrosConfig = EmbroiderMacros.MacrosConfig;
886
914
  function recastMacrosConfig(macros) {
887
915
  if (!('globalConfig' in macros)) {