@warp-drive/legacy 5.10.0-alpha.5 → 5.10.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.
@@ -0,0 +1 @@
1
+ <%- content %>
@@ -0,0 +1,23 @@
1
+ module.exports = {
2
+ description: 'Generates an ember-data Adapter.',
3
+
4
+ availableOptions: [{ name: 'base-class', type: String }],
5
+
6
+ root: __dirname,
7
+
8
+ async locals(options) {
9
+ const { generateAdapterSource } = await import('warp-drive/generators/adapter');
10
+
11
+ const isAddon = options.inRepoAddon || options.project.isEmberCLIAddon();
12
+
13
+ return {
14
+ content: generateAdapterSource(options.entity.name, {
15
+ cwd: options.project.root,
16
+ isAddon,
17
+ baseClass: options.baseClass,
18
+ packageName: '@warp-drive/legacy/adapter',
19
+ importStyle: 'named',
20
+ }),
21
+ };
22
+ },
23
+ };
@@ -0,0 +1,35 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ description: 'Generates an EmberData adapter unit test',
5
+ supportsAddon() {
6
+ return false;
7
+ },
8
+
9
+ root: __dirname,
10
+
11
+ fileMapTokens() {
12
+ return {
13
+ __root__() {
14
+ return 'tests';
15
+ },
16
+ __path__() {
17
+ return path.join('unit', 'adapters');
18
+ },
19
+ };
20
+ },
21
+
22
+ async locals(options) {
23
+ const { generateUnitTestSource } = await import('warp-drive/generators/tests');
24
+ const { dasherize } = await import('warp-drive/generators/strings');
25
+ const modulePrefix = dasherize(options.project.config().modulePrefix);
26
+
27
+ return {
28
+ content: generateUnitTestSource('Adapter', options.entity.name, modulePrefix),
29
+ };
30
+ },
31
+
32
+ filesPath() {
33
+ return path.join(__dirname, 'qunit-files');
34
+ },
35
+ };
@@ -0,0 +1,26 @@
1
+ <grey>You may generate models with as many attrs as you would like to pass. The following attribute types are supported:</grey>
2
+ <yellow><attr-name></yellow>
3
+ <yellow><attr-name></yellow>:array
4
+ <yellow><attr-name></yellow>:boolean
5
+ <yellow><attr-name></yellow>:date
6
+ <yellow><attr-name></yellow>:object
7
+ <yellow><attr-name></yellow>:number
8
+ <yellow><attr-name></yellow>:string
9
+ <yellow><attr-name></yellow>:your-custom-transform
10
+ <yellow><attr-name></yellow>:belongs-to:<yellow><model-name></yellow>
11
+ <yellow><attr-name></yellow>:has-many:<yellow><model-name></yellow>
12
+
13
+ For instance: <green>\`ember generate model taco filling:belongs-to:protein toppings:has-many:toppings name:string price:number misc\`</green>
14
+ would result in the following model:
15
+
16
+ ```js
17
+ import Model, { belongsTo, hasMany, attr } from '@ember-data/model';
18
+
19
+ export default class TacoModel extends Model {
20
+ @belongsTo('protein', { async: false, inverse: null }) filling;
21
+ @hasMany('topping', { async: false, inverse: null }) toppings;
22
+ @attr('string') name;
23
+ @attr('number') price;
24
+ @attr misc;
25
+ }
26
+ ```
@@ -0,0 +1 @@
1
+ <%- content %>
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ description: 'Generates an ember-data Model.',
3
+
4
+ anonymousOptions: ['name', 'attr:type'],
5
+
6
+ root: __dirname,
7
+
8
+ async locals(options) {
9
+ const { generateModelSource } = await import('warp-drive/generators/model');
10
+
11
+ const entityOptions = options.entity.options;
12
+ const rawAttrs = Object.keys(entityOptions).map((name) => {
13
+ const type = entityOptions[name];
14
+ return type ? `${name}:${type}` : name;
15
+ });
16
+
17
+ return {
18
+ content: generateModelSource(options.entity.name, rawAttrs, { packageName: '@warp-drive/legacy/model' }),
19
+ };
20
+ },
21
+ };
@@ -0,0 +1,35 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ description: 'Generates an EmberData Model unit test',
5
+ supportsAddon() {
6
+ return false;
7
+ },
8
+
9
+ root: __dirname,
10
+
11
+ fileMapTokens() {
12
+ return {
13
+ __root__() {
14
+ return 'tests';
15
+ },
16
+ __path__() {
17
+ return path.join('unit', 'models');
18
+ },
19
+ };
20
+ },
21
+
22
+ async locals(options) {
23
+ const { generateUnitTestSource } = await import('warp-drive/generators/tests');
24
+ const { dasherize } = await import('warp-drive/generators/strings');
25
+ const modulePrefix = dasherize(options.project.config().modulePrefix);
26
+
27
+ return {
28
+ content: generateUnitTestSource('Model', options.entity.name, modulePrefix),
29
+ };
30
+ },
31
+
32
+ filesPath() {
33
+ return path.join(__dirname, 'qunit-files');
34
+ },
35
+ };
@@ -0,0 +1,23 @@
1
+ module.exports = {
2
+ description: 'Generates an ember-data Serializer.',
3
+
4
+ availableOptions: [{ name: 'base-class', type: String }],
5
+
6
+ root: __dirname,
7
+
8
+ async locals(options) {
9
+ const { generateSerializerSource } = await import('warp-drive/generators/serializer');
10
+
11
+ const isAddon = options.inRepoAddon || options.project.isEmberCLIAddon();
12
+
13
+ return {
14
+ content: generateSerializerSource(options.entity.name, {
15
+ cwd: options.project.root,
16
+ isAddon,
17
+ baseClass: options.baseClass,
18
+ packageName: '@warp-drive/legacy/serializer',
19
+ importStyle: 'named',
20
+ }),
21
+ };
22
+ },
23
+ };
@@ -0,0 +1,35 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ description: 'Generates an EmberData Serializer unit test',
5
+ supportsAddon() {
6
+ return false;
7
+ },
8
+
9
+ root: __dirname,
10
+
11
+ fileMapTokens() {
12
+ return {
13
+ __root__() {
14
+ return 'tests';
15
+ },
16
+ __path__() {
17
+ return path.join('unit', 'serializers');
18
+ },
19
+ };
20
+ },
21
+
22
+ async locals(options) {
23
+ const { generateUnitTestSource } = await import('warp-drive/generators/tests');
24
+ const { dasherize } = await import('warp-drive/generators/strings');
25
+ const modulePrefix = dasherize(options.project.config().modulePrefix);
26
+
27
+ return {
28
+ content: generateUnitTestSource('Serializer', options.entity.name, modulePrefix),
29
+ };
30
+ },
31
+
32
+ filesPath() {
33
+ return path.join(__dirname, 'qunit-files');
34
+ },
35
+ };
@@ -0,0 +1 @@
1
+ <%- content %>
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ description: 'Generates an ember-data Transform.',
3
+ root: __dirname,
4
+
5
+ async locals(options) {
6
+ const { generateTransformSource } = await import('warp-drive/generators/transform');
7
+
8
+ return {
9
+ content: generateTransformSource(options.entity.name),
10
+ };
11
+ },
12
+ };
@@ -0,0 +1,35 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ description: 'Generates an EmberData Transform unit test',
5
+ supportsAddon() {
6
+ return false;
7
+ },
8
+
9
+ root: __dirname,
10
+
11
+ fileMapTokens() {
12
+ return {
13
+ __root__() {
14
+ return 'tests';
15
+ },
16
+ __path__() {
17
+ return path.join('unit', 'transforms');
18
+ },
19
+ };
20
+ },
21
+
22
+ async locals(options) {
23
+ const { generateUnitTestSource } = await import('warp-drive/generators/tests');
24
+ const { dasherize } = await import('warp-drive/generators/strings');
25
+ const modulePrefix = dasherize(options.project.config().modulePrefix);
26
+
27
+ return {
28
+ content: generateUnitTestSource('Transform', options.entity.name, modulePrefix),
29
+ };
30
+ },
31
+
32
+ filesPath() {
33
+ return path.join(__dirname, 'qunit-files');
34
+ },
35
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive/legacy",
3
- "version": "5.10.0-alpha.5",
3
+ "version": "5.10.0-alpha.7",
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"
@@ -13,6 +13,7 @@
13
13
  "directory": "warp-drive-packages/legacy"
14
14
  },
15
15
  "files": [
16
+ "blueprints",
16
17
  "dist",
17
18
  "addon-main.cjs",
18
19
  "CHANGELOG.md",
@@ -39,20 +40,21 @@
39
40
  }
40
41
  },
41
42
  "peerDependencies": {
42
- "@warp-drive/core": "5.10.0-alpha.5",
43
- "@warp-drive/utilities": "5.10.0-alpha.5"
43
+ "@warp-drive/core": "5.10.0-alpha.7",
44
+ "@warp-drive/utilities": "5.10.0-alpha.7"
44
45
  },
45
46
  "dependencies": {
46
- "@embroider/macros": "^1.20.7"
47
+ "@embroider/macros": "^1.20.7",
48
+ "warp-drive": "0.2.0-alpha.83"
47
49
  },
48
50
  "devDependencies": {
49
51
  "@babel/core": "^7.29.7",
50
52
  "@babel/plugin-transform-typescript": "^7.29.7",
51
53
  "@babel/preset-typescript": "^7.29.7",
52
54
  "@types/jquery": "^4.0.1",
53
- "@warp-drive/core": "5.10.0-alpha.5",
54
- "@warp-drive/internal-config": "5.10.0-alpha.5",
55
- "@warp-drive/utilities": "5.10.0-alpha.5",
55
+ "@warp-drive/core": "5.10.0-alpha.7",
56
+ "@warp-drive/internal-config": "5.10.0-alpha.7",
57
+ "@warp-drive/utilities": "5.10.0-alpha.7",
56
58
  "decorator-transforms": "^2.4.0",
57
59
  "ember-source": "~7.2.0",
58
60
  "expect-type": "^1.4.0",