@warp-drive/build-config 0.0.0-alpha.7

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 (60) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +9 -0
  3. package/NCC-1701-a-blue.svg +4 -0
  4. package/NCC-1701-a.svg +4 -0
  5. package/README.md +101 -0
  6. package/dist/addon-shim.cjs +30 -0
  7. package/dist/addon-shim.cjs.map +1 -0
  8. package/dist/babel-macros.js +46 -0
  9. package/dist/babel-macros.js.map +1 -0
  10. package/dist/babel-plugin-transform-asserts.cjs +99 -0
  11. package/dist/babel-plugin-transform-asserts.cjs.map +1 -0
  12. package/dist/babel-plugin-transform-deprecations.cjs +59 -0
  13. package/dist/babel-plugin-transform-deprecations.cjs.map +1 -0
  14. package/dist/babel-plugin-transform-features.cjs +69 -0
  15. package/dist/babel-plugin-transform-features.cjs.map +1 -0
  16. package/dist/babel-plugin-transform-logging.cjs +60 -0
  17. package/dist/babel-plugin-transform-logging.cjs.map +1 -0
  18. package/dist/canary-features-BzGSGY5j.js +97 -0
  19. package/dist/canary-features-BzGSGY5j.js.map +1 -0
  20. package/dist/canary-features.js +2 -0
  21. package/dist/canary-features.js.map +1 -0
  22. package/dist/debugging-BzogyWJo.js +121 -0
  23. package/dist/debugging-BzogyWJo.js.map +1 -0
  24. package/dist/debugging.js +2 -0
  25. package/dist/debugging.js.map +1 -0
  26. package/dist/deprecations-BXAnWRDO.js +28 -0
  27. package/dist/deprecations-BXAnWRDO.js.map +1 -0
  28. package/dist/deprecations.js +2 -0
  29. package/dist/deprecations.js.map +1 -0
  30. package/dist/env.js +6 -0
  31. package/dist/env.js.map +1 -0
  32. package/dist/index.js +578 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/macros.js +8 -0
  35. package/dist/macros.js.map +1 -0
  36. package/package.json +66 -0
  37. package/unstable-preview-types/-private/utils/deprecations.d.ts +10 -0
  38. package/unstable-preview-types/-private/utils/deprecations.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/utils/features.d.ts +9 -0
  40. package/unstable-preview-types/-private/utils/features.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/utils/get-env.d.ts +8 -0
  42. package/unstable-preview-types/-private/utils/get-env.d.ts.map +1 -0
  43. package/unstable-preview-types/babel-macros.d.ts +24 -0
  44. package/unstable-preview-types/babel-macros.d.ts.map +1 -0
  45. package/unstable-preview-types/canary-features.d.ts +92 -0
  46. package/unstable-preview-types/canary-features.d.ts.map +1 -0
  47. package/unstable-preview-types/debugging.d.ts +108 -0
  48. package/unstable-preview-types/debugging.d.ts.map +1 -0
  49. package/unstable-preview-types/deprecation-versions.d.ts +400 -0
  50. package/unstable-preview-types/deprecation-versions.d.ts.map +1 -0
  51. package/unstable-preview-types/deprecations.d.ts +13 -0
  52. package/unstable-preview-types/deprecations.d.ts.map +1 -0
  53. package/unstable-preview-types/env.d.ts +6 -0
  54. package/unstable-preview-types/env.d.ts.map +1 -0
  55. package/unstable-preview-types/index.d.ts +43 -0
  56. package/unstable-preview-types/index.d.ts.map +1 -0
  57. package/unstable-preview-types/macros.d.ts +5 -0
  58. package/unstable-preview-types/macros.d.ts.map +1 -0
  59. package/unstable-preview-types/validate-exports.type-test.d.ts +4 -0
  60. package/unstable-preview-types/validate-exports.type-test.d.ts.map +1 -0
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@warp-drive/build-config",
3
+ "version": "0.0.0-alpha.7",
4
+ "description": "Provides Build Configuration for projects using WarpDrive or EmberData",
5
+ "keywords": [
6
+ "ember-data",
7
+ "warp-drive"
8
+ ],
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+ssh://git@github.com:emberjs/data.git",
12
+ "directory": "packages/build-config"
13
+ },
14
+ "license": "MIT",
15
+ "author": "Chris Thoburn <runspired@users.noreply.github.com>",
16
+ "scripts": {
17
+ "build:infra": "vite build; vite build -c ./vite.config-cjs.mjs;"
18
+ },
19
+ "type": "module",
20
+ "files": [
21
+ "dist",
22
+ "unstable-preview-types",
23
+ "CHANGELOG.md",
24
+ "README.md",
25
+ "LICENSE.md",
26
+ "NCC-1701-a.svg",
27
+ "NCC-1701-a-blue.svg"
28
+ ],
29
+ "exports": {
30
+ ".": {
31
+ "default": "./dist/index.js"
32
+ },
33
+ "./*.cjs": {
34
+ "default": "./dist/*.cjs"
35
+ },
36
+ "./*": {
37
+ "default": "./dist/*.js"
38
+ }
39
+ },
40
+ "dependencies": {
41
+ "@embroider/macros": "^1.16.1",
42
+ "@embroider/addon-shim": "^1.8.8",
43
+ "babel-import-util": "^2.1.1",
44
+ "broccoli-funnel": "^3.0.8",
45
+ "semver": "^7.6.2"
46
+ },
47
+ "devDependencies": {
48
+ "@warp-drive/internal-config": "5.4.0-alpha.70",
49
+ "@types/babel__core": "^7.20.5",
50
+ "@types/node": "^20.12.12",
51
+ "@babel/plugin-transform-typescript": "^7.24.5",
52
+ "@babel/preset-typescript": "^7.24.1",
53
+ "@babel/core": "^7.24.5",
54
+ "pnpm-sync-dependencies-meta-injected": "0.0.14",
55
+ "typescript": "^5.4.5",
56
+ "bun-types": "^1.1.8",
57
+ "vite": "^5.2.11"
58
+ },
59
+ "engines": {
60
+ "node": ">= 22.1.0"
61
+ },
62
+ "volta": {
63
+ "extends": "../../package.json"
64
+ },
65
+ "packageManager": "pnpm@8.15.8"
66
+ }
@@ -0,0 +1,10 @@
1
+ declare module '@warp-drive/build-config/-private/utils/deprecations' {
2
+ import * as CURRENT_DEPRECATIONS from '@warp-drive/build-config/deprecation-versions.ts';
3
+ type MajorMinor = `${number}.${number}`;
4
+ type DeprecationFlag = keyof typeof CURRENT_DEPRECATIONS;
5
+ export function getDeprecations(compatVersion: MajorMinor | null | undefined): {
6
+ [key in DeprecationFlag]: boolean;
7
+ };
8
+ export {};
9
+ }
10
+ //# sourceMappingURL=deprecations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecations.d.ts","sourceRoot":"","sources":["../../../src/-private/utils/deprecations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,+BAA+B,CAAC;AACtE,KAAK,UAAU,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AACxC,KAAK,eAAe,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAMzD,wBAAgB,eAAe,CAAC,aAAa,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG;KAAG,GAAG,IAAI,eAAe,GAAG,OAAO;CAAE,CA4BnH"}
@@ -0,0 +1,9 @@
1
+ declare module '@warp-drive/build-config/-private/utils/features' {
2
+ import * as CURRENT_FEATURES from '@warp-drive/build-config/canary-features.ts';
3
+ type FEATURE = keyof typeof CURRENT_FEATURES;
4
+ export function getFeatures(isProd: boolean): {
5
+ [key in FEATURE]: boolean;
6
+ };
7
+ export {};
8
+ }
9
+ //# sourceMappingURL=features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../src/-private/utils/features.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAC7D,KAAK,OAAO,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAK7C,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG;KAAG,GAAG,IAAI,OAAO,GAAG,OAAO;CAAE,CA0D1E"}
@@ -0,0 +1,8 @@
1
+ declare module '@warp-drive/build-config/-private/utils/get-env' {
2
+ export function getEnv(): {
3
+ TESTING: boolean;
4
+ PRODUCTION: boolean;
5
+ DEBUG: boolean;
6
+ };
7
+ }
8
+ //# sourceMappingURL=get-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-env.d.ts","sourceRoot":"","sources":["../../../src/-private/utils/get-env.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM;;;;EAWrB"}
@@ -0,0 +1,24 @@
1
+ declare module '@warp-drive/build-config/babel-macros' {
2
+ import * as LOGGING from '@warp-drive/build-config/debugging.ts';
3
+ import * as CURRENT_DEPRECATIONS from '@warp-drive/build-config/deprecations.ts';
4
+ export function macros(): ({}[] | (string | {
5
+ source: string;
6
+ flags: Record<"SAMPLE_FEATURE_FLAG", boolean>;
7
+ })[] | (string | {
8
+ source: string;
9
+ flags: typeof CURRENT_DEPRECATIONS;
10
+ })[] | (string | {
11
+ source: string;
12
+ configKey: string;
13
+ flags: typeof LOGGING;
14
+ })[] | (string | {
15
+ source: string;
16
+ configKey: string;
17
+ flags: {
18
+ TESTING: boolean;
19
+ PRODUCTION: boolean;
20
+ DEBUG: boolean;
21
+ };
22
+ })[])[];
23
+ }
24
+ //# sourceMappingURL=babel-macros.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"babel-macros.d.ts","sourceRoot":"","sources":["../src/babel-macros.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,oBAAoB,MAAM,mBAAmB,CAAC;AAkB1D,wBAAgB,MAAM;;;;;;;;;;;;;;;;;;QAiDrB"}
@@ -0,0 +1,92 @@
1
+ declare module '@warp-drive/build-config/canary-features' {
2
+ /**
3
+ * ## Canary Features
4
+ *
5
+ * EmberData allows users to test features that are implemented but not yet
6
+ * available even in canary.
7
+ *
8
+ * Typically these features represent work that might introduce a new concept,
9
+ * new API, change an API, or risk an unintended change in behavior to consuming
10
+ * applications.
11
+ *
12
+ * Such features have their implementations guarded by a "feature flag", and the
13
+ * flag is only activated once the core-data team is prepared to ship the work
14
+ * in a canary release.
15
+ *
16
+ * ### Installing Canary
17
+ *
18
+ * To test a feature you MUST be using a canary build. Canary builds are published
19
+ * to `npm` and can be installed using a precise tag (such as `ember-data@3.16.0-alpha.1`)
20
+ * or by installing the latest dist-tag published to the `canary` channel using your javascript
21
+ * package manager of choice. For instance with [pnpm](https://pnpm.io/)
22
+
23
+ ```cli
24
+ pnpm add ember-data@canary
25
+ ```
26
+ *
27
+ * ### Activating a Canary Feature
28
+ *
29
+ * Once you have installed canary, feature-flags can be activated at build-time
30
+ *
31
+ * by setting an environment variable:
32
+ *
33
+ * ```cli
34
+ * # Activate a single flag
35
+ * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG ember build
36
+ *
37
+ * # Activate multiple flags by separating with commas
38
+ * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build
39
+ *
40
+ * # Activate all flags
41
+ * EMBER_DATA_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
42
+ * ```
43
+ *
44
+ * or by setting the appropriate flag in your `ember-cli-build` file:
45
+ *
46
+ * ```ts
47
+ * let app = new EmberApp(defaults, {
48
+ * emberData: {
49
+ * features: {
50
+ * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature
51
+ * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior
52
+ * }
53
+ * }
54
+ * })
55
+ * ```
56
+ *
57
+ * **The "off" branch of feature-flagged code is always stripped from production builds.**
58
+ *
59
+ * 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")
60
+ *
61
+ *
62
+ * ### Preparing a Project to use a Canary Feature
63
+ *
64
+ * For most projects, simple version detection should be enough.
65
+ * Using the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)
66
+ * the following can be done:
67
+ *
68
+ * ```js
69
+ * if (macroCondition(dependencySatisfies('@ember-data/store', '5.0'))) {
70
+ * // do thing
71
+ * }
72
+ * ```
73
+ *
74
+ @module @warp-drive/build-config/canary-features
75
+ @main @warp-drive/build-config/canary-features
76
+ */
77
+ /**
78
+ This is the current list of features used at build time for canary releases.
79
+ If empty there are no features currently gated by feature flags.
80
+
81
+ The valid values are:
82
+
83
+ - `true` | The feature is **enabled** at all times, and cannot be disabled.
84
+ - `false` | The feature is **disabled** at all times, and cannot be enabled.
85
+ - `null` | The feature is **disabled by default**, but can be enabled via configuration.
86
+
87
+ @class CanaryFeatureFlags
88
+ @public
89
+ */
90
+ export const SAMPLE_FEATURE_FLAG: boolean | null;
91
+ }
92
+ //# sourceMappingURL=canary-features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canary-features.d.ts","sourceRoot":"","sources":["../src/canary-features.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH;;;;;;;;;;;;EAYE;AACF,eAAO,MAAM,mBAAmB,EAAE,OAAO,GAAG,IAAW,CAAC"}
@@ -0,0 +1,108 @@
1
+ declare module '@warp-drive/build-config/debugging' {
2
+ /**
3
+ * ## Debugging
4
+ *
5
+ * Many portions of the internals are helpfully instrumented with logging that can be activated
6
+ * at build time. This instrumentation is always removed from production builds or any builds
7
+ * that has not explicitly activated it. To activate it set the appropriate flag to `true`.
8
+ *
9
+ @module @warp-drive/build-config/debugging
10
+ @main @warp-drive/build-config/debugging
11
+ */
12
+ /**
13
+ *
14
+ * Many portions of the internals are helpfully instrumented with logging that can be activated
15
+ at build time. This instrumentation is always removed from production builds or any builds
16
+ that has not explicitly activated it. To activate it set the appropriate flag to `true`.
17
+
18
+ ```ts
19
+ let app = new EmberApp(defaults, {
20
+ emberData: {
21
+ debug: {
22
+ LOG_PAYLOADS: false, // data store received to update cache with
23
+ LOG_OPERATIONS: false, // updates to cache remote state
24
+ LOG_MUTATIONS: false, // updates to cache local state
25
+ LOG_NOTIFICATIONS: false,
26
+ LOG_REQUESTS: false,
27
+ LOG_REQUEST_STATUS: false,
28
+ LOG_IDENTIFIERS: false,
29
+ LOG_GRAPH: false,
30
+ LOG_INSTANCE_CACHE: false,
31
+ }
32
+ }
33
+ });
34
+ ```
35
+
36
+ @class DebugLogging
37
+ @public
38
+ */
39
+ /**
40
+ * log payloads received by the store
41
+ * via `push` or returned from a delete/update/create
42
+ * operation.
43
+ *
44
+ * @property {boolean} LOG_PAYLOADS
45
+ * @public
46
+ */
47
+ export const LOG_PAYLOADS: boolean;
48
+ /**
49
+ * log remote-state updates to the cache
50
+ *
51
+ * @property {boolean} LOG_OPERATIONS
52
+ * @public
53
+ */
54
+ export const LOG_OPERATIONS: boolean;
55
+ /**
56
+ * log local-state updates to the cache
57
+ *
58
+ * @property {boolean} LOG_MUTATIONS
59
+ * @public
60
+ */
61
+ export const LOG_MUTATIONS: boolean;
62
+ /**
63
+ * log notifications received by the NotificationManager
64
+ *
65
+ * @property {boolean} LOG_NOTIFICATIONS
66
+ * @public
67
+ */
68
+ export const LOG_NOTIFICATIONS: boolean;
69
+ /**
70
+ * log requests issued by the RequestManager
71
+ *
72
+ * @property {boolean} LOG_REQUESTS
73
+ * @public
74
+ */
75
+ export const LOG_REQUESTS: boolean;
76
+ /**
77
+ * log updates to requests the store has issued to
78
+ * the network (adapter) to fulfill.
79
+ *
80
+ * @property {boolean} LOG_REQUEST_STATUS
81
+ * @public
82
+ */
83
+ export const LOG_REQUEST_STATUS: boolean;
84
+ /**
85
+ * log peek, generation and updates to
86
+ * Record Identifiers.
87
+ *
88
+ * @property {boolean} LOG_IDENTIFIERS
89
+ * @public
90
+ */
91
+ export const LOG_IDENTIFIERS: boolean;
92
+ /**
93
+ * log updates received by the graph (relationship pointer storage)
94
+ *
95
+ * @property {boolean} LOG_GRAPH
96
+ * @public
97
+ */
98
+ export const LOG_GRAPH: boolean;
99
+ /**
100
+ * log creation/removal of RecordData and Record
101
+ * instances.
102
+ *
103
+ * @property {boolean} LOG_INSTANCE_CACHE
104
+ * @public
105
+ */
106
+ export const LOG_INSTANCE_CACHE: boolean;
107
+ }
108
+ //# sourceMappingURL=debugging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugging.d.ts","sourceRoot":"","sources":["../src/debugging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,OAAe,CAAC;AAC3C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,OAAe,CAAC;AAC7C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,OAAe,CAAC;AAC5C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAe,CAAC;AAChD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,OAAe,CAAC;AAC3C;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAe,CAAC;AACjD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,OAAe,CAAC;AAC9C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,OAAe,CAAC;AACxC;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAe,CAAC"}