@warp-drive/legacy 5.9.0-alpha.0 → 5.9.0-alpha.10

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/README.md CHANGED
@@ -26,6 +26,12 @@ Decommissioned Features from <em>Warp</em><strong>Drive</strong> that your App m
26
26
 
27
27
  <br>
28
28
 
29
+ > [!WARNING]
30
+ > This package provides support for older ***Warp*Drive** features that have been
31
+ > deprecated and removed from [@warp-drive/core](https://canary.warp-drive.io/api/@warp-drive/core/).
32
+ >
33
+ > **Projects using these features should refactor away from them with urgency**
34
+
29
35
  ## Documentation
30
36
 
31
37
  *Get Started* → [Guides](https://docs.warp-drive.io)
@@ -118,7 +118,7 @@ Endpoint paths can be prefixed with a `namespace` by setting the
118
118
  namespace property on the adapter:
119
119
 
120
120
  ```js [app/adapters/application.js]
121
- import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
121
+ import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';
122
122
 
123
123
  export default class ApplicationAdapter extends JSONAPIAdapter {
124
124
  namespace = 'api/1';
@@ -3,12 +3,23 @@
3
3
  * schema and add extensions etc.
4
4
  *
5
5
  * @param arrayName The name of the array
6
+ * @param primitiveType The primitive type of items in the array (optional)
6
7
  * @returns The schema for an array
7
8
  */
8
- export declare function withArrayDefaults<ArrayName extends string>(arrayName: ArrayName): {
9
+ export declare function withArrayDefaults<
10
+ ArrayName extends string,
11
+ PrimitiveType extends string
12
+ >(arrayName: ArrayName, primitiveType?: PrimitiveType): PrimitiveType extends undefined ? {
9
13
  kind: "array";
10
14
  name: ArrayName;
11
- type: `array:${string}`;
15
+ type: "array";
16
+ options: {
17
+ arrayExtensions: string[];
18
+ };
19
+ } : {
20
+ kind: "array";
21
+ name: ArrayName;
22
+ type: `array:${PrimitiveType}`;
12
23
  options: {
13
24
  arrayExtensions: string[];
14
25
  };
@@ -93,7 +93,7 @@ below shows how this could be done using `normalizeArrayResponse` and
93
93
  `extractRelationship`.
94
94
 
95
95
  ```js [app/serializers/application.js]
96
- import JSONAPISerializer from '@warp-drive/legacy/serializer/json-api';
96
+ import { JSONAPISerializer } from '@warp-drive/legacy/serializer/json-api';
97
97
 
98
98
  export default class ApplicationSerializer extends JSONAPISerializer {
99
99
  normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
@@ -1,4 +1,4 @@
1
- import { singularize, pluralize } from '@warp-drive/utilities/string';
1
+ import { pluralize, singularize } from '@warp-drive/utilities/string';
2
2
  import { withDefaults } from './model/migration-support.js';
3
3
  import { F as FragmentExtension, a as FragmentArrayExtension } from "./model-for-CqXsIKws.js";
4
4
  export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-CqXsIKws.js";
@@ -8,13 +8,16 @@ export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-Cq
8
8
  * schema and add extensions etc.
9
9
  *
10
10
  * @param arrayName The name of the array
11
+ * @param primitiveType The primitive type of items in the array (optional)
11
12
  * @returns The schema for an array
12
13
  */
13
- function withArrayDefaults(arrayName) {
14
+
15
+ function withArrayDefaults(arrayName, primitiveType) {
16
+ const type = primitiveType ? `array:${primitiveType}` : 'array';
14
17
  return {
15
18
  kind: 'array',
16
19
  name: arrayName,
17
- type: `array:${singularize(arrayName)}`,
20
+ type,
18
21
  options: {
19
22
  arrayExtensions: ['ember-object', 'ember-array-like', 'fragment-array']
20
23
  }
@@ -117,7 +117,7 @@ import { RESTAdapter } from './rest.js';
117
117
  namespace property on the adapter:
118
118
 
119
119
  ```js [app/adapters/application.js]
120
- import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
120
+ import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';
121
121
 
122
122
  export default class ApplicationAdapter extends JSONAPIAdapter {
123
123
  namespace = 'api/1';
@@ -1,4 +1,4 @@
1
- import { singularize, pluralize } from '@warp-drive/utilities/string';
1
+ import { pluralize, singularize } from '@warp-drive/utilities/string';
2
2
  import { withDefaults } from './model/migration-support.js';
3
3
  import { F as FragmentExtension, a as FragmentArrayExtension } from "./model-for-CqXsIKws.js";
4
4
  export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-CqXsIKws.js";
@@ -8,13 +8,16 @@ export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-Cq
8
8
  * schema and add extensions etc.
9
9
  *
10
10
  * @param arrayName The name of the array
11
+ * @param primitiveType The primitive type of items in the array (optional)
11
12
  * @returns The schema for an array
12
13
  */
13
- function withArrayDefaults(arrayName) {
14
+
15
+ function withArrayDefaults(arrayName, primitiveType) {
16
+ const type = primitiveType ? `array:${primitiveType}` : 'array';
14
17
  return {
15
18
  kind: 'array',
16
19
  name: arrayName,
17
- type: `array:${singularize(arrayName)}`,
20
+ type,
18
21
  options: {
19
22
  arrayExtensions: ['ember-object', 'ember-array-like', 'fragment-array']
20
23
  }
@@ -102,7 +102,7 @@ import { J as JSONSerializer } from "../json-Cu1LNgmQ.js";
102
102
  `extractRelationship`.
103
103
 
104
104
  ```js [app/serializers/application.js]
105
- import JSONAPISerializer from '@warp-drive/legacy/serializer/json-api';
105
+ import { JSONAPISerializer } from '@warp-drive/legacy/serializer/json-api';
106
106
 
107
107
  export default class ApplicationSerializer extends JSONAPISerializer {
108
108
  normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
@@ -117,7 +117,7 @@ import { RESTAdapter } from './rest.js';
117
117
  namespace property on the adapter:
118
118
 
119
119
  ```js [app/adapters/application.js]
120
- import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
120
+ import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';
121
121
 
122
122
  export default class ApplicationAdapter extends JSONAPIAdapter {
123
123
  namespace = 'api/1';
@@ -1,4 +1,4 @@
1
- import { singularize, pluralize } from '@warp-drive/utilities/string';
1
+ import { pluralize, singularize } from '@warp-drive/utilities/string';
2
2
  import { withDefaults } from './model/migration-support.js';
3
3
  import { F as FragmentExtension, a as FragmentArrayExtension } from "./model-for-CqXsIKws.js";
4
4
  export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-CqXsIKws.js";
@@ -8,13 +8,16 @@ export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-Cq
8
8
  * schema and add extensions etc.
9
9
  *
10
10
  * @param arrayName The name of the array
11
+ * @param primitiveType The primitive type of items in the array (optional)
11
12
  * @returns The schema for an array
12
13
  */
13
- function withArrayDefaults(arrayName) {
14
+
15
+ function withArrayDefaults(arrayName, primitiveType) {
16
+ const type = primitiveType ? `array:${primitiveType}` : 'array';
14
17
  return {
15
18
  kind: 'array',
16
19
  name: arrayName,
17
- type: `array:${singularize(arrayName)}`,
20
+ type,
18
21
  options: {
19
22
  arrayExtensions: ['ember-object', 'ember-array-like', 'fragment-array']
20
23
  }
@@ -102,7 +102,7 @@ import { J as JSONSerializer } from "../json-Cu1LNgmQ.js";
102
102
  `extractRelationship`.
103
103
 
104
104
  ```js [app/serializers/application.js]
105
- import JSONAPISerializer from '@warp-drive/legacy/serializer/json-api';
105
+ import { JSONAPISerializer } from '@warp-drive/legacy/serializer/json-api';
106
106
 
107
107
  export default class ApplicationSerializer extends JSONAPISerializer {
108
108
  normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
@@ -117,7 +117,7 @@ import { RESTAdapter } from './rest.js';
117
117
  namespace property on the adapter:
118
118
 
119
119
  ```js [app/adapters/application.js]
120
- import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
120
+ import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';
121
121
 
122
122
  export default class ApplicationAdapter extends JSONAPIAdapter {
123
123
  namespace = 'api/1';
@@ -1,4 +1,4 @@
1
- import { singularize, pluralize } from '@warp-drive/utilities/string';
1
+ import { pluralize, singularize } from '@warp-drive/utilities/string';
2
2
  import { withDefaults } from './model/migration-support.js';
3
3
  import { F as FragmentExtension, a as FragmentArrayExtension } from "./model-for-CqXsIKws.js";
4
4
  export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-CqXsIKws.js";
@@ -8,13 +8,16 @@ export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-Cq
8
8
  * schema and add extensions etc.
9
9
  *
10
10
  * @param arrayName The name of the array
11
+ * @param primitiveType The primitive type of items in the array (optional)
11
12
  * @returns The schema for an array
12
13
  */
13
- function withArrayDefaults(arrayName) {
14
+
15
+ function withArrayDefaults(arrayName, primitiveType) {
16
+ const type = primitiveType ? `array:${primitiveType}` : 'array';
14
17
  return {
15
18
  kind: 'array',
16
19
  name: arrayName,
17
- type: `array:${singularize(arrayName)}`,
20
+ type,
18
21
  options: {
19
22
  arrayExtensions: ['ember-object', 'ember-array-like', 'fragment-array']
20
23
  }
@@ -102,7 +102,7 @@ import { J as JSONSerializer } from "../json-BWrZ5546.js";
102
102
  `extractRelationship`.
103
103
 
104
104
  ```js [app/serializers/application.js]
105
- import JSONAPISerializer from '@warp-drive/legacy/serializer/json-api';
105
+ import { JSONAPISerializer } from '@warp-drive/legacy/serializer/json-api';
106
106
 
107
107
  export default class ApplicationSerializer extends JSONAPISerializer {
108
108
  normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
@@ -117,7 +117,7 @@ import { RESTAdapter } from './rest.js';
117
117
  namespace property on the adapter:
118
118
 
119
119
  ```js [app/adapters/application.js]
120
- import JSONAPIAdapter from '@warp-drive/legacy/adapter/json-api';
120
+ import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';
121
121
 
122
122
  export default class ApplicationAdapter extends JSONAPIAdapter {
123
123
  namespace = 'api/1';
@@ -1,4 +1,4 @@
1
- import { singularize, pluralize } from '@warp-drive/utilities/string';
1
+ import { pluralize, singularize } from '@warp-drive/utilities/string';
2
2
  import { withDefaults } from './model/migration-support.js';
3
3
  import { F as FragmentExtension, a as FragmentArrayExtension } from "./model-for-CqXsIKws.js";
4
4
  export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-CqXsIKws.js";
@@ -8,13 +8,16 @@ export { c as Fragment, b as FragmentArray, m as modelFor } from "./model-for-Cq
8
8
  * schema and add extensions etc.
9
9
  *
10
10
  * @param arrayName The name of the array
11
+ * @param primitiveType The primitive type of items in the array (optional)
11
12
  * @returns The schema for an array
12
13
  */
13
- function withArrayDefaults(arrayName) {
14
+
15
+ function withArrayDefaults(arrayName, primitiveType) {
16
+ const type = primitiveType ? `array:${primitiveType}` : 'array';
14
17
  return {
15
18
  kind: 'array',
16
19
  name: arrayName,
17
- type: `array:${singularize(arrayName)}`,
20
+ type,
18
21
  options: {
19
22
  arrayExtensions: ['ember-object', 'ember-array-like', 'fragment-array']
20
23
  }
@@ -102,7 +102,7 @@ import { J as JSONSerializer } from "../json-BWrZ5546.js";
102
102
  `extractRelationship`.
103
103
 
104
104
  ```js [app/serializers/application.js]
105
- import JSONAPISerializer from '@warp-drive/legacy/serializer/json-api';
105
+ import { JSONAPISerializer } from '@warp-drive/legacy/serializer/json-api';
106
106
 
107
107
  export default class ApplicationSerializer extends JSONAPISerializer {
108
108
  normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive/legacy",
3
- "version": "5.9.0-alpha.0",
3
+ "version": "5.9.0-alpha.10",
4
4
  "description": "Decommissioned Packages for WarpDrive | Things your app might still want to maintain use of for a little longer.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -40,25 +40,25 @@
40
40
  }
41
41
  },
42
42
  "peerDependencies": {
43
- "@warp-drive/core": "5.9.0-alpha.0",
44
- "@warp-drive/utilities": "5.9.0-alpha.0"
43
+ "@warp-drive/core": "5.9.0-alpha.10",
44
+ "@warp-drive/utilities": "5.9.0-alpha.10"
45
45
  },
46
46
  "dependencies": {
47
- "@embroider/macros": "^1.18.1"
47
+ "@embroider/macros": "^1.19.6"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/core": "^7.28.3",
51
51
  "@babel/plugin-transform-typescript": "^7.28.0",
52
52
  "@babel/preset-typescript": "^7.27.1",
53
53
  "@types/jquery": "^3.5.33",
54
- "@warp-drive/internal-config": "5.9.0-alpha.0",
55
- "@warp-drive/core": "5.9.0-alpha.0",
56
- "@warp-drive/utilities": "5.9.0-alpha.0",
57
- "ember-source": "~6.6.0",
54
+ "@warp-drive/internal-config": "5.9.0-alpha.10",
55
+ "@warp-drive/core": "5.9.0-alpha.10",
56
+ "@warp-drive/utilities": "5.9.0-alpha.10",
57
+ "ember-source": "~6.10.0",
58
58
  "decorator-transforms": "^2.3.0",
59
59
  "expect-type": "^1.2.2",
60
- "typescript": "^5.9.2",
61
- "vite": "^7.1.3"
60
+ "typescript": "^5.9.3",
61
+ "vite": "^7.3.1"
62
62
  },
63
63
  "volta": {
64
64
  "extends": "../../package.json"
@@ -72,7 +72,7 @@
72
72
  "edition": "octane"
73
73
  },
74
74
  "scripts": {
75
- "build:pkg": "vite build;",
75
+ "build:pkg": "vite build",
76
76
  "lint": "eslint . --quiet --cache --cache-strategy=content",
77
77
  "sync": "echo \"syncing\"",
78
78
  "start": "vite"