@vendure-platform/create 0.3.0 → 0.4.0
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/CHANGELOG.md +4 -0
- package/README.md +7 -7
- package/dist/add-to-existing.js +1 -583
- package/dist/assets/storefront/package.json +1 -1
- package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +12 -1
- package/dist/assets/storefront/src/graphql-env.d.ts +15 -15
- package/dist/assets/storefront/src/schema.graphql +187 -61
- package/dist/bin/run.js +1 -119
- package/dist/cli.js +1 -309
- package/dist/git-init.js +1 -60
- package/dist/index.js +1 -19
- package/dist/plugin-registry.js +1 -203
- package/dist/registry.js +1 -29
- package/dist/scaffold-shared.js +1 -124
- package/dist/scaffold-storefront-only.js +1 -101
- package/dist/scaffolder.js +1 -203
- package/dist/sort-package-json.js +1 -26
- package/dist/storefront-copier.js +1 -149
- package/dist/template-renderer.js +1 -221
- package/dist/types.js +1 -3
- package/package.json +5 -4
- package/dist/add-to-existing.js.map +0 -1
- package/dist/assets/storefront/src/lib/quantity.test.js +0 -20
- package/dist/bin/run.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/git-init.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/plugin-registry.js.map +0 -1
- package/dist/registry.js.map +0 -1
- package/dist/scaffold-shared.js.map +0 -1
- package/dist/scaffold-storefront-only.js.map +0 -1
- package/dist/scaffolder.js.map +0 -1
- package/dist/sort-package-json.js.map +0 -1
- package/dist/storefront-copier.js.map +0 -1
- package/dist/template-renderer.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -10,7 +10,12 @@ type Query {
|
|
|
10
10
|
state of `PaymentAuthorized` or `PaymentSettled`, then that Order is no longer considered "active" and this
|
|
11
11
|
query will once again return `null`.
|
|
12
12
|
"""
|
|
13
|
-
activeOrder
|
|
13
|
+
activeOrder(
|
|
14
|
+
"""
|
|
15
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
16
|
+
"""
|
|
17
|
+
activeOrderInput: ActiveOrderInput = null
|
|
18
|
+
): Order
|
|
14
19
|
|
|
15
20
|
"""An array of supported Countries"""
|
|
16
21
|
availableCountries: [Country!]!
|
|
@@ -26,12 +31,22 @@ type Query {
|
|
|
26
31
|
"""
|
|
27
32
|
Returns a list of eligible shipping methods based on the current active Order
|
|
28
33
|
"""
|
|
29
|
-
eligibleShippingMethods
|
|
34
|
+
eligibleShippingMethods(
|
|
35
|
+
"""
|
|
36
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
37
|
+
"""
|
|
38
|
+
activeOrderInput: ActiveOrderInput = null
|
|
39
|
+
): [ShippingMethodQuote!]!
|
|
30
40
|
|
|
31
41
|
"""
|
|
32
42
|
Returns a list of payment methods and their eligibility based on the current active Order
|
|
33
43
|
"""
|
|
34
|
-
eligiblePaymentMethods
|
|
44
|
+
eligiblePaymentMethods(
|
|
45
|
+
"""
|
|
46
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
47
|
+
"""
|
|
48
|
+
activeOrderInput: ActiveOrderInput = null
|
|
49
|
+
): [PaymentMethodQuote!]!
|
|
35
50
|
|
|
36
51
|
"""A list of Facets available to the shop"""
|
|
37
52
|
facets(options: FacetListOptions): FacetList!
|
|
@@ -45,7 +60,12 @@ type Query {
|
|
|
45
60
|
"""
|
|
46
61
|
Returns the possible next states that the activeOrder can transition to
|
|
47
62
|
"""
|
|
48
|
-
nextOrderStates
|
|
63
|
+
nextOrderStates(
|
|
64
|
+
"""
|
|
65
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
66
|
+
"""
|
|
67
|
+
activeOrderInput: ActiveOrderInput = null
|
|
68
|
+
): [String!]!
|
|
49
69
|
|
|
50
70
|
"""
|
|
51
71
|
Returns an Order based on the id. Note that in the Shop API, only orders belonging to the
|
|
@@ -143,13 +163,23 @@ type Query {
|
|
|
143
163
|
|
|
144
164
|
"""Approval history for a specific entity visible to the current customer"""
|
|
145
165
|
approvalHistoryForEntity(entityType: String!, entityId: ID!): [ApprovalRequest!]!
|
|
166
|
+
activePunchoutSession: PunchoutSessionInfo
|
|
146
167
|
}
|
|
147
168
|
|
|
148
169
|
type Mutation {
|
|
149
170
|
"""
|
|
150
171
|
Adds an item to the Order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available.
|
|
151
172
|
"""
|
|
152
|
-
addItemToOrder(
|
|
173
|
+
addItemToOrder(
|
|
174
|
+
productVariantId: ID!
|
|
175
|
+
quantity: Int!
|
|
176
|
+
customFields: OrderLineCustomFieldsInput = null
|
|
177
|
+
|
|
178
|
+
"""
|
|
179
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
180
|
+
"""
|
|
181
|
+
activeOrderInput: ActiveOrderInput = null
|
|
182
|
+
): UpdateOrderItemsResult!
|
|
153
183
|
|
|
154
184
|
"""
|
|
155
185
|
Adds mutliple items to the Order. Returns a list of errors for each item that failed to add. It will still add successful items.
|
|
@@ -157,45 +187,118 @@ type Mutation {
|
|
|
157
187
|
addItemsToOrder(inputs: [AddItemInput!]!): UpdateMultipleOrderItemsResult!
|
|
158
188
|
|
|
159
189
|
"""Remove an OrderLine from the Order"""
|
|
160
|
-
removeOrderLine(
|
|
190
|
+
removeOrderLine(
|
|
191
|
+
orderLineId: ID!
|
|
192
|
+
|
|
193
|
+
"""
|
|
194
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
195
|
+
"""
|
|
196
|
+
activeOrderInput: ActiveOrderInput = null
|
|
197
|
+
): RemoveOrderItemsResult!
|
|
161
198
|
|
|
162
199
|
"""Remove all OrderLine from the Order"""
|
|
163
|
-
removeAllOrderLines
|
|
200
|
+
removeAllOrderLines(
|
|
201
|
+
"""
|
|
202
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
203
|
+
"""
|
|
204
|
+
activeOrderInput: ActiveOrderInput = null
|
|
205
|
+
): RemoveOrderItemsResult!
|
|
164
206
|
|
|
165
207
|
"""
|
|
166
208
|
Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available.
|
|
167
209
|
"""
|
|
168
|
-
adjustOrderLine(
|
|
210
|
+
adjustOrderLine(
|
|
211
|
+
orderLineId: ID!
|
|
212
|
+
quantity: Int!
|
|
213
|
+
customFields: OrderLineCustomFieldsInput = null
|
|
214
|
+
|
|
215
|
+
"""
|
|
216
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
217
|
+
"""
|
|
218
|
+
activeOrderInput: ActiveOrderInput = null
|
|
219
|
+
): UpdateOrderItemsResult!
|
|
169
220
|
|
|
170
221
|
"""Applies the given coupon code to the active Order"""
|
|
171
|
-
applyCouponCode(
|
|
222
|
+
applyCouponCode(
|
|
223
|
+
couponCode: String!
|
|
224
|
+
|
|
225
|
+
"""
|
|
226
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
227
|
+
"""
|
|
228
|
+
activeOrderInput: ActiveOrderInput = null
|
|
229
|
+
): ApplyCouponCodeResult!
|
|
172
230
|
|
|
173
231
|
"""Removes the given coupon code from the active Order"""
|
|
174
|
-
removeCouponCode(
|
|
232
|
+
removeCouponCode(
|
|
233
|
+
couponCode: String!
|
|
234
|
+
|
|
235
|
+
"""
|
|
236
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
237
|
+
"""
|
|
238
|
+
activeOrderInput: ActiveOrderInput = null
|
|
239
|
+
): Order
|
|
175
240
|
|
|
176
241
|
"""
|
|
177
242
|
Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates`
|
|
178
243
|
"""
|
|
179
|
-
transitionOrderToState(
|
|
244
|
+
transitionOrderToState(
|
|
245
|
+
state: String!
|
|
246
|
+
|
|
247
|
+
"""
|
|
248
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
249
|
+
"""
|
|
250
|
+
activeOrderInput: ActiveOrderInput = null
|
|
251
|
+
): TransitionOrderToStateResult
|
|
180
252
|
|
|
181
253
|
"""Sets the shipping address for the active Order"""
|
|
182
|
-
setOrderShippingAddress(
|
|
254
|
+
setOrderShippingAddress(
|
|
255
|
+
input: CreateAddressInput!
|
|
256
|
+
|
|
257
|
+
"""
|
|
258
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
259
|
+
"""
|
|
260
|
+
activeOrderInput: ActiveOrderInput = null
|
|
261
|
+
): ActiveOrderResult!
|
|
183
262
|
|
|
184
263
|
"""Sets the billing address for the active Order"""
|
|
185
|
-
setOrderBillingAddress(
|
|
264
|
+
setOrderBillingAddress(
|
|
265
|
+
input: CreateAddressInput!
|
|
266
|
+
|
|
267
|
+
"""
|
|
268
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
269
|
+
"""
|
|
270
|
+
activeOrderInput: ActiveOrderInput = null
|
|
271
|
+
): ActiveOrderResult!
|
|
186
272
|
|
|
187
273
|
"""
|
|
188
274
|
Unsets the shipping address for the active Order. Available since version 3.1.0
|
|
189
275
|
"""
|
|
190
|
-
unsetOrderShippingAddress
|
|
276
|
+
unsetOrderShippingAddress(
|
|
277
|
+
"""
|
|
278
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
279
|
+
"""
|
|
280
|
+
activeOrderInput: ActiveOrderInput = null
|
|
281
|
+
): ActiveOrderResult!
|
|
191
282
|
|
|
192
283
|
"""
|
|
193
284
|
Unsets the billing address for the active Order. Available since version 3.1.0
|
|
194
285
|
"""
|
|
195
|
-
unsetOrderBillingAddress
|
|
286
|
+
unsetOrderBillingAddress(
|
|
287
|
+
"""
|
|
288
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
289
|
+
"""
|
|
290
|
+
activeOrderInput: ActiveOrderInput = null
|
|
291
|
+
): ActiveOrderResult!
|
|
196
292
|
|
|
197
293
|
"""Allows any custom fields to be set for the active Order"""
|
|
198
|
-
setOrderCustomFields(
|
|
294
|
+
setOrderCustomFields(
|
|
295
|
+
input: UpdateOrderInput!
|
|
296
|
+
|
|
297
|
+
"""
|
|
298
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
299
|
+
"""
|
|
300
|
+
activeOrderInput: ActiveOrderInput = null
|
|
301
|
+
): ActiveOrderResult!
|
|
199
302
|
|
|
200
303
|
"""
|
|
201
304
|
Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query.
|
|
@@ -203,18 +306,39 @@ type Mutation {
|
|
|
203
306
|
you should configure a custom ShippingLineAssignmentStrategy in order to know which OrderLines each
|
|
204
307
|
shipping method will apply to.
|
|
205
308
|
"""
|
|
206
|
-
setOrderShippingMethod(
|
|
309
|
+
setOrderShippingMethod(
|
|
310
|
+
shippingMethodId: [ID!]!
|
|
311
|
+
|
|
312
|
+
"""
|
|
313
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
314
|
+
"""
|
|
315
|
+
activeOrderInput: ActiveOrderInput = null
|
|
316
|
+
): SetOrderShippingMethodResult!
|
|
207
317
|
|
|
208
318
|
"""Sets the currency code for the active Order"""
|
|
209
319
|
setCurrencyCodeForOrder(currencyCode: CurrencyCode!): UpdateOrderItemsResult!
|
|
210
320
|
|
|
211
321
|
"""Add a Payment to the Order"""
|
|
212
|
-
addPaymentToOrder(
|
|
322
|
+
addPaymentToOrder(
|
|
323
|
+
input: PaymentInput!
|
|
324
|
+
|
|
325
|
+
"""
|
|
326
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
327
|
+
"""
|
|
328
|
+
activeOrderInput: ActiveOrderInput = null
|
|
329
|
+
): AddPaymentToOrderResult!
|
|
213
330
|
|
|
214
331
|
"""
|
|
215
332
|
Set the Customer for the Order. Required only if the Customer is not currently logged in
|
|
216
333
|
"""
|
|
217
|
-
setCustomerForOrder(
|
|
334
|
+
setCustomerForOrder(
|
|
335
|
+
input: CreateCustomerInput!
|
|
336
|
+
|
|
337
|
+
"""
|
|
338
|
+
Inputs for the configured ActiveOrderStrategies punchout, quote-checkout,
|
|
339
|
+
"""
|
|
340
|
+
activeOrderInput: ActiveOrderInput = null
|
|
341
|
+
): SetCustomerForOrderResult!
|
|
218
342
|
|
|
219
343
|
"""
|
|
220
344
|
Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
|
|
@@ -393,10 +517,20 @@ type Mutation {
|
|
|
393
517
|
Batch submit decisions (only if current customer is an assigned approver for each)
|
|
394
518
|
"""
|
|
395
519
|
batchSubmitApprovalDecisions(input: [BatchApprovalDecisionInput!]!): [BatchApprovalDecisionResult!]!
|
|
520
|
+
activatePunchoutSession(token: String!): PunchoutSessionInfo!
|
|
521
|
+
transferPunchoutCart(sessionId: ID): PunchoutCartTransferResult!
|
|
396
522
|
addCompanyTaxId(input: AddCompanyTaxIdInput!): TaxId!
|
|
397
523
|
removeCompanyTaxId(id: ID!): DeletionResponse!
|
|
398
524
|
}
|
|
399
525
|
|
|
526
|
+
input ActiveOrderInput {
|
|
527
|
+
punchout: PunchoutActiveOrderInput
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
input PunchoutActiveOrderInput {
|
|
531
|
+
sessionId: ID!
|
|
532
|
+
}
|
|
533
|
+
|
|
400
534
|
type Address implements Node {
|
|
401
535
|
id: ID!
|
|
402
536
|
createdAt: DateTime!
|
|
@@ -1094,6 +1228,18 @@ enum Permission {
|
|
|
1094
1228
|
"""Grants permission to delete ApprovalRequest"""
|
|
1095
1229
|
DeleteApprovalRequest
|
|
1096
1230
|
|
|
1231
|
+
"""Grants permission to create Punchout"""
|
|
1232
|
+
CreatePunchout
|
|
1233
|
+
|
|
1234
|
+
"""Grants permission to read Punchout"""
|
|
1235
|
+
ReadPunchout
|
|
1236
|
+
|
|
1237
|
+
"""Grants permission to update Punchout"""
|
|
1238
|
+
UpdatePunchout
|
|
1239
|
+
|
|
1240
|
+
"""Grants permission to delete Punchout"""
|
|
1241
|
+
DeletePunchout
|
|
1242
|
+
|
|
1097
1243
|
"""Grants permission to read DashboardGlobalViews"""
|
|
1098
1244
|
ReadDashboardGlobalViews
|
|
1099
1245
|
|
|
@@ -3940,6 +4086,7 @@ type PublicShippingMethod {
|
|
|
3940
4086
|
|
|
3941
4087
|
input AuthenticationInput {
|
|
3942
4088
|
native: NativeAuthInput
|
|
4089
|
+
punchout: PunchoutAuthInput
|
|
3943
4090
|
}
|
|
3944
4091
|
|
|
3945
4092
|
input RegisterCustomerInput {
|
|
@@ -5309,43 +5456,10 @@ type ConfiguratorSystem implements Node {
|
|
|
5309
5456
|
updatedAt: DateTime!
|
|
5310
5457
|
code: String!
|
|
5311
5458
|
enabled: Boolean!
|
|
5312
|
-
metadata: JSON
|
|
5313
5459
|
name: String!
|
|
5314
5460
|
description: String
|
|
5315
5461
|
translations: [ConfiguratorSystemTranslation!]!
|
|
5316
5462
|
modules: [ConfiguratorModule!]!
|
|
5317
|
-
rules: [ConfiguratorRule!]!
|
|
5318
|
-
}
|
|
5319
|
-
|
|
5320
|
-
type RulePhaseLabel {
|
|
5321
|
-
languageCode: LanguageCode!
|
|
5322
|
-
value: String!
|
|
5323
|
-
}
|
|
5324
|
-
|
|
5325
|
-
"""
|
|
5326
|
-
An execution phase for configurator rules and calculators.
|
|
5327
|
-
Admins see rules grouped into phases in the UI. Phases execute in
|
|
5328
|
-
fixed `sortOrder` order; within a phase, rules execute by their
|
|
5329
|
-
own `order` field.
|
|
5330
|
-
"""
|
|
5331
|
-
type RulePhase {
|
|
5332
|
-
key: String!
|
|
5333
|
-
sortOrder: Int!
|
|
5334
|
-
label: [RulePhaseLabel!]!
|
|
5335
|
-
}
|
|
5336
|
-
|
|
5337
|
-
type ConfiguratorRule implements Node {
|
|
5338
|
-
id: ID!
|
|
5339
|
-
createdAt: DateTime!
|
|
5340
|
-
updatedAt: DateTime!
|
|
5341
|
-
name: String!
|
|
5342
|
-
sourceKey: String!
|
|
5343
|
-
enabled: Boolean!
|
|
5344
|
-
phaseKey: String!
|
|
5345
|
-
order: Int!
|
|
5346
|
-
phase: RulePhase
|
|
5347
|
-
conditions: [ConfigurableOperation!]!
|
|
5348
|
-
actions: [ConfigurableOperation!]!
|
|
5349
5463
|
}
|
|
5350
5464
|
|
|
5351
5465
|
type ProductConfigurationFieldValue {
|
|
@@ -5379,15 +5493,6 @@ type ProductConfiguration implements Node {
|
|
|
5379
5493
|
customFields: JSON
|
|
5380
5494
|
}
|
|
5381
5495
|
|
|
5382
|
-
type ProductConfigurationList implements PaginatedList {
|
|
5383
|
-
items: [ProductConfiguration!]!
|
|
5384
|
-
totalItems: Int!
|
|
5385
|
-
}
|
|
5386
|
-
|
|
5387
|
-
input ProductConfigurationListOptions {
|
|
5388
|
-
state: StringOperators
|
|
5389
|
-
}
|
|
5390
|
-
|
|
5391
5496
|
type CalculationError {
|
|
5392
5497
|
sourceKey: String!
|
|
5393
5498
|
type: String!
|
|
@@ -5566,6 +5671,20 @@ type BatchApprovalDecisionResult {
|
|
|
5566
5671
|
errorMessage: String
|
|
5567
5672
|
}
|
|
5568
5673
|
|
|
5674
|
+
type PunchoutSessionInfo {
|
|
5675
|
+
id: ID!
|
|
5676
|
+
operation: String!
|
|
5677
|
+
buyerCookie: String!
|
|
5678
|
+
expiresAt: DateTime!
|
|
5679
|
+
tradingPartnerName: String!
|
|
5680
|
+
extrinsics: JSON
|
|
5681
|
+
}
|
|
5682
|
+
|
|
5683
|
+
type PunchoutCartTransferResult {
|
|
5684
|
+
browserFormPostUrl: String!
|
|
5685
|
+
cxmlPayload: String!
|
|
5686
|
+
}
|
|
5687
|
+
|
|
5569
5688
|
input AddCompanyTaxIdInput {
|
|
5570
5689
|
number: String!
|
|
5571
5690
|
type: String
|
|
@@ -5765,6 +5884,7 @@ input ProductFilterParameter {
|
|
|
5765
5884
|
_or: [ProductFilterParameter!]
|
|
5766
5885
|
isGiftCard: BooleanOperators
|
|
5767
5886
|
configuratorSystemCode: StringOperators
|
|
5887
|
+
unspscCode: StringOperators
|
|
5768
5888
|
}
|
|
5769
5889
|
|
|
5770
5890
|
input ProductSortParameter {
|
|
@@ -5776,6 +5896,7 @@ input ProductSortParameter {
|
|
|
5776
5896
|
description: SortOrder
|
|
5777
5897
|
isGiftCard: SortOrder
|
|
5778
5898
|
configuratorSystemCode: SortOrder
|
|
5899
|
+
unspscCode: SortOrder
|
|
5779
5900
|
}
|
|
5780
5901
|
|
|
5781
5902
|
input StoreCreditFilterParameter {
|
|
@@ -5922,6 +6043,7 @@ type OrderLineCustomFields {
|
|
|
5922
6043
|
type ProductCustomFields {
|
|
5923
6044
|
isGiftCard: Boolean
|
|
5924
6045
|
configuratorSystemCode: String
|
|
6046
|
+
unspscCode: String
|
|
5925
6047
|
}
|
|
5926
6048
|
|
|
5927
6049
|
type CompanyCustomFields {
|
|
@@ -5963,6 +6085,10 @@ input NativeAuthInput {
|
|
|
5963
6085
|
password: String!
|
|
5964
6086
|
}
|
|
5965
6087
|
|
|
6088
|
+
input PunchoutAuthInput {
|
|
6089
|
+
token: String!
|
|
6090
|
+
}
|
|
6091
|
+
|
|
5966
6092
|
input RegisterCustomerCustomFieldsInput {
|
|
5967
6093
|
globalDiscount: Int
|
|
5968
6094
|
}
|
package/dist/bin/run.js
CHANGED
|
@@ -1,120 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
const commander_1 = require("commander");
|
|
40
|
-
const cli_1 = require("../cli");
|
|
41
|
-
const scaffolder_1 = require("../scaffolder");
|
|
42
|
-
const scaffold_storefront_only_1 = require("../scaffold-storefront-only");
|
|
43
|
-
const add_to_existing_1 = require("../add-to-existing");
|
|
44
|
-
function getVersion() {
|
|
45
|
-
const pkgPath = path.join(__dirname, '..', '..', 'package.json');
|
|
46
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
47
|
-
return pkg.version;
|
|
48
|
-
}
|
|
49
|
-
const program = new commander_1.Command()
|
|
50
|
-
.name('create-vendure-platform')
|
|
51
|
-
.description('Scaffold a Vendure project with Vendure Platform plugins, or a standalone storefront')
|
|
52
|
-
.version(getVersion(), '-v, --version')
|
|
53
|
-
// Required so the same flag names (e.g. --plugins) can mean different things
|
|
54
|
-
// on `program` (default scaffold action) and `program.command('add')`. Without
|
|
55
|
-
// this, commander v13 consumes those flags at the program level even when
|
|
56
|
-
// they appear after the subcommand name.
|
|
57
|
-
.enablePositionalOptions();
|
|
58
|
-
program
|
|
59
|
-
.command('add')
|
|
60
|
-
.description('Add Vendure Platform to an existing Vendure project (run from the project root)')
|
|
61
|
-
.option('--plugins <list>', 'Comma-separated list of plugin keys to include (skips the interactive prompt)')
|
|
62
|
-
.option('--registry-token <token>', 'Vendure private-registry npm auth token (written to project .npmrc as _authToken)')
|
|
63
|
-
.option('--license-token <token>', 'Vendure Platform server-side license token (written to .env as VENDURE_PLATFORM_LICENSE_TOKEN)')
|
|
64
|
-
.option('--dry-run', 'Show what would be changed without writing files')
|
|
65
|
-
.action(async (opts) => {
|
|
66
|
-
const options = await (0, add_to_existing_1.runAddToExistingCli)({
|
|
67
|
-
plugins: opts.plugins,
|
|
68
|
-
dryRun: opts.dryRun,
|
|
69
|
-
registryToken: opts.registryToken,
|
|
70
|
-
licenseToken: opts.licenseToken,
|
|
71
|
-
});
|
|
72
|
-
await (0, add_to_existing_1.addToExisting)(options);
|
|
73
|
-
});
|
|
74
|
-
program
|
|
75
|
-
.argument('[project-name]', 'Name of the project to create')
|
|
76
|
-
.option('--plugins <list>', 'Comma-separated list of plugin keys to include')
|
|
77
|
-
.option('--company <name>', 'Company name for the demo project')
|
|
78
|
-
.option('--no-storefront', 'Skip the Next.js storefront')
|
|
79
|
-
.option('--github', 'Create a GitHub repository')
|
|
80
|
-
.option('--github-org <org>', 'GitHub organization (only used with --github)', 'vendurehq')
|
|
81
|
-
.option('--no-github', 'Do not create a GitHub repository')
|
|
82
|
-
.option('--no-install', 'Skip dependency install')
|
|
83
|
-
.option('--no-git', 'Skip git init')
|
|
84
|
-
.option('--dry-run', 'Show what would be created without writing files')
|
|
85
|
-
.option('--storefront-only', 'Scaffold just the Next.js storefront, no server or plugins')
|
|
86
|
-
.option('--api-url <url>', 'Vendure Shop API URL (storefront-only mode)')
|
|
87
|
-
.option('--scenario <name>', 'Storefront scenario (storefront-only mode; default: customer)')
|
|
88
|
-
.option('--pm <bun|npm|pnpm>', 'Package manager used for the install step (default: bun)')
|
|
89
|
-
.option('--registry-token <token>', 'Vendure private-registry npm auth token (written to project .npmrc as _authToken)')
|
|
90
|
-
.option('--license-token <token>', 'Vendure Platform server-side license token (written to .env as VENDURE_PLATFORM_LICENSE_TOKEN)')
|
|
91
|
-
.action(async (projectName, opts) => {
|
|
92
|
-
const flags = {
|
|
93
|
-
plugins: opts.plugins,
|
|
94
|
-
company: opts.company,
|
|
95
|
-
storefront: opts.storefront,
|
|
96
|
-
github: opts.github,
|
|
97
|
-
githubOrg: opts.githubOrg,
|
|
98
|
-
install: opts.install,
|
|
99
|
-
git: opts.git,
|
|
100
|
-
dryRun: opts.dryRun,
|
|
101
|
-
storefrontOnly: opts.storefrontOnly,
|
|
102
|
-
apiUrl: opts.apiUrl,
|
|
103
|
-
scenario: opts.scenario,
|
|
104
|
-
pm: opts.pm,
|
|
105
|
-
registryToken: opts.registryToken,
|
|
106
|
-
licenseToken: opts.licenseToken,
|
|
107
|
-
};
|
|
108
|
-
if (flags.storefrontOnly) {
|
|
109
|
-
const options = await (0, cli_1.runStorefrontOnlyCli)(projectName, flags);
|
|
110
|
-
await (0, scaffold_storefront_only_1.scaffoldStorefrontOnly)(options);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
const options = await (0, cli_1.runCli)(projectName, flags);
|
|
114
|
-
await (0, scaffolder_1.scaffold)(options);
|
|
115
|
-
});
|
|
116
|
-
program.parseAsync().catch((err) => {
|
|
117
|
-
console.error('Error:', err.message);
|
|
118
|
-
process.exit(1);
|
|
119
|
-
});
|
|
120
|
-
//# sourceMappingURL=run.js.map
|
|
2
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(){var n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},n(e)};return function(o){if(o&&o.__esModule)return o;var r={};if(null!=o)for(var i=n(o),a=0;a<i.length;a++)"default"!==i[a]&&e(r,o,i[a]);return t(r,o),r}}();Object.defineProperty(exports,"__esModule",{value:!0});const o=n(require("fs")),r=n(require("path")),i=require("commander"),a=require("../cli"),s=require("../scaffolder"),u=require("../scaffold-storefront-only"),l=require("../add-to-existing");function c(){const e=r.join(__dirname,"..","..","package.json");return JSON.parse(o.readFileSync(e,"utf8")).version}const p=(new i.Command).name("create-vendure-platform").description("Scaffold a Vendure project with Vendure Platform plugins, or a standalone storefront").version(c(),"-v, --version").enablePositionalOptions();p.command("add").description("Add Vendure Platform to an existing Vendure project (run from the project root)").option("--plugins <list>","Comma-separated list of plugin keys to include (skips the interactive prompt)").option("--registry-token <token>","Vendure private-registry npm auth token (written to project .npmrc as _authToken)").option("--license-token <token>","Vendure Platform server-side license token (written to .env as VENDURE_PLATFORM_LICENSE_TOKEN)").option("--dry-run","Show what would be changed without writing files").action(async e=>{const t=await(0,l.runAddToExistingCli)({plugins:e.plugins,dryRun:e.dryRun,registryToken:e.registryToken,licenseToken:e.licenseToken});await(0,l.addToExisting)(t)}),p.argument("[project-name]","Name of the project to create").option("--plugins <list>","Comma-separated list of plugin keys to include").option("--company <name>","Company name for the demo project").option("--no-storefront","Skip the Next.js storefront").option("--github","Create a GitHub repository").option("--github-org <org>","GitHub organization (only used with --github)","vendurehq").option("--no-github","Do not create a GitHub repository").option("--no-install","Skip dependency install").option("--no-git","Skip git init").option("--dry-run","Show what would be created without writing files").option("--storefront-only","Scaffold just the Next.js storefront, no server or plugins").option("--api-url <url>","Vendure Shop API URL (storefront-only mode)").option("--scenario <name>","Storefront scenario (storefront-only mode; default: customer)").option("--pm <bun|npm|pnpm>","Package manager used for the install step (default: bun)").option("--registry-token <token>","Vendure private-registry npm auth token (written to project .npmrc as _authToken)").option("--license-token <token>","Vendure Platform server-side license token (written to .env as VENDURE_PLATFORM_LICENSE_TOKEN)").action(async(e,t)=>{const n={plugins:t.plugins,company:t.company,storefront:t.storefront,github:t.github,githubOrg:t.githubOrg,install:t.install,git:t.git,dryRun:t.dryRun,storefrontOnly:t.storefrontOnly,apiUrl:t.apiUrl,scenario:t.scenario,pm:t.pm,registryToken:t.registryToken,licenseToken:t.licenseToken};if(n.storefrontOnly){const t=await(0,a.runStorefrontOnlyCli)(e,n);return void await(0,u.scaffoldStorefrontOnly)(t)}const o=await(0,a.runCli)(e,n);await(0,s.scaffold)(o)}),p.parseAsync().catch(e=>{console.error("Error:",e.message),process.exit(1)});
|