@ember-data/model 5.4.0-beta.1 → 5.4.0-beta.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 +19 -0
- package/addon-main.cjs +5 -0
- package/blueprints/model/index.js +18 -5
- package/blueprints/model-test/index.js +16 -10
- package/blueprints/model-test/qunit-files/__root__/__path__/__test__.js +4 -5
- package/{addon → dist}/-private.js +2 -2
- package/dist/has-many-78F2FHCC.js +674 -0
- package/dist/has-many-78F2FHCC.js.map +1 -0
- package/dist/hooks-BgrTI_ff.js +75 -0
- package/dist/hooks-BgrTI_ff.js.map +1 -0
- package/dist/hooks.js +2 -0
- package/{addon → dist}/hooks.js.map +1 -1
- package/dist/index.js +4 -0
- package/{addon → dist}/index.js.map +1 -1
- package/dist/migration-support.js +210 -0
- package/dist/migration-support.js.map +1 -0
- package/{addon/model-b638e17c.js → dist/model-BFnMMaye.js} +2968 -2350
- package/dist/model-BFnMMaye.js.map +1 -0
- package/dist/schema-provider-Cgpcwfn7.js +256 -0
- package/dist/schema-provider-Cgpcwfn7.js.map +1 -0
- package/ember-data-logo-dark.svg +12 -0
- package/ember-data-logo-light.svg +12 -0
- package/package.json +76 -50
- package/unstable-preview-types/-private/attr.d.ts +174 -0
- package/unstable-preview-types/-private/attr.d.ts.map +1 -0
- package/unstable-preview-types/-private/attr.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/attr.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/belongs-to.d.ts +180 -0
- package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +8 -0
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts.map +1 -0
- package/unstable-preview-types/-private/errors.d.ts +305 -0
- package/unstable-preview-types/-private/errors.d.ts.map +1 -0
- package/unstable-preview-types/-private/has-many.d.ts +169 -0
- package/unstable-preview-types/-private/has-many.d.ts.map +1 -0
- package/unstable-preview-types/-private/has-many.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/has-many.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/hooks.d.ts +13 -0
- package/unstable-preview-types/-private/hooks.d.ts.map +1 -0
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts +60 -0
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts.map +1 -0
- package/unstable-preview-types/-private/many-array.d.ts +196 -0
- package/unstable-preview-types/-private/many-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/model-for-mixin.d.ts +6 -0
- package/unstable-preview-types/-private/model-for-mixin.d.ts.map +1 -0
- package/unstable-preview-types/-private/model-methods.d.ts +37 -0
- package/unstable-preview-types/-private/model-methods.d.ts.map +1 -0
- package/unstable-preview-types/-private/model.d.ts +1306 -0
- package/unstable-preview-types/-private/model.d.ts.map +1 -0
- package/unstable-preview-types/-private/model.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/model.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/notify-changes.d.ts +8 -0
- package/unstable-preview-types/-private/notify-changes.d.ts.map +1 -0
- package/unstable-preview-types/-private/promise-belongs-to.d.ts +48 -0
- package/unstable-preview-types/-private/promise-belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/promise-many-array.d.ts +131 -0
- package/unstable-preview-types/-private/promise-many-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-state.d.ts +90 -0
- package/unstable-preview-types/-private/record-state.d.ts.map +1 -0
- package/unstable-preview-types/-private/references/belongs-to.d.ts +503 -0
- package/unstable-preview-types/-private/references/belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/references/has-many.d.ts +515 -0
- package/unstable-preview-types/-private/references/has-many.d.ts.map +1 -0
- package/unstable-preview-types/-private/schema-provider.d.ts +64 -0
- package/unstable-preview-types/-private/schema-provider.d.ts.map +1 -0
- package/unstable-preview-types/-private/type-utils.d.ts +64 -0
- package/unstable-preview-types/-private/type-utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/util.d.ts +11 -0
- package/unstable-preview-types/-private/util.d.ts.map +1 -0
- package/unstable-preview-types/-private.d.ts +13 -0
- package/unstable-preview-types/-private.d.ts.map +1 -0
- package/unstable-preview-types/hooks.d.ts +5 -0
- package/unstable-preview-types/hooks.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +76 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/migration-support.d.ts +56 -0
- package/unstable-preview-types/migration-support.d.ts.map +1 -0
- package/addon/has-many-774c4c4b.js +0 -507
- package/addon/has-many-774c4c4b.js.map +0 -1
- package/addon/hooks-6d5c2fc2.js +0 -157
- package/addon/hooks-6d5c2fc2.js.map +0 -1
- package/addon/hooks.js +0 -1
- package/addon/index.js +0 -3
- package/addon/model-b638e17c.js.map +0 -1
- package/addon-main.js +0 -93
- /package/{addon → dist}/-private.js.map +0 -0
package/README.md
CHANGED
|
@@ -15,6 +15,25 @@
|
|
|
15
15
|
/>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
+
<p align="center">Runtime Classes for use as a Schema Source and Resource Presentation for EmberData</p>
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Install using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)
|
|
23
|
+
|
|
24
|
+
```no-highlight
|
|
25
|
+
pnpm add @ember-data/model
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Tagged Releases**
|
|
29
|
+
|
|
30
|
+
- 
|
|
31
|
+
- 
|
|
32
|
+
- 
|
|
33
|
+
- 
|
|
34
|
+
- 
|
|
35
|
+
|
|
36
|
+
|
|
18
37
|
<p align="center">Provides a Presentation Model for resource data in an EmberData Cache</p>
|
|
19
38
|
|
|
20
39
|
This package implements the EmberData Store's `instantiateRecord` and `teardownRecord` hooks
|
package/addon-main.cjs
ADDED
|
@@ -1,17 +1,28 @@
|
|
|
1
|
+
const path = require('path');
|
|
1
2
|
const EOL = require('os').EOL;
|
|
2
3
|
|
|
4
|
+
const { has } = require('@ember/edition-utils');
|
|
5
|
+
|
|
3
6
|
const inflection = require('inflection');
|
|
4
7
|
const stringUtils = require('ember-cli-string-utils');
|
|
5
|
-
const useEditionDetector = require('@ember-data/private-build-infra/src/utilities/edition-detector');
|
|
6
|
-
const { has } = require('@ember/edition-utils');
|
|
7
8
|
|
|
8
|
-
module.exports =
|
|
9
|
-
description: 'Generates an ember-data
|
|
9
|
+
module.exports = {
|
|
10
|
+
description: 'Generates an ember-data Model.',
|
|
10
11
|
|
|
11
12
|
anonymousOptions: ['name', 'attr:type'],
|
|
12
13
|
|
|
13
14
|
root: __dirname,
|
|
14
15
|
|
|
16
|
+
filesPath() {
|
|
17
|
+
let hasOctane = has('octane');
|
|
18
|
+
if (hasOctane && process.env.EMBER_EDITION === 'classic') {
|
|
19
|
+
hasOctane = false; //forcible override
|
|
20
|
+
}
|
|
21
|
+
let rootPath = hasOctane ? 'native-files' : 'files';
|
|
22
|
+
return path.join(__dirname, rootPath);
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
|
|
15
26
|
locals(options) {
|
|
16
27
|
let attrs = [];
|
|
17
28
|
let needs = [];
|
|
@@ -109,7 +120,7 @@ module.exports = useEditionDetector({
|
|
|
109
120
|
needs,
|
|
110
121
|
};
|
|
111
122
|
},
|
|
112
|
-
}
|
|
123
|
+
}
|
|
113
124
|
|
|
114
125
|
function nativeAttr(attr) {
|
|
115
126
|
let name = attr.name,
|
|
@@ -148,3 +159,5 @@ function classicAttr(attr) {
|
|
|
148
159
|
}
|
|
149
160
|
return propertyName + ': ' + result;
|
|
150
161
|
}
|
|
162
|
+
|
|
163
|
+
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
|
|
3
3
|
const testInfo = require('ember-cli-test-info');
|
|
4
|
-
const
|
|
5
|
-
const modulePrefixForProject = require('@ember-data/private-build-infra/src/utilities/module-prefix-for-project');
|
|
4
|
+
const { dasherize } = require('ember-cli-string-utils');
|
|
6
5
|
|
|
7
6
|
const ModelBlueprint = require('../model');
|
|
8
7
|
|
|
9
|
-
module.exports =
|
|
10
|
-
description: 'Generates
|
|
8
|
+
module.exports = {
|
|
9
|
+
description: 'Generates an EmberData Model unit test',
|
|
10
|
+
supportsAddon() { return false; },
|
|
11
11
|
|
|
12
12
|
root: __dirname,
|
|
13
13
|
|
|
14
|
-
fileMapTokens(
|
|
14
|
+
fileMapTokens() {
|
|
15
15
|
return {
|
|
16
16
|
__root__() {
|
|
17
17
|
return 'tests';
|
|
@@ -24,10 +24,16 @@ module.exports = useTestFrameworkDetector({
|
|
|
24
24
|
|
|
25
25
|
locals(options) {
|
|
26
26
|
const result = ModelBlueprint.locals.apply(this, arguments);
|
|
27
|
+
const modulePrefix = dasherize(options.project.config().modulePrefix);
|
|
28
|
+
return {
|
|
29
|
+
...result,
|
|
30
|
+
friendlyTestDescription: testInfo.description(options.entity.name, 'Unit', 'Model'),
|
|
31
|
+
modulePrefix,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
filesPath() {
|
|
36
|
+
return path.join(__dirname, 'qunit-files')
|
|
37
|
+
}
|
|
38
|
+
};
|
|
30
39
|
|
|
31
|
-
return result;
|
|
32
|
-
},
|
|
33
|
-
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { module, test } from 'qunit';
|
|
2
|
-
|
|
3
1
|
import { setupTest } from '<%= modulePrefix %>/tests/helpers';
|
|
2
|
+
import { module, test } from 'qunit';
|
|
4
3
|
|
|
5
4
|
module('<%= friendlyTestDescription %>', function (hooks) {
|
|
6
5
|
setupTest(hooks);
|
|
7
6
|
|
|
8
7
|
// Replace this with your real tests.
|
|
9
8
|
test('it exists', function (assert) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
assert.ok(model);
|
|
9
|
+
const store = this.owner.lookup('service:store');
|
|
10
|
+
const model = store.createRecord('<%= dasherizedModuleName %>', {});
|
|
11
|
+
assert.ok(model, 'model exists');
|
|
13
12
|
});
|
|
14
13
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as attr, b as belongsTo, h as hasMany } from "./has-many-
|
|
2
|
-
export { E as Errors, L as LEGACY_SUPPORT, R as ManyArray, M as Model, P as PromiseBelongsTo, a as PromiseManyArray } from "./model-
|
|
1
|
+
export { a as attr, b as belongsTo, h as hasMany } from "./has-many-78F2FHCC.js";
|
|
2
|
+
export { E as Errors, L as LEGACY_SUPPORT, R as ManyArray, M as Model, P as PromiseBelongsTo, a as PromiseManyArray, l as lookupLegacySupport } from "./model-BFnMMaye.js";
|