@warp-drive-mirror/build-config 5.6.0-alpha.5 → 5.6.0-beta.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.
Files changed (73) hide show
  1. package/declarations/-private/utils/deprecations.d.ts +5 -0
  2. package/declarations/-private/utils/features.d.ts +4 -0
  3. package/declarations/-private/utils/get-env.d.ts +8 -0
  4. package/declarations/-private/utils/logging.d.ts +9 -0
  5. package/declarations/babel-macros.d.ts +13 -0
  6. package/declarations/canary-features.d.ts +136 -0
  7. package/declarations/debugging.d.ts +172 -0
  8. package/declarations/deprecation-versions.d.ts +30 -0
  9. package/declarations/deprecations.d.ts +516 -0
  10. package/declarations/env.d.ts +129 -0
  11. package/declarations/index.d.ts +101 -0
  12. package/declarations/macros.d.ts +18 -0
  13. package/dist/addon-shim.cjs +0 -1
  14. package/dist/babel-macros.js +12 -13
  15. package/dist/babel-plugin-transform-asserts.cjs +3 -5
  16. package/dist/babel-plugin-transform-deprecations.cjs +0 -1
  17. package/dist/babel-plugin-transform-features.cjs +0 -1
  18. package/dist/babel-plugin-transform-logging.cjs +0 -1
  19. package/dist/{canary-features-DF5hbs2w.js → canary-features-CuKgaVtX.js} +18 -42
  20. package/dist/canary-features.js +1 -2
  21. package/dist/cjs-set-config.cjs +26 -47
  22. package/dist/debugging-VdsvkNjX.js +0 -1
  23. package/dist/debugging.js +0 -1
  24. package/dist/{deprecations-BVxAmwe9.js → deprecations-BNNGFAiG.js} +5 -6
  25. package/dist/deprecations.js +1 -2
  26. package/dist/env.js +0 -1
  27. package/dist/index.js +9 -7
  28. package/dist/macros.js +0 -1
  29. package/package.json +7 -16
  30. package/dist/addon-shim.cjs.map +0 -1
  31. package/dist/babel-macros.js.map +0 -1
  32. package/dist/babel-plugin-transform-asserts.cjs.map +0 -1
  33. package/dist/babel-plugin-transform-deprecations.cjs.map +0 -1
  34. package/dist/babel-plugin-transform-features.cjs.map +0 -1
  35. package/dist/babel-plugin-transform-logging.cjs.map +0 -1
  36. package/dist/canary-features-DF5hbs2w.js.map +0 -1
  37. package/dist/canary-features.js.map +0 -1
  38. package/dist/cjs-set-config.cjs.map +0 -1
  39. package/dist/debugging-VdsvkNjX.js.map +0 -1
  40. package/dist/debugging.js.map +0 -1
  41. package/dist/deprecations-BVxAmwe9.js.map +0 -1
  42. package/dist/deprecations.js.map +0 -1
  43. package/dist/env.js.map +0 -1
  44. package/dist/index.js.map +0 -1
  45. package/dist/macros.js.map +0 -1
  46. package/unstable-preview-types/-private/utils/deprecations.d.ts +0 -12
  47. package/unstable-preview-types/-private/utils/deprecations.d.ts.map +0 -1
  48. package/unstable-preview-types/-private/utils/features.d.ts +0 -9
  49. package/unstable-preview-types/-private/utils/features.d.ts.map +0 -1
  50. package/unstable-preview-types/-private/utils/get-env.d.ts +0 -11
  51. package/unstable-preview-types/-private/utils/get-env.d.ts.map +0 -1
  52. package/unstable-preview-types/-private/utils/logging.d.ts +0 -14
  53. package/unstable-preview-types/-private/utils/logging.d.ts.map +0 -1
  54. package/unstable-preview-types/babel-macros.d.ts +0 -16
  55. package/unstable-preview-types/babel-macros.d.ts.map +0 -1
  56. package/unstable-preview-types/canary-features.d.ts +0 -162
  57. package/unstable-preview-types/canary-features.d.ts.map +0 -1
  58. package/unstable-preview-types/cjs-set-config.d.ts +0 -4
  59. package/unstable-preview-types/cjs-set-config.d.ts.map +0 -1
  60. package/unstable-preview-types/debugging.d.ts +0 -175
  61. package/unstable-preview-types/debugging.d.ts.map +0 -1
  62. package/unstable-preview-types/deprecation-versions.d.ts +0 -16
  63. package/unstable-preview-types/deprecation-versions.d.ts.map +0 -1
  64. package/unstable-preview-types/deprecations.d.ts +0 -519
  65. package/unstable-preview-types/deprecations.d.ts.map +0 -1
  66. package/unstable-preview-types/env.d.ts +0 -132
  67. package/unstable-preview-types/env.d.ts.map +0 -1
  68. package/unstable-preview-types/index.d.ts +0 -113
  69. package/unstable-preview-types/index.d.ts.map +0 -1
  70. package/unstable-preview-types/macros.d.ts +0 -21
  71. package/unstable-preview-types/macros.d.ts.map +0 -1
  72. package/unstable-preview-types/validate-exports.type-test.d.ts +0 -4
  73. package/unstable-preview-types/validate-exports.type-test.d.ts.map +0 -1
@@ -0,0 +1,5 @@
1
+ import * as CURRENT_DEPRECATIONS from "../../deprecation-versions.js";
2
+ type MajorMinor = `${number}.${number}`;
3
+ type DeprecationFlag = keyof typeof CURRENT_DEPRECATIONS;
4
+ export declare function getDeprecations(compatVersion: MajorMinor | null | undefined, deprecations?: { [key in DeprecationFlag]? : boolean }): { [key in DeprecationFlag] : boolean };
5
+ export {};
@@ -0,0 +1,4 @@
1
+ import * as CURRENT_FEATURES from "../../canary-features.js";
2
+ type FEATURE = keyof typeof CURRENT_FEATURES;
3
+ export declare function getFeatures(isProd: boolean): { [key in FEATURE] : boolean };
4
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare function getEnv(forceMode?: "testing" | "production" | "development" | "debug"): {
2
+ TESTING: boolean;
3
+ PRODUCTION: boolean;
4
+ DEBUG: boolean;
5
+ IS_RECORDING: boolean;
6
+ IS_CI: boolean;
7
+ SHOULD_RECORD: boolean;
8
+ };
@@ -0,0 +1,9 @@
1
+ import * as LOGGING from "../../debugging.js";
2
+ type LOG_CONFIG_KEY = keyof typeof LOGGING;
3
+ export type LOG_CONFIG = { [key in LOG_CONFIG_KEY] : boolean };
4
+ export declare function createLoggingConfig(env: {
5
+ DEBUG: boolean;
6
+ TESTING: boolean;
7
+ PRODUCTION: boolean;
8
+ }, debug: LOG_CONFIG): LOG_CONFIG;
9
+ export {};
@@ -0,0 +1,13 @@
1
+ type BabelPlugin = [string, Record<string, unknown>, string];
2
+ /**
3
+ * @returns an array of Babel plugins that can be used for code-stripping
4
+ * based on the configuration supplied to `setConfig` and the current ENV.
5
+ *
6
+ * - deprecation constants imported from `@warp-drive-mirror/build-config/deprecations`
7
+ * - feature flags imported from `@warp-drive-mirror/build-config/canary-features`
8
+ * - debug logging constants imported from `@warp-drive-mirror/build-config/debugging`
9
+ * - environment constants imported from `@warp-drive-mirror/build-config/env`
10
+ * - expressionts imported from `@warp-drive-mirror/build-config/macros`
11
+ */
12
+ export declare function macros(): BabelPlugin[];
13
+ export {};
@@ -0,0 +1,136 @@
1
+ /**
2
+ *
3
+ * # Canary Features <Badge type="warning" text="requires canary" />
4
+ *
5
+ * ***Warp*Drive** allows users to test upcoming features that are implemented
6
+ * but not yet activated in canary builds.
7
+ *
8
+ * Typically these features represent work that carries higher risk of breaking
9
+ * changes, or are not yet fully ready for production use.
10
+ *
11
+ * Such features have their implementations guarded by a "feature flag", and the
12
+ * flag is only activated once the core-data team is prepared to ship the work
13
+ * in a canary release, beginning the process of it landing in a stable release.
14
+ *
15
+ * ### Installing Canary
16
+ *
17
+ * ::: warning To test a feature guarded behind a flag, you MUST be using a canary build.
18
+ * :::
19
+ *
20
+ * Canary builds are published to `npm` and can be installed using a precise tag
21
+ * (such as `@warp-drive-mirror/core@5.6.0-alpha.1`) or by installing the latest dist-tag
22
+ * published to the `canary` channel.
23
+ *
24
+ * Because ***Warp*Drive** packages operate on a strict lockstep policy with each other,
25
+ * you must install the matching canary version of all ***Warp*Drive** packages.
26
+ *
27
+ * Below is an example of installing the latest canary version of all the core
28
+ * packages that are part of the ***Warp*Drive** project when using EmberJS.
29
+ *
30
+ * Add/remove packages from this list to match your project.
31
+ *
32
+ * ::: code-group
33
+ *
34
+ * ```sh [pnpm]
35
+ * pnpm add -E @warp-drive-mirror/core@canary \
36
+ * @warp-drive-mirror/json-api@canary \
37
+ * @warp-drive-mirror/ember@canary;
38
+ * ```
39
+ *
40
+ * ```sh [npm]
41
+ * npm add -E @warp-drive-mirror/core@canary \
42
+ * @warp-drive-mirror/json-api@canary \
43
+ * @warp-drive-mirror/ember@canary;
44
+ * ```
45
+ *
46
+ * ```sh [yarn]
47
+ * yarn add -E @warp-drive-mirror/core@canary \
48
+ * @warp-drive-mirror/json-api@canary \
49
+ * @warp-drive-mirror/ember@canary;
50
+ * ```
51
+ *
52
+ * ```sh [bun]
53
+ * bun add --exact @warp-drive-mirror/core@canary \
54
+ * @warp-drive-mirror/json-api@canary \
55
+ * @warp-drive-mirror/ember@canary;
56
+ * ```
57
+ *
58
+ * :::
59
+ *
60
+ * ### Activating a Feature
61
+ *
62
+ * Once you have installed canary, feature-flags can be activated at build-time
63
+ *
64
+ * ```ts
65
+ * setConfig(app, __dirname, {
66
+ * features: {
67
+ * FEATURE_A: false, // utilize existing behavior
68
+ * FEATURE_B: true // utilize the new behavior
69
+ * }
70
+ * })
71
+ * ```
72
+ *
73
+ * by setting an environment variable:
74
+ *
75
+ * ```sh
76
+ * # Activate a single flag
77
+ * export WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG;
78
+ *
79
+ * # Activate multiple flags by separating with commas
80
+ * export WARP_DRIVE_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG;
81
+ *
82
+ * # Activate all flags
83
+ * export WARP_DRIVE_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL;
84
+ * ```
85
+ *
86
+ * ::: warning To test a feature guarded behind a flag, you MUST be running a development build.
87
+ * :::
88
+ *
89
+ *
90
+ * ### Preparing a Project to use a Canary Feature
91
+ *
92
+ * For most projects and features, simple version detection should be enough.
93
+ *
94
+ * Using the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)
95
+ * the following can be done:
96
+ *
97
+ * ```js
98
+ * if (macroCondition(dependencySatisfies('@warp-drive-mirror/core', '5.6'))) {
99
+ * // do thing
100
+ * }
101
+ * ```
102
+ *
103
+ * For more complex projects and migrations, configure [@warp-drive-mirror/build-config/babel-macros](./babel-macros)
104
+ *
105
+ * The current list of features used at build time for canary releases is defined below.
106
+ *
107
+ * ::: tip 💡 If empty there are no features currently gated by feature flags.
108
+ * :::
109
+ *
110
+ * The valid values are:
111
+ *
112
+ * - `true` | The feature is **enabled** at all times, and cannot be disabled.
113
+ * - `false` | The feature is **disabled** at all times, and cannot be enabled.
114
+ * - `null` | The feature is **disabled by default**, but can be enabled via configuration.
115
+ *
116
+ * @module
117
+ * @public
118
+ */
119
+ /**
120
+ * We use this for some tests etc.
121
+ *
122
+ * @internal
123
+ */
124
+ export declare const SAMPLE_FEATURE_FLAG: boolean | null;
125
+ /**
126
+ * This upcoming feature adds a validation step to payloads received
127
+ * by the JSONAPICache implementation.
128
+ *
129
+ * When a request completes and the result is given to the cache via
130
+ * `cache.put`, the cache will validate the payload against registered
131
+ * schemas as well as the JSON:API spec.
132
+ *
133
+ * @since 5.4
134
+ * @public
135
+ */
136
+ export declare const JSON_API_CACHE_VALIDATION_ERRORS: boolean | null;
@@ -0,0 +1,172 @@
1
+ /**
2
+ * # Log Instrumentation <Badge type="tip" text="debug only" />
3
+ *
4
+ * Many portions of the internals are helpfully instrumented with logging.
5
+ * This instrumentation is always removed from production builds.
6
+ *
7
+ * Log instrumentation is "regionalized" to specific concepts and concerns
8
+ * to enable you to enable/disable just the areas you are interested in.
9
+ *
10
+ * To activate a particular group of logs set the appropriate flag to `true`
11
+ * either in your build config or via the runtime helper.
12
+ *
13
+ *
14
+ * ## Runtime Activation
15
+ *
16
+ * ::: tip 💡 Just Works in browser Dev Tools!
17
+ * No import is needed, and the logging config is preserved when the page is refreshed
18
+ * :::
19
+ *
20
+ * ```ts
21
+ * setWarpDriveLogging({
22
+ * LOG_CACHE: true,
23
+ * LOG_REQUESTS: true,
24
+ * })
25
+ * ```
26
+ *
27
+ * A runtime helper is attached to `globalThis` to enable activation of the logs
28
+ * from anywhere in your application including from the devtools panel.
29
+ *
30
+ * The runtime helper overrides any build config settings for the given flag
31
+ * for the current browser tab. It stores the configuration you give it in
32
+ * `sessionStorage` so that it persists across page reloads of the current tab,
33
+ * but not across browser tabs or windows.
34
+ *
35
+ * If you need to deactivate the logging, you can call the helper again with the
36
+ * same flag set to `false` or just open a new tab/window.
37
+ *
38
+ * ## Buildtime Activation
39
+ *
40
+ * ```ts
41
+ * setConfig(__dirname, app, {
42
+ * debug: {
43
+ * LOG_CACHE: true,
44
+ * LOG_REQUESTS: false,
45
+ * LOG_NOTIFICATIONS: true,
46
+ * }
47
+ * });
48
+ * ```
49
+ *
50
+ * The build config settings are used to set the default values for the
51
+ * logging flags. Any logging flag that is not set in the build config
52
+ * will default to `false`.
53
+ *
54
+ * @module
55
+ */
56
+ /**
57
+ * log cache updates for both local
58
+ * and remote state. Note in some older versions
59
+ * this was called `LOG_PAYLOADS` and was one
60
+ * of three flags that controlled logging of
61
+ * cache updates. This is now the only flag.
62
+ *
63
+ * The others were `LOG_OPERATIONS` and `LOG_MUTATIONS`.
64
+ *
65
+ * @public
66
+ * @since 5.5
67
+ */
68
+ export declare const LOG_CACHE: boolean;
69
+ /**
70
+ * <Badge type="danger" text="removed" />
71
+ *
72
+ * This flag no longer has any effect.
73
+ *
74
+ * Use {@link LOG_CACHE} instead.
75
+ *
76
+ * @deprecated removed in version 5.5
77
+ * @public
78
+ */
79
+ export declare const LOG_PAYLOADS: boolean;
80
+ /**
81
+ * <Badge type="danger" text="removed" />
82
+ *
83
+ * This flag no longer has any effect.
84
+ *
85
+ * Use {@link LOG_CACHE} instead.
86
+ *
87
+ * @deprecated removed in version 5.5
88
+ * @public
89
+ */
90
+ export declare const LOG_OPERATIONS: boolean;
91
+ /**
92
+ * <Badge type="danger" text="removed" />
93
+ *
94
+ * This flag no longer has any effect.
95
+ *
96
+ * Use {@link LOG_CACHE} instead.
97
+ *
98
+ * @deprecated removed in version 5.5
99
+ * @public
100
+ */
101
+ export declare const LOG_MUTATIONS: boolean;
102
+ /**
103
+ * Log decisions made by the Basic CachePolicy
104
+ *
105
+ * @public
106
+ */
107
+ export declare const LOG_CACHE_POLICY: boolean;
108
+ /**
109
+ * log notifications received by the NotificationManager
110
+ *
111
+ * @public
112
+ */
113
+ export declare const LOG_NOTIFICATIONS: boolean;
114
+ /**
115
+ * log requests issued by the RequestManager
116
+ *
117
+ * @public
118
+ */
119
+ export declare const LOG_REQUESTS: boolean;
120
+ /**
121
+ * log updates to requests the store has issued to
122
+ * the network (adapter) to fulfill.
123
+ *
124
+ * @public
125
+ */
126
+ export declare const LOG_REQUEST_STATUS: boolean;
127
+ /**
128
+ * log peek, generation and updates to
129
+ * Record Identifiers.
130
+ *
131
+
132
+ * @public
133
+ */
134
+ export declare const LOG_IDENTIFIERS: boolean;
135
+ /**
136
+ * log updates received by the graph (relationship pointer storage)
137
+ *
138
+ * @public
139
+ */
140
+ export declare const LOG_GRAPH: boolean;
141
+ /**
142
+ * log creation/removal of RecordData and Record
143
+ * instances.
144
+ *
145
+ * @public
146
+ */
147
+ export declare const LOG_INSTANCE_CACHE: boolean;
148
+ /**
149
+ * Log key count metrics, useful for performance
150
+ * debugging.
151
+ *
152
+ * @public
153
+ */
154
+ export declare const LOG_METRIC_COUNTS: boolean;
155
+ /**
156
+ * Helps when debugging causes of a change notification
157
+ * when processing an update to a hasMany relationship.
158
+ *
159
+ * @public
160
+ */
161
+ export declare const DEBUG_RELATIONSHIP_NOTIFICATIONS: boolean;
162
+ /**
163
+ * A private flag to enable logging of the native Map/Set
164
+ * constructor and method calls.
165
+ *
166
+ * EXTREMELY MALPERFORMANT
167
+ *
168
+ * LOG_METRIC_COUNTS must also be enabled.
169
+ *
170
+ * @internal
171
+ */
172
+ export declare const __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS: boolean;
@@ -0,0 +1,30 @@
1
+ // ========================
2
+ // FOR CONTRIBUTING AUTHORS
3
+ //
4
+ // Deprecations here should also have guides PR'd to the emberjs deprecation app
5
+ //
6
+ // github: https://github.com/ember-learn/deprecation-app
7
+ // website: https://deprecations.emberjs.com
8
+ //
9
+ // Each deprecation should also be given an associated URL pointing to the
10
+ // relevant guide.
11
+ //
12
+ // URLs should be of the form: https://deprecations.emberjs.com/v<major>.x#toc_<fileName>
13
+ // where <major> is the major version of the deprecation and <fileName> is the
14
+ // name of the markdown file in the guides repo.
15
+ //
16
+ // ========================
17
+ //
18
+ export declare const DEPRECATE_CATCH_ALL = "99.0";
19
+ export declare const DEPRECATE_NON_STRICT_TYPES = "5.3";
20
+ export declare const DEPRECATE_NON_STRICT_ID = "5.3";
21
+ export declare const DEPRECATE_COMPUTED_CHAINS = "7.0";
22
+ export declare const DEPRECATE_LEGACY_IMPORTS = "5.3";
23
+ export declare const DEPRECATE_NON_UNIQUE_PAYLOADS = "5.3";
24
+ export declare const DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE = "5.3";
25
+ export declare const DEPRECATE_MANY_ARRAY_DUPLICATES = "5.3";
26
+ export declare const DEPRECATE_STORE_EXTENDS_EMBER_OBJECT = "5.4";
27
+ export declare const ENABLE_LEGACY_SCHEMA_SERVICE = "5.4";
28
+ export declare const DEPRECATE_EMBER_INFLECTOR = "5.3";
29
+ export declare const DISABLE_7X_DEPRECATIONS = "7.0";
30
+ export declare const DEPRECATE_TRACKING_PACKAGE = "5.5";