@ember-data/serializer 4.12.0-alpha.19 → 4.12.0-alpha.20

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.
@@ -0,0 +1,4 @@
1
+ <%= importStatement %>
2
+
3
+ export default <%= baseClass %>.extend({
4
+ });
@@ -0,0 +1,14 @@
1
+ const extendFromApplicationEntity = require('@ember-data/private-build-infra/src/utilities/extend-from-application-entity');
2
+ const useEditionDetector = require('@ember-data/private-build-infra/src/utilities/edition-detector');
3
+
4
+ module.exports = useEditionDetector({
5
+ description: 'Generates an ember-data serializer.',
6
+
7
+ availableOptions: [{ name: 'base-class', type: String }],
8
+
9
+ root: __dirname,
10
+
11
+ locals(options) {
12
+ return extendFromApplicationEntity('serializer', 'JSONAPISerializer', options);
13
+ },
14
+ });
@@ -0,0 +1,4 @@
1
+ <%= importStatement %>
2
+
3
+ export default class <%= classifiedModuleName %>Serializer extends <%= baseClass %> {
4
+ }
@@ -0,0 +1,29 @@
1
+ const path = require('path');
2
+
3
+ const testInfo = require('ember-cli-test-info');
4
+ const useTestFrameworkDetector = require('@ember-data/private-build-infra/src/utilities/test-framework-detector');
5
+ const modulePrefixForProject = require('@ember-data/private-build-infra/src/utilities/module-prefix-for-project');
6
+
7
+ module.exports = useTestFrameworkDetector({
8
+ description: 'Generates a serializer unit test.',
9
+
10
+ root: __dirname,
11
+
12
+ fileMapTokens(options) {
13
+ return {
14
+ __root__() {
15
+ return 'tests';
16
+ },
17
+ __path__() {
18
+ return path.join('unit', 'serializers');
19
+ },
20
+ };
21
+ },
22
+
23
+ locals(options) {
24
+ return {
25
+ friendlyTestDescription: testInfo.description(options.entity.name, 'Unit', 'Serializer'),
26
+ modulePrefix: modulePrefixForProject(options.project),
27
+ };
28
+ },
29
+ });
@@ -0,0 +1,20 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+
4
+ import { setupModelTest } from 'ember-mocha';
5
+
6
+ describe('<%= friendlyTestDescription %>', function () {
7
+ setupModelTest('<%= dasherizedModuleName %>', {
8
+ // Specify the other units that are required for this test.
9
+ needs: ['serializer:<%= dasherizedModuleName %>'],
10
+ });
11
+
12
+ // Replace this with your real tests.
13
+ it('serializes records', function () {
14
+ let record = this.subject();
15
+
16
+ let serializedRecord = record.serialize();
17
+
18
+ expect(serializedRecord).to.be.ok;
19
+ });
20
+ });
@@ -0,0 +1,25 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+
4
+ import { setupTest } from '<%= modulePrefix %>/tests/helpers';
5
+
6
+ describe('<%= friendlyTestDescription %>', function () {
7
+ setupTest();
8
+
9
+ // Replace this with your real tests.
10
+ it('exists', function () {
11
+ let store = this.owner.lookup('service:store');
12
+ let serializer = store.serializerFor('<%= dasherizedModuleName %>');
13
+
14
+ expect(serializer).to.be.ok;
15
+ });
16
+
17
+ it('serializes records', function () {
18
+ let store = this.owner.lookup('service:store');
19
+ let record = store.createRecord('<%= dasherizedModuleName %>', {});
20
+
21
+ let serializedRecord = record.serialize();
22
+
23
+ expect(serializedRecord).to.be.ok;
24
+ });
25
+ });
@@ -0,0 +1,24 @@
1
+ import { module, test } from 'qunit';
2
+
3
+ import { setupTest } from '<%= modulePrefix %>/tests/helpers';
4
+
5
+ module('<%= friendlyTestDescription %>', function (hooks) {
6
+ setupTest(hooks);
7
+
8
+ // Replace this with your real tests.
9
+ test('it exists', function (assert) {
10
+ let store = this.owner.lookup('service:store');
11
+ let serializer = store.serializerFor('<%= dasherizedModuleName %>');
12
+
13
+ assert.ok(serializer);
14
+ });
15
+
16
+ test('it serializes records', function (assert) {
17
+ let store = this.owner.lookup('service:store');
18
+ let record = store.createRecord('<%= dasherizedModuleName %>', {});
19
+
20
+ let serializedRecord = record.serialize();
21
+
22
+ assert.ok(serializedRecord);
23
+ });
24
+ });
@@ -0,0 +1,13 @@
1
+ export default class <%= classifiedModuleName %>Transform {
2
+ deserialize(serialized) {
3
+ return serialized;
4
+ }
5
+
6
+ serialize(deserialized) {
7
+ return deserialized;
8
+ }
9
+
10
+ static create() {
11
+ return new this();
12
+ }
13
+ }
@@ -0,0 +1,7 @@
1
+ const useEditionDetector = require('@ember-data/private-build-infra/src/utilities/edition-detector');
2
+
3
+ module.exports = useEditionDetector({
4
+ description: 'Generates an ember-data value transform.',
5
+
6
+ root: __dirname,
7
+ });
@@ -0,0 +1,13 @@
1
+ export default class <%= classifiedModuleName %>Transform {
2
+ deserialize(serialized) {
3
+ return serialized;
4
+ }
5
+
6
+ serialize(deserialized) {
7
+ return deserialized;
8
+ }
9
+
10
+ static create() {
11
+ return new this();
12
+ }
13
+ }
@@ -0,0 +1,29 @@
1
+ const path = require('path');
2
+
3
+ const testInfo = require('ember-cli-test-info');
4
+ const useTestFrameworkDetector = require('@ember-data/private-build-infra/src/utilities/test-framework-detector');
5
+ const modulePrefixForProject = require('@ember-data/private-build-infra/src/utilities/module-prefix-for-project');
6
+
7
+ module.exports = useTestFrameworkDetector({
8
+ description: 'Generates a transform unit test.',
9
+
10
+ root: __dirname,
11
+
12
+ fileMapTokens(options) {
13
+ return {
14
+ __root__() {
15
+ return 'tests';
16
+ },
17
+ __path__() {
18
+ return path.join('unit', 'transforms');
19
+ },
20
+ };
21
+ },
22
+
23
+ locals(options) {
24
+ return {
25
+ friendlyTestDescription: testInfo.description(options.entity.name, 'Unit', 'Transform'),
26
+ modulePrefix: modulePrefixForProject(options.project),
27
+ };
28
+ },
29
+ });
@@ -0,0 +1,17 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+
4
+ import { setupTest } from 'ember-mocha';
5
+
6
+ describe('<%= friendlyTestDescription %>', function () {
7
+ setupTest('transform:<%= dasherizedModuleName %>', {
8
+ // Specify the other units that are required for this test.
9
+ // needs: ['transform:foo']
10
+ });
11
+
12
+ // Replace this with your real tests.
13
+ it('exists', function () {
14
+ let transform = this.subject();
15
+ expect(transform).to.be.ok;
16
+ });
17
+ });
@@ -0,0 +1,14 @@
1
+ import { expect } from 'chai';
2
+ import { describe, it } from 'mocha';
3
+
4
+ import { setupTest } from '<%= modulePrefix %>/tests/helpers';
5
+
6
+ describe('<%= friendlyTestDescription %>', function () {
7
+ setupTest();
8
+
9
+ // Replace this with your real tests.
10
+ it('exists', function () {
11
+ let transform = this.owner.lookup('transform:<%= dasherizedModuleName %>');
12
+ expect(transform).to.be.ok;
13
+ });
14
+ });
@@ -0,0 +1,13 @@
1
+ import { module, test } from 'qunit';
2
+
3
+ import { setupTest } from '<%= modulePrefix %>/tests/helpers';
4
+
5
+ module('<%= friendlyTestDescription %>', function (hooks) {
6
+ setupTest(hooks);
7
+
8
+ // Replace this with your real tests.
9
+ test('it exists', function (assert) {
10
+ let transform = this.owner.lookup('transform:<%= dasherizedModuleName %>');
11
+ assert.ok(transform);
12
+ });
13
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-data/serializer",
3
- "version": "4.12.0-alpha.19",
3
+ "version": "4.12.0-alpha.20",
4
4
  "description": "Provides Legacy JSON, JSON:API and REST Implementations of the Serializer Interface for use with @ember-data/store",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -19,6 +19,7 @@
19
19
  "version": 1
20
20
  },
21
21
  "files": [
22
+ "blueprints",
22
23
  "addon-main.js",
23
24
  "addon",
24
25
  "README.md",
@@ -27,7 +28,7 @@
27
28
  "ember-data-logo-light.svg"
28
29
  ],
29
30
  "peerDependencies": {
30
- "@ember-data/store": "4.12.0-alpha.19",
31
+ "@ember-data/store": "4.12.0-alpha.20",
31
32
  "@ember/string": "^3.0.1",
32
33
  "ember-inflector": "^4.0.2"
33
34
  },
@@ -37,7 +38,7 @@
37
38
  }
38
39
  },
39
40
  "dependencies": {
40
- "@ember-data/private-build-infra": "4.12.0-alpha.19",
41
+ "@ember-data/private-build-infra": "4.12.0-alpha.20",
41
42
  "@embroider/macros": "^1.10.0",
42
43
  "ember-cli-babel": "^7.26.11",
43
44
  "ember-cli-test-info": "^1.0.0"
@@ -46,7 +47,7 @@
46
47
  "@babel/core": "^7.21.4",
47
48
  "@babel/cli": "^7.21.0",
48
49
  "@glimmer/component": "^1.1.2",
49
- "ember-source": "~4.11.0",
50
+ "ember-source": "~4.12.0",
50
51
  "@embroider/addon-dev": "^3.0.0",
51
52
  "rollup": "^3.20.2",
52
53
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -61,15 +62,15 @@
61
62
  "@rollup/plugin-node-resolve": "^15.0.1",
62
63
  "tslib": "^2.5.0",
63
64
  "walk-sync": "^3.0.0",
64
- "typescript": "^4.9.5"
65
+ "typescript": "^5.0.3"
65
66
  },
66
67
  "engines": {
67
- "node": "^14.8.0 || 16.* || >= 18.*"
68
+ "node": "16.* || >= 18.*"
68
69
  },
69
70
  "volta": {
70
71
  "extends": "../../package.json"
71
72
  },
72
- "packageManager": "pnpm@7.30.5",
73
+ "packageManager": "pnpm@8.1.0",
73
74
  "scripts": {
74
75
  "build": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
75
76
  "start": "rollup --config --watch"