@magento/create-pwa 1.3.1-alpha.6 → 2.0.0-alpha.2

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.
@@ -46,6 +46,16 @@ Array [
46
46
  "name": "customBackendUrl",
47
47
  "when": [Function],
48
48
  },
49
+ Object {
50
+ "choices": Array [
51
+ "EE",
52
+ "CE",
53
+ ],
54
+ "default": "EE",
55
+ "message": "Edition of the magento store (Enterprise Edition or Community Edition)",
56
+ "name": "backendEdition",
57
+ "type": "list",
58
+ },
49
59
  Object {
50
60
  "default": "sandbox_8yrzsvtm_s2bg8fs563crhqzk",
51
61
  "message": "Braintree API token to use to communicate with your Braintree instance (will be added to \`.env\` file)",
@@ -53,8 +63,8 @@ Array [
53
63
  },
54
64
  Object {
55
65
  "choices": Array [
56
- "npm",
57
66
  "yarn",
67
+ "npm",
58
68
  ],
59
69
  "default": "yarn",
60
70
  "message": "NPM package management client to use",
@@ -73,7 +83,7 @@ Array [
73
83
  exports[`should log details 1`] = `
74
84
  Array [
75
85
  Array [
76
- "@magento/create-pwa v1.2.1",
86
+ "@magento/create-pwa v1.3.1",
77
87
  ],
78
88
  Array [
79
89
  "Creating a PWA Studio project",
@@ -82,7 +92,7 @@ Array [
82
92
  "
83
93
  Running command:
84
94
 
85
- buildpack create-project test --name \\"test\\" --author \\"Gooston <gooston@goosemail.com>\\" --template \\"@magento/venia-concept@8.0.0\\" --backend-url \\"https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/\\" --braintree-token \\"sandbox_8yrzsvtm_s2bg8fs563crhqzk\\" --npm-client \\"yarn\\" --no-install
95
+ buildpack create-project test --name \\"test\\" --author \\"Gooston <gooston@goosemail.com>\\" --template \\"@magento/venia-concept@8.0.0\\" --backend-url \\"https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/\\" --backend-edition \\"EE\\" --braintree-token \\"sandbox_8yrzsvtm_s2bg8fs563crhqzk\\" --npm-client \\"yarn\\" --no-install
86
96
  
87
97
  ",
88
98
  ],
@@ -29,6 +29,7 @@ jest.mock('inquirer', () => ({
29
29
  template: '@magento/venia-concept@8.0.0',
30
30
  backendUrl:
31
31
  'https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/',
32
+ backendEdition: 'EE',
32
33
  braintreeToken: 'sandbox_8yrzsvtm_s2bg8fs563crhqzk',
33
34
  npmClient: 'yarn',
34
35
  install: false
@@ -146,7 +147,7 @@ describe('Testing questions', () => {
146
147
  expect(
147
148
  templateQuestion.message({ name: 'test' })
148
149
  ).toMatchInlineSnapshot(
149
- `"Which template would you like to use to bootstrap test? Defaults to venia-concept."`
150
+ `"Which template would you like to use to bootstrap test? Defaults to \\"@magento/venia-concept\\"."`
150
151
  );
151
152
  });
152
153
 
@@ -161,6 +162,16 @@ describe('Testing questions', () => {
161
162
  expect(customBackendQuestion.when({ backendUrl: true })).toBeFalsy();
162
163
  });
163
164
 
165
+ test('validating backendEdition default', async () => {
166
+ await createPWA();
167
+ const questions = inquirer.prompt.mock.calls[0][0];
168
+ const backendEditionQuestion = questions.find(
169
+ question => question.name === 'backendEdition'
170
+ );
171
+
172
+ expect(backendEditionQuestion.default).toBe('EE');
173
+ });
174
+
164
175
  test('validating npmClient default if process.env.npm_config_user_agent includes yarn', async () => {
165
176
  const defaultClient = process.env.npm_config_user_agent;
166
177
  process.env.npm_config_user_agent = 'yarn';
@@ -210,7 +221,7 @@ test('should execute buildpack with answers provided', async () => {
210
221
  await createPWA();
211
222
 
212
223
  expect(execa.shell.mock.calls[0][0]).toMatchInlineSnapshot(
213
- `"BUILDPACK_LOCATION create-project test --name \\"test\\" --author \\"Gooston <gooston@goosemail.com>\\" --template \\"@magento/venia-concept@8.0.0\\" --backend-url \\"https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/\\" --braintree-token \\"sandbox_8yrzsvtm_s2bg8fs563crhqzk\\" --npm-client \\"yarn\\" --no-install"`
224
+ `"BUILDPACK_LOCATION create-project test --name \\"test\\" --author \\"Gooston <gooston@goosemail.com>\\" --template \\"@magento/venia-concept@8.0.0\\" --backend-url \\"https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/\\" --backend-edition \\"EE\\" --braintree-token \\"sandbox_8yrzsvtm_s2bg8fs563crhqzk\\" --npm-client \\"yarn\\" --no-install"`
214
225
  );
215
226
  });
216
227
 
@@ -231,7 +242,7 @@ test('should not include customBackendUrl in shell script', async () => {
231
242
  await createPWA();
232
243
 
233
244
  expect(execa.shell.mock.calls[0][0]).toMatchInlineSnapshot(
234
- `"BUILDPACK_LOCATION create-project test --name \\"test\\" --author \\"Gooston <gooston@goosemail.com>\\" --template \\"@magento/venia-concept@8.0.0\\" --backend-url \\"https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/\\" --braintree-token \\"sandbox_8yrzsvtm_s2bg8fs563crhqzk\\" --npm-client \\"yarn\\" --no-install"`
245
+ `"BUILDPACK_LOCATION create-project test --name \\"test\\" --author \\"Gooston <gooston@goosemail.com>\\" --template \\"@magento/venia-concept@8.0.0\\" --backend-url \\"https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/\\" --backend-edition \\"EE\\" --braintree-token \\"sandbox_8yrzsvtm_s2bg8fs563crhqzk\\" --npm-client \\"yarn\\" --no-install"`
235
246
  );
236
247
  });
237
248
 
package/lib/index.js CHANGED
@@ -129,6 +129,14 @@ module.exports = async () => {
129
129
  default: 'https://magento2.localhost',
130
130
  when: ({ backendUrl }) => !backendUrl
131
131
  },
132
+ {
133
+ name: 'backendEdition',
134
+ type: 'list',
135
+ message:
136
+ 'Edition of the magento store (Enterprise Edition or Community Edition)',
137
+ choices: ['EE', 'CE'],
138
+ default: 'EE'
139
+ },
132
140
  {
133
141
  name: 'braintreeToken',
134
142
  message:
@@ -139,7 +147,7 @@ module.exports = async () => {
139
147
  name: 'npmClient',
140
148
  type: 'list',
141
149
  message: 'NPM package management client to use',
142
- choices: ['npm', 'yarn'],
150
+ choices: ['yarn', 'npm'],
143
151
  default: isYarn ? 'yarn' : 'npm'
144
152
  },
145
153
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magento/create-pwa",
3
- "version": "1.3.1-alpha.6",
3
+ "version": "2.0.0-alpha.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "homepage": "https://github.com/magento/pwa-studio/tree/master/packages/create-pwa#readme",
31
31
  "dependencies": {
32
- "@magento/pwa-buildpack": "10.0.0-alpha.6",
33
- "@magento/venia-concept": "11.0.0-alpha.6",
32
+ "@magento/pwa-buildpack": "11.0.0-alpha.2",
33
+ "@magento/venia-concept": "12.0.0-alpha.2",
34
34
  "chalk": "^2.4.2",
35
35
  "change-case": "^3.1.0",
36
36
  "compression": "~1.7.4",
@@ -39,7 +39,7 @@
39
39
  "inquirer": "^6.3.1",
40
40
  "is-invalid-path": "^1.0.2",
41
41
  "is-valid-npm-name": "^0.0.4",
42
- "node-fetch": "~2.3.0",
42
+ "node-fetch": "~2.6.1",
43
43
  "webpack": "~4.46.0"
44
44
  }
45
45
  }