zapier-platform-cli 17.9.1 → 18.0.1
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/oclif.manifest.json +98 -98
- package/package.json +26 -26
- package/src/bin/run +24 -0
- package/src/constants.js +1 -1
- package/src/generators/index.js +91 -87
- package/src/generators/pull.js +34 -31
- package/src/oclif/commands/init.js +7 -3
- package/src/oclif/commands/invoke.js +1 -1
- package/src/oclif/commands/pull.js +4 -3
- package/src/oclif/hooks/updateNotifier.js +5 -3
- package/src/utils/build.js +5 -4
- package/src/utils/esm-wrapper.js +86 -0
- package/src/version-store.js +1 -0
- package/src/bin/run.cmd +0 -3
package/oclif.manifest.json
CHANGED
|
@@ -2176,9 +2176,9 @@
|
|
|
2176
2176
|
"unset.js"
|
|
2177
2177
|
]
|
|
2178
2178
|
},
|
|
2179
|
-
"
|
|
2179
|
+
"users:add": {
|
|
2180
2180
|
"aliases": [
|
|
2181
|
-
"
|
|
2181
|
+
"users:invite"
|
|
2182
2182
|
],
|
|
2183
2183
|
"args": {
|
|
2184
2184
|
"email": {
|
|
@@ -2186,28 +2186,24 @@
|
|
|
2186
2186
|
"name": "email",
|
|
2187
2187
|
"required": true
|
|
2188
2188
|
},
|
|
2189
|
-
"
|
|
2190
|
-
"description": "
|
|
2191
|
-
"name": "
|
|
2192
|
-
"options": [
|
|
2193
|
-
"admin",
|
|
2194
|
-
"collaborator",
|
|
2195
|
-
"subscriber"
|
|
2196
|
-
],
|
|
2197
|
-
"required": true
|
|
2198
|
-
},
|
|
2199
|
-
"message": {
|
|
2200
|
-
"description": "A message sent in the email to your team member, if you need to provide context. Wrap the message in quotes to ensure spaces get saved.",
|
|
2201
|
-
"name": "message"
|
|
2189
|
+
"version": {
|
|
2190
|
+
"description": "A version string (like 1.2.3). Optional, used only if you want to invite a user to a specific version instead of all versions.",
|
|
2191
|
+
"name": "version"
|
|
2202
2192
|
}
|
|
2203
2193
|
},
|
|
2204
|
-
"description": "Add a
|
|
2194
|
+
"description": "Add a user to some or all versions of your integration.\n\nWhen this command is run, we'll send an email to the user inviting them to try your integration. You can track the status of that invite using the `zapier users:get` command.\n\nInvited users will be able to see your integration's name, logo, and description. They'll also be able to create Zaps using any available triggers and actions.",
|
|
2205
2195
|
"examples": [
|
|
2206
|
-
"zapier
|
|
2207
|
-
"zapier
|
|
2208
|
-
"zapier team:add alfred@wayne.com subscriber \"Hey Alfred, check out this app.\""
|
|
2196
|
+
"zapier users:add bruce@wayne.com",
|
|
2197
|
+
"zapier users:add alfred@wayne.com 1.2.3"
|
|
2209
2198
|
],
|
|
2210
2199
|
"flags": {
|
|
2200
|
+
"force": {
|
|
2201
|
+
"char": "f",
|
|
2202
|
+
"description": "Skip confirmation. Useful for running programatically.",
|
|
2203
|
+
"name": "force",
|
|
2204
|
+
"allowNo": false,
|
|
2205
|
+
"type": "boolean"
|
|
2206
|
+
},
|
|
2211
2207
|
"debug": {
|
|
2212
2208
|
"char": "d",
|
|
2213
2209
|
"description": "Show extra debugging output.",
|
|
@@ -2224,7 +2220,7 @@
|
|
|
2224
2220
|
},
|
|
2225
2221
|
"hasDynamicHelp": false,
|
|
2226
2222
|
"hiddenAliases": [],
|
|
2227
|
-
"id": "
|
|
2223
|
+
"id": "users:add",
|
|
2228
2224
|
"pluginAlias": "zapier-platform-cli",
|
|
2229
2225
|
"pluginName": "zapier-platform-cli",
|
|
2230
2226
|
"pluginType": "core",
|
|
@@ -2236,16 +2232,16 @@
|
|
|
2236
2232
|
"src",
|
|
2237
2233
|
"oclif",
|
|
2238
2234
|
"commands",
|
|
2239
|
-
"
|
|
2235
|
+
"users",
|
|
2240
2236
|
"add.js"
|
|
2241
2237
|
]
|
|
2242
2238
|
},
|
|
2243
|
-
"
|
|
2239
|
+
"users:get": {
|
|
2244
2240
|
"aliases": [
|
|
2245
|
-
"
|
|
2241
|
+
"users:list"
|
|
2246
2242
|
],
|
|
2247
2243
|
"args": {},
|
|
2248
|
-
"description": "Get
|
|
2244
|
+
"description": "Get a list of users who have been invited to your integration.\n\nNote that this list of users is NOT a comprehensive list of everyone who is using your integration. It only includes users who were invited directly by email (using the `\u001b[36mzapier users:add\u001b[39m` command or the web UI). Users who joined by clicking links generated using the `\u001b[36mzapier user:links\u001b[39m` command won't show up here.",
|
|
2249
2245
|
"flags": {
|
|
2250
2246
|
"debug": {
|
|
2251
2247
|
"char": "d",
|
|
@@ -2279,7 +2275,7 @@
|
|
|
2279
2275
|
},
|
|
2280
2276
|
"hasDynamicHelp": false,
|
|
2281
2277
|
"hiddenAliases": [],
|
|
2282
|
-
"id": "
|
|
2278
|
+
"id": "users:get",
|
|
2283
2279
|
"pluginAlias": "zapier-platform-cli",
|
|
2284
2280
|
"pluginName": "zapier-platform-cli",
|
|
2285
2281
|
"pluginType": "core",
|
|
@@ -2291,16 +2287,14 @@
|
|
|
2291
2287
|
"src",
|
|
2292
2288
|
"oclif",
|
|
2293
2289
|
"commands",
|
|
2294
|
-
"
|
|
2290
|
+
"users",
|
|
2295
2291
|
"get.js"
|
|
2296
2292
|
]
|
|
2297
2293
|
},
|
|
2298
|
-
"
|
|
2299
|
-
"aliases": [
|
|
2300
|
-
"team:delete"
|
|
2301
|
-
],
|
|
2294
|
+
"users:links": {
|
|
2295
|
+
"aliases": [],
|
|
2302
2296
|
"args": {},
|
|
2303
|
-
"description": "
|
|
2297
|
+
"description": "Get a list of links that are used to invite users to your integration.",
|
|
2304
2298
|
"flags": {
|
|
2305
2299
|
"debug": {
|
|
2306
2300
|
"char": "d",
|
|
@@ -2309,6 +2303,22 @@
|
|
|
2309
2303
|
"allowNo": false,
|
|
2310
2304
|
"type": "boolean"
|
|
2311
2305
|
},
|
|
2306
|
+
"format": {
|
|
2307
|
+
"char": "f",
|
|
2308
|
+
"description": "Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.",
|
|
2309
|
+
"name": "format",
|
|
2310
|
+
"default": "table",
|
|
2311
|
+
"hasDynamicHelp": false,
|
|
2312
|
+
"multiple": false,
|
|
2313
|
+
"options": [
|
|
2314
|
+
"plain",
|
|
2315
|
+
"json",
|
|
2316
|
+
"raw",
|
|
2317
|
+
"row",
|
|
2318
|
+
"table"
|
|
2319
|
+
],
|
|
2320
|
+
"type": "option"
|
|
2321
|
+
},
|
|
2312
2322
|
"invokedFromAnotherCommand": {
|
|
2313
2323
|
"hidden": true,
|
|
2314
2324
|
"name": "invokedFromAnotherCommand",
|
|
@@ -2318,7 +2328,7 @@
|
|
|
2318
2328
|
},
|
|
2319
2329
|
"hasDynamicHelp": false,
|
|
2320
2330
|
"hiddenAliases": [],
|
|
2321
|
-
"id": "
|
|
2331
|
+
"id": "users:links",
|
|
2322
2332
|
"pluginAlias": "zapier-platform-cli",
|
|
2323
2333
|
"pluginName": "zapier-platform-cli",
|
|
2324
2334
|
"pluginType": "core",
|
|
@@ -2330,34 +2340,26 @@
|
|
|
2330
2340
|
"src",
|
|
2331
2341
|
"oclif",
|
|
2332
2342
|
"commands",
|
|
2333
|
-
"
|
|
2334
|
-
"
|
|
2343
|
+
"users",
|
|
2344
|
+
"links.js"
|
|
2335
2345
|
]
|
|
2336
2346
|
},
|
|
2337
|
-
"users:
|
|
2347
|
+
"users:remove": {
|
|
2338
2348
|
"aliases": [
|
|
2339
|
-
"users:
|
|
2349
|
+
"users:delete"
|
|
2340
2350
|
],
|
|
2341
2351
|
"args": {
|
|
2342
2352
|
"email": {
|
|
2343
|
-
"description": "The user to be
|
|
2353
|
+
"description": "The user to be removed.",
|
|
2344
2354
|
"name": "email",
|
|
2345
2355
|
"required": true
|
|
2346
|
-
},
|
|
2347
|
-
"version": {
|
|
2348
|
-
"description": "A version string (like 1.2.3). Optional, used only if you want to invite a user to a specific version instead of all versions.",
|
|
2349
|
-
"name": "version"
|
|
2350
2356
|
}
|
|
2351
2357
|
},
|
|
2352
|
-
"description": "
|
|
2353
|
-
"examples": [
|
|
2354
|
-
"zapier users:add bruce@wayne.com",
|
|
2355
|
-
"zapier users:add alfred@wayne.com 1.2.3"
|
|
2356
|
-
],
|
|
2358
|
+
"description": "Remove a user from all versions of your integration.\n\nWhen this command is run, their Zaps will immediately turn off. They won't be able to use your app again until they're re-invited or it has gone public. In practice, this command isn't run often as it's very disruptive to users.",
|
|
2357
2359
|
"flags": {
|
|
2358
2360
|
"force": {
|
|
2359
2361
|
"char": "f",
|
|
2360
|
-
"description": "
|
|
2362
|
+
"description": "Skips confirmation. Useful for running programatically.",
|
|
2361
2363
|
"name": "force",
|
|
2362
2364
|
"allowNo": false,
|
|
2363
2365
|
"type": "boolean"
|
|
@@ -2378,7 +2380,7 @@
|
|
|
2378
2380
|
},
|
|
2379
2381
|
"hasDynamicHelp": false,
|
|
2380
2382
|
"hiddenAliases": [],
|
|
2381
|
-
"id": "users:
|
|
2383
|
+
"id": "users:remove",
|
|
2382
2384
|
"pluginAlias": "zapier-platform-cli",
|
|
2383
2385
|
"pluginName": "zapier-platform-cli",
|
|
2384
2386
|
"pluginType": "core",
|
|
@@ -2391,15 +2393,40 @@
|
|
|
2391
2393
|
"oclif",
|
|
2392
2394
|
"commands",
|
|
2393
2395
|
"users",
|
|
2394
|
-
"
|
|
2396
|
+
"remove.js"
|
|
2395
2397
|
]
|
|
2396
2398
|
},
|
|
2397
|
-
"
|
|
2399
|
+
"team:add": {
|
|
2398
2400
|
"aliases": [
|
|
2399
|
-
"
|
|
2401
|
+
"team:invite"
|
|
2402
|
+
],
|
|
2403
|
+
"args": {
|
|
2404
|
+
"email": {
|
|
2405
|
+
"description": "The user to be invited. If they don't have a Zapier account, they'll be prompted to create one.",
|
|
2406
|
+
"name": "email",
|
|
2407
|
+
"required": true
|
|
2408
|
+
},
|
|
2409
|
+
"role": {
|
|
2410
|
+
"description": "The level the invited team member should be at. Admins can edit everything and get email updates. Collaborators have read-access to the app and get email updates. Subscribers only get email updates.",
|
|
2411
|
+
"name": "role",
|
|
2412
|
+
"options": [
|
|
2413
|
+
"admin",
|
|
2414
|
+
"collaborator",
|
|
2415
|
+
"subscriber"
|
|
2416
|
+
],
|
|
2417
|
+
"required": true
|
|
2418
|
+
},
|
|
2419
|
+
"message": {
|
|
2420
|
+
"description": "A message sent in the email to your team member, if you need to provide context. Wrap the message in quotes to ensure spaces get saved.",
|
|
2421
|
+
"name": "message"
|
|
2422
|
+
}
|
|
2423
|
+
},
|
|
2424
|
+
"description": "Add a team member to your integration.\n\nThese users come in three levels:\n\n * `admin`, who can edit everything about the integration\n * `collaborator`, who has read-only access for the app, and will receive periodic email updates. These updates include quarterly health scores and more.\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health scores and more.\n\nTeam members can be freely added and removed.",
|
|
2425
|
+
"examples": [
|
|
2426
|
+
"zapier team:add bruce@wayne.com admin",
|
|
2427
|
+
"zapier team:add robin@wayne.com collaborator \"Hey Robin, check out this app.\"",
|
|
2428
|
+
"zapier team:add alfred@wayne.com subscriber \"Hey Alfred, check out this app.\""
|
|
2400
2429
|
],
|
|
2401
|
-
"args": {},
|
|
2402
|
-
"description": "Get a list of users who have been invited to your integration.\n\nNote that this list of users is NOT a comprehensive list of everyone who is using your integration. It only includes users who were invited directly by email (using the `\u001b[36mzapier users:add\u001b[39m` command or the web UI). Users who joined by clicking links generated using the `\u001b[36mzapier user:links\u001b[39m` command won't show up here.",
|
|
2403
2430
|
"flags": {
|
|
2404
2431
|
"debug": {
|
|
2405
2432
|
"char": "d",
|
|
@@ -2408,22 +2435,6 @@
|
|
|
2408
2435
|
"allowNo": false,
|
|
2409
2436
|
"type": "boolean"
|
|
2410
2437
|
},
|
|
2411
|
-
"format": {
|
|
2412
|
-
"char": "f",
|
|
2413
|
-
"description": "Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.",
|
|
2414
|
-
"name": "format",
|
|
2415
|
-
"default": "table",
|
|
2416
|
-
"hasDynamicHelp": false,
|
|
2417
|
-
"multiple": false,
|
|
2418
|
-
"options": [
|
|
2419
|
-
"plain",
|
|
2420
|
-
"json",
|
|
2421
|
-
"raw",
|
|
2422
|
-
"row",
|
|
2423
|
-
"table"
|
|
2424
|
-
],
|
|
2425
|
-
"type": "option"
|
|
2426
|
-
},
|
|
2427
2438
|
"invokedFromAnotherCommand": {
|
|
2428
2439
|
"hidden": true,
|
|
2429
2440
|
"name": "invokedFromAnotherCommand",
|
|
@@ -2433,7 +2444,7 @@
|
|
|
2433
2444
|
},
|
|
2434
2445
|
"hasDynamicHelp": false,
|
|
2435
2446
|
"hiddenAliases": [],
|
|
2436
|
-
"id": "
|
|
2447
|
+
"id": "team:add",
|
|
2437
2448
|
"pluginAlias": "zapier-platform-cli",
|
|
2438
2449
|
"pluginName": "zapier-platform-cli",
|
|
2439
2450
|
"pluginType": "core",
|
|
@@ -2445,14 +2456,16 @@
|
|
|
2445
2456
|
"src",
|
|
2446
2457
|
"oclif",
|
|
2447
2458
|
"commands",
|
|
2448
|
-
"
|
|
2449
|
-
"
|
|
2459
|
+
"team",
|
|
2460
|
+
"add.js"
|
|
2450
2461
|
]
|
|
2451
2462
|
},
|
|
2452
|
-
"
|
|
2453
|
-
"aliases": [
|
|
2463
|
+
"team:get": {
|
|
2464
|
+
"aliases": [
|
|
2465
|
+
"team:list"
|
|
2466
|
+
],
|
|
2454
2467
|
"args": {},
|
|
2455
|
-
"description": "Get
|
|
2468
|
+
"description": "Get team members involved with your integration.\n\nThese users come in three levels:\n\n * `admin`, who can edit everything about the integration\n * `collaborator`, who has read-only access for the app, and will receive periodic email updates. These updates include quarterly health scores and more.\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health scores and more.\n\nUse the `zapier team:add` and `zapier team:remove` commands to modify your team.\n",
|
|
2456
2469
|
"flags": {
|
|
2457
2470
|
"debug": {
|
|
2458
2471
|
"char": "d",
|
|
@@ -2486,7 +2499,7 @@
|
|
|
2486
2499
|
},
|
|
2487
2500
|
"hasDynamicHelp": false,
|
|
2488
2501
|
"hiddenAliases": [],
|
|
2489
|
-
"id": "
|
|
2502
|
+
"id": "team:get",
|
|
2490
2503
|
"pluginAlias": "zapier-platform-cli",
|
|
2491
2504
|
"pluginName": "zapier-platform-cli",
|
|
2492
2505
|
"pluginType": "core",
|
|
@@ -2498,30 +2511,17 @@
|
|
|
2498
2511
|
"src",
|
|
2499
2512
|
"oclif",
|
|
2500
2513
|
"commands",
|
|
2501
|
-
"
|
|
2502
|
-
"
|
|
2514
|
+
"team",
|
|
2515
|
+
"get.js"
|
|
2503
2516
|
]
|
|
2504
2517
|
},
|
|
2505
|
-
"
|
|
2518
|
+
"team:remove": {
|
|
2506
2519
|
"aliases": [
|
|
2507
|
-
"
|
|
2520
|
+
"team:delete"
|
|
2508
2521
|
],
|
|
2509
|
-
"args": {
|
|
2510
|
-
|
|
2511
|
-
"description": "The user to be removed.",
|
|
2512
|
-
"name": "email",
|
|
2513
|
-
"required": true
|
|
2514
|
-
}
|
|
2515
|
-
},
|
|
2516
|
-
"description": "Remove a user from all versions of your integration.\n\nWhen this command is run, their Zaps will immediately turn off. They won't be able to use your app again until they're re-invited or it has gone public. In practice, this command isn't run often as it's very disruptive to users.",
|
|
2522
|
+
"args": {},
|
|
2523
|
+
"description": "Remove a team member from all versions of your integration.\n\nAdmins will immediately lose write access to the integration.\nCollaborators will immediately lose read access to the integration.\nSubscribers won't receive future email updates.",
|
|
2517
2524
|
"flags": {
|
|
2518
|
-
"force": {
|
|
2519
|
-
"char": "f",
|
|
2520
|
-
"description": "Skips confirmation. Useful for running programatically.",
|
|
2521
|
-
"name": "force",
|
|
2522
|
-
"allowNo": false,
|
|
2523
|
-
"type": "boolean"
|
|
2524
|
-
},
|
|
2525
2525
|
"debug": {
|
|
2526
2526
|
"char": "d",
|
|
2527
2527
|
"description": "Show extra debugging output.",
|
|
@@ -2538,7 +2538,7 @@
|
|
|
2538
2538
|
},
|
|
2539
2539
|
"hasDynamicHelp": false,
|
|
2540
2540
|
"hiddenAliases": [],
|
|
2541
|
-
"id": "
|
|
2541
|
+
"id": "team:remove",
|
|
2542
2542
|
"pluginAlias": "zapier-platform-cli",
|
|
2543
2543
|
"pluginName": "zapier-platform-cli",
|
|
2544
2544
|
"pluginType": "core",
|
|
@@ -2550,10 +2550,10 @@
|
|
|
2550
2550
|
"src",
|
|
2551
2551
|
"oclif",
|
|
2552
2552
|
"commands",
|
|
2553
|
-
"
|
|
2553
|
+
"team",
|
|
2554
2554
|
"remove.js"
|
|
2555
2555
|
]
|
|
2556
2556
|
}
|
|
2557
2557
|
},
|
|
2558
|
-
"version": "
|
|
2558
|
+
"version": "18.0.1"
|
|
2559
2559
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zapier-platform-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"description": "The CLI for managing integrations in Zapier Developer Platform.",
|
|
5
5
|
"repository": "zapier/zapier-platform",
|
|
6
6
|
"homepage": "https://platform.zapier.com/",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"/src/generators/",
|
|
14
14
|
"/src/oclif/",
|
|
15
15
|
"/src/bin/",
|
|
16
|
-
"/src/bin/run.cmd",
|
|
17
16
|
"/src/utils/",
|
|
18
17
|
"/scaffold/",
|
|
19
18
|
"/oclif.manifest.json"
|
|
@@ -40,58 +39,59 @@
|
|
|
40
39
|
"validate": "yarn test && yarn smoke-test && yarn lint"
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
|
-
"@oclif/core": "4.
|
|
44
|
-
"@oclif/plugin-autocomplete": "3.2.
|
|
45
|
-
"@oclif/plugin-help": "6.2.
|
|
46
|
-
"@oclif/plugin-not-found": "3.2.
|
|
47
|
-
"@oclif/plugin-version": "2.2.
|
|
42
|
+
"@oclif/core": "4.5.2",
|
|
43
|
+
"@oclif/plugin-autocomplete": "3.2.34",
|
|
44
|
+
"@oclif/plugin-help": "6.2.32",
|
|
45
|
+
"@oclif/plugin-not-found": "3.2.62",
|
|
46
|
+
"@oclif/plugin-version": "2.2.32",
|
|
48
47
|
"adm-zip": "0.5.16",
|
|
49
48
|
"archiver": "7.0.1",
|
|
50
|
-
"chrono-node": "2.8.
|
|
49
|
+
"chrono-node": "2.8.3",
|
|
51
50
|
"cli-table3": "0.6.5",
|
|
52
51
|
"colors": "1.4.0",
|
|
53
|
-
"debug": "4.4.
|
|
52
|
+
"debug": "4.4.1",
|
|
54
53
|
"decompress": "4.2.1",
|
|
55
|
-
"dotenv": "
|
|
56
|
-
"esbuild": "0.25.
|
|
57
|
-
"fs-extra": "11.
|
|
54
|
+
"dotenv": "17.2.1",
|
|
55
|
+
"esbuild": "0.25.8",
|
|
56
|
+
"fs-extra": "11.3.1",
|
|
58
57
|
"gulp-filter": "7.0.0",
|
|
59
58
|
"gulp-prettier": "5.0.0",
|
|
60
|
-
"ignore": "
|
|
59
|
+
"ignore": "7.0.5",
|
|
61
60
|
"inquirer": "8.2.5",
|
|
62
61
|
"jscodeshift": "^17.3.0",
|
|
63
62
|
"lodash": "4.17.21",
|
|
64
|
-
"luxon": "3.
|
|
65
|
-
"marked": "
|
|
66
|
-
"marked-terminal": "7.
|
|
67
|
-
"open": "10.
|
|
63
|
+
"luxon": "3.7.1",
|
|
64
|
+
"marked": "15.0.12",
|
|
65
|
+
"marked-terminal": "7.3.0",
|
|
66
|
+
"open": "10.2.0",
|
|
68
67
|
"ora": "5.4.0",
|
|
69
68
|
"parse-gitignore": "0.5.1",
|
|
70
|
-
"prettier": "3.
|
|
69
|
+
"prettier": "3.6.2",
|
|
71
70
|
"read": "4.1.0",
|
|
72
|
-
"semver": "7.7.
|
|
71
|
+
"semver": "7.7.2",
|
|
73
72
|
"string-length": "4.0.2",
|
|
74
73
|
"through2": "4.0.2",
|
|
75
74
|
"tmp": "0.2.4",
|
|
76
75
|
"traverse": "0.6.11",
|
|
77
|
-
"update-notifier": "
|
|
78
|
-
"yeoman-environment": "
|
|
79
|
-
"yeoman-generator": "5.
|
|
76
|
+
"update-notifier": "7.3.1",
|
|
77
|
+
"yeoman-environment": "4.4.3",
|
|
78
|
+
"yeoman-generator": "7.5.1"
|
|
80
79
|
},
|
|
81
80
|
"devDependencies": {
|
|
82
|
-
"@oclif/test": "^4.1.
|
|
81
|
+
"@oclif/test": "^4.1.13",
|
|
83
82
|
"@types/jscodeshift": "^0.12.0",
|
|
84
83
|
"@types/mocha": "^10.0.9",
|
|
85
84
|
"chai": "^4.3.7",
|
|
86
85
|
"mock-fs": "^5.5.0",
|
|
87
|
-
"nock": "^14.0.
|
|
88
|
-
"oclif": "^4.
|
|
86
|
+
"nock": "^14.0.7",
|
|
87
|
+
"oclif": "^4.22.5",
|
|
89
88
|
"rimraf": "^5.0.10",
|
|
90
89
|
"typescript": "^5.8.3",
|
|
91
90
|
"yamljs": "0.3.0"
|
|
92
91
|
},
|
|
93
92
|
"bin": {
|
|
94
|
-
"zapier": "./src/bin/run"
|
|
93
|
+
"zapier": "./src/bin/run",
|
|
94
|
+
"zapier-platform": "./src/bin/run"
|
|
95
95
|
},
|
|
96
96
|
"oclif": {
|
|
97
97
|
"commands": "src/oclif/commands",
|
package/src/bin/run
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
|
|
3
5
|
(async () => {
|
|
4
6
|
const oclif = await import('@oclif/core');
|
|
5
7
|
await oclif.execute({ development: false, dir: __dirname });
|
|
8
|
+
|
|
9
|
+
// Show deprecation warning for the old "zapier" binary name
|
|
10
|
+
// Users can suppress this warning by setting ZAPIER_SUPPRESS_DEPRECATION_WARNING
|
|
11
|
+
if (!process.env.ZAPIER_SUPPRESS_DEPRECATION_WARNING) {
|
|
12
|
+
const msg =
|
|
13
|
+
'The "zapier" command is deprecated and will be removed in a future version. ' +
|
|
14
|
+
'Please use "zapier-platform" instead.\n' +
|
|
15
|
+
'To suppress this warning, set ZAPIER_SUPPRESS_DEPRECATION_WARNING in your environment.\n';
|
|
16
|
+
|
|
17
|
+
if (process.platform === 'win32') {
|
|
18
|
+
// On Windows, we cannot reliably detect which wrapper was invoked (zapier vs zapier-platform)
|
|
19
|
+
// because both wrappers point to the same script. Show a generic deprecation notice instead of a warning..
|
|
20
|
+
console.warn('\n[DEPRECATION NOTICE] ' + msg);
|
|
21
|
+
} else {
|
|
22
|
+
// On Unix, we can detect which symlink was used
|
|
23
|
+
const scriptPath = process.argv[1] || '';
|
|
24
|
+
const binName = path.basename(scriptPath, path.extname(scriptPath));
|
|
25
|
+
if (binName === 'zapier') {
|
|
26
|
+
console.warn('\n[DEPRECATION WARNING] ' + msg);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
6
30
|
})();
|
package/src/constants.js
CHANGED
|
@@ -20,7 +20,7 @@ const BUILD_PATH = `${BUILD_DIR}/build.zip`;
|
|
|
20
20
|
const SOURCE_PATH = `${BUILD_DIR}/source.zip`;
|
|
21
21
|
const NODE_VERSION = versionStore[versionStore.length - 1].nodeVersion;
|
|
22
22
|
const LAMBDA_VERSION = `v${NODE_VERSION}`;
|
|
23
|
-
const NODE_VERSION_CLI_REQUIRES = '>=
|
|
23
|
+
const NODE_VERSION_CLI_REQUIRES = '>=22'; // should be the oldest non-ETL version
|
|
24
24
|
const AUTH_KEY = 'deployKey';
|
|
25
25
|
const ANALYTICS_KEY = 'analyticsMode';
|
|
26
26
|
const ANALYTICS_MODES = {
|
package/src/generators/index.js
CHANGED
|
@@ -2,12 +2,12 @@ const path = require('path');
|
|
|
2
2
|
|
|
3
3
|
const { merge } = require('lodash');
|
|
4
4
|
const filter = require('gulp-filter');
|
|
5
|
-
const
|
|
5
|
+
const { createGeneratorClass } = require('../utils/esm-wrapper');
|
|
6
6
|
const prettier = require('gulp-prettier');
|
|
7
7
|
|
|
8
8
|
const { PACKAGE_VERSION, PLATFORM_PACKAGE } = require('../constants');
|
|
9
9
|
const authFilesCodegen = require('../utils/auth-files-codegen');
|
|
10
|
-
const
|
|
10
|
+
const PullGeneratorPromise = require('./pull');
|
|
11
11
|
|
|
12
12
|
const writeGenericReadme = (gen) => {
|
|
13
13
|
gen.fs.copyTpl(
|
|
@@ -133,6 +133,7 @@ const writeGenericAuth = (gen) => {
|
|
|
133
133
|
const content = authFilesCodegen[authType](gen.options.language);
|
|
134
134
|
const destPath = (key) =>
|
|
135
135
|
gen.options.language === 'typescript' ? `src/${key}.ts` : `${key}.js`;
|
|
136
|
+
|
|
136
137
|
Object.entries(content).forEach(([key, value]) => {
|
|
137
138
|
gen.fs.write(gen.destinationPath(destPath(key)), value);
|
|
138
139
|
});
|
|
@@ -238,104 +239,107 @@ const TS_SUPPORTED_TEMPLATES = [
|
|
|
238
239
|
|
|
239
240
|
const TEMPLATE_CHOICES = Object.keys(TEMPLATE_ROUTES);
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
async prompting() {
|
|
255
|
-
if (!this.options.template) {
|
|
256
|
-
// Filter template choices based on language and module type
|
|
257
|
-
let templateChoices = TEMPLATE_CHOICES;
|
|
258
|
-
let defaultTemplate = 'minimal';
|
|
259
|
-
|
|
260
|
-
// TypeScript filtering takes precedence over ESM filtering
|
|
261
|
-
if (this.options.language === 'typescript') {
|
|
262
|
-
templateChoices = TS_SUPPORTED_TEMPLATES;
|
|
263
|
-
defaultTemplate = 'basic-auth';
|
|
264
|
-
} else if (this.options.module === 'esm') {
|
|
265
|
-
templateChoices = ESM_SUPPORTED_TEMPLATES;
|
|
266
|
-
defaultTemplate = 'minimal'; // minimal is the only ESM template
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
this.answers = await this.prompt([
|
|
270
|
-
{
|
|
271
|
-
type: 'list',
|
|
272
|
-
name: 'template',
|
|
273
|
-
choices: templateChoices,
|
|
274
|
-
message: 'Choose a project template to start with:',
|
|
275
|
-
default: defaultTemplate,
|
|
276
|
-
},
|
|
242
|
+
const ProjectGeneratorPromise = createGeneratorClass((Generator) => {
|
|
243
|
+
return class ProjectGenerator extends Generator {
|
|
244
|
+
initializing() {
|
|
245
|
+
this.sourceRoot(path.resolve(__dirname, 'templates'));
|
|
246
|
+
this.destinationRoot(path.resolve(this.options.path));
|
|
247
|
+
|
|
248
|
+
const jsFilter = filter(['*.js', '*.json', '*.ts'], { restore: true });
|
|
249
|
+
this.queueTransformStream([
|
|
250
|
+
{ disabled: true },
|
|
251
|
+
jsFilter,
|
|
252
|
+
prettier({ singleQuote: true }),
|
|
253
|
+
jsFilter.restore,
|
|
277
254
|
]);
|
|
278
|
-
this.options.template = this.answers.template;
|
|
279
255
|
}
|
|
280
256
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
257
|
+
async prompting() {
|
|
258
|
+
if (!this.options.template) {
|
|
259
|
+
// Filter template choices based on language and module type
|
|
260
|
+
let templateChoices = TEMPLATE_CHOICES;
|
|
261
|
+
let defaultTemplate = 'minimal';
|
|
262
|
+
|
|
263
|
+
// TypeScript filtering takes precedence over ESM filtering
|
|
264
|
+
if (this.options.language === 'typescript') {
|
|
265
|
+
templateChoices = TS_SUPPORTED_TEMPLATES;
|
|
266
|
+
defaultTemplate = 'basic-auth';
|
|
267
|
+
} else if (this.options.module === 'esm') {
|
|
268
|
+
templateChoices = ESM_SUPPORTED_TEMPLATES;
|
|
269
|
+
defaultTemplate = 'minimal'; // minimal is the only ESM template
|
|
270
|
+
}
|
|
296
271
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
'
|
|
303
|
-
|
|
304
|
-
|
|
272
|
+
this.answers = await this.prompt([
|
|
273
|
+
{
|
|
274
|
+
type: 'list',
|
|
275
|
+
name: 'template',
|
|
276
|
+
choices: templateChoices,
|
|
277
|
+
message: 'Choose a project template to start with:',
|
|
278
|
+
default: defaultTemplate,
|
|
279
|
+
},
|
|
280
|
+
]);
|
|
281
|
+
this.options.template = this.answers.template;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (
|
|
285
|
+
ESM_SUPPORTED_TEMPLATES.includes(this.options.template) &&
|
|
286
|
+
!this.options.module
|
|
287
|
+
) {
|
|
288
|
+
this.answers = await this.prompt([
|
|
289
|
+
{
|
|
290
|
+
type: 'list',
|
|
291
|
+
name: 'module',
|
|
292
|
+
choices: ['esm', 'commonjs'],
|
|
293
|
+
message: 'Choose module type:',
|
|
294
|
+
default: 'esm',
|
|
295
|
+
},
|
|
296
|
+
]);
|
|
297
|
+
this.options.module = this.answers.module;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (this.options.language) {
|
|
301
|
+
if (this.options.language === 'typescript') {
|
|
302
|
+
// check if the template supports typescript
|
|
303
|
+
if (!TS_SUPPORTED_TEMPLATES.includes(this.options.template)) {
|
|
304
|
+
throw new Error(
|
|
305
|
+
'Typescript is not supported for this template, please use a different template or set the language to javascript. Supported templates: ' +
|
|
306
|
+
TS_SUPPORTED_TEMPLATES.join(', '),
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
// if they try to combine typescript with commonjs, throw an error
|
|
310
|
+
if (this.options.module === 'commonjs') {
|
|
311
|
+
throw new Error('Typescript is not supported for commonjs');
|
|
312
|
+
} // esm is supported for typescript templates
|
|
305
313
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
} // esm is supported for typescript templates
|
|
314
|
+
} else {
|
|
315
|
+
// default to javascript for the language if it's not set
|
|
316
|
+
this.options.language = 'javascript';
|
|
310
317
|
}
|
|
311
|
-
} else {
|
|
312
|
-
// default to javascript for the language if it's not set
|
|
313
|
-
this.options.language = 'javascript';
|
|
314
|
-
}
|
|
315
318
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
319
|
+
if (
|
|
320
|
+
!ESM_SUPPORTED_TEMPLATES.includes(this.options.template) &&
|
|
321
|
+
this.options.module === 'esm' &&
|
|
322
|
+
this.options.language === 'javascript'
|
|
323
|
+
) {
|
|
324
|
+
throw new Error(
|
|
325
|
+
'ESM is not supported for this template, please use a different template, set the module to commonjs, or try setting the language to Typescript',
|
|
326
|
+
);
|
|
327
|
+
}
|
|
324
328
|
}
|
|
325
|
-
}
|
|
326
329
|
|
|
327
|
-
|
|
328
|
-
|
|
330
|
+
writing() {
|
|
331
|
+
this.options.packageName = path.basename(this.options.path);
|
|
329
332
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
333
|
+
const writeFunc = TEMPLATE_ROUTES[this.options.template];
|
|
334
|
+
writeFunc(this);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
});
|
|
334
338
|
|
|
335
339
|
module.exports = {
|
|
336
340
|
TEMPLATE_CHOICES,
|
|
337
341
|
ESM_SUPPORTED_TEMPLATES,
|
|
338
342
|
TS_SUPPORTED_TEMPLATES,
|
|
339
|
-
PullGenerator,
|
|
340
|
-
ProjectGenerator,
|
|
343
|
+
PullGenerator: PullGeneratorPromise,
|
|
344
|
+
ProjectGenerator: ProjectGeneratorPromise,
|
|
341
345
|
};
|
package/src/generators/pull.js
CHANGED
|
@@ -2,7 +2,7 @@ const colors = require('colors/safe');
|
|
|
2
2
|
const debug = require('debug')('zapier:pull');
|
|
3
3
|
const inquirer = require('inquirer');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const
|
|
5
|
+
const { createGeneratorClass } = require('../utils/esm-wrapper');
|
|
6
6
|
|
|
7
7
|
const maybeOverwriteFiles = async (gen) => {
|
|
8
8
|
const dstDir = gen.options.dstDir;
|
|
@@ -12,17 +12,19 @@ const maybeOverwriteFiles = async (gen) => {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// Export a factory function that creates the PullGenerator class
|
|
16
|
+
module.exports = createGeneratorClass((Generator) => {
|
|
17
|
+
return class PullGenerator extends Generator {
|
|
18
|
+
initializing() {
|
|
19
|
+
debug('SRC', this.options.sourceFiles);
|
|
20
|
+
}
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
prompting() {
|
|
23
|
+
const prompts = [
|
|
24
|
+
{
|
|
25
|
+
type: 'confirm',
|
|
26
|
+
name: 'confirm',
|
|
27
|
+
message: `Warning: You are about to overwrite existing files.
|
|
26
28
|
|
|
27
29
|
Before proceeding, please make sure you have saved your work. Consider creating a backup or saving your current state in a git branch.
|
|
28
30
|
|
|
@@ -30,23 +32,24 @@ If presented with a series of options ('ynarxdeiH'), you may
|
|
|
30
32
|
press Enter to view more details about each option. For example, 'x' will abort the process.
|
|
31
33
|
|
|
32
34
|
Do you want to continue?`,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
return inquirer.prompt(prompts).then((answers) => {
|
|
40
|
+
if (!answers.confirm) {
|
|
41
|
+
this.log(colors.green('zapier pull cancelled'));
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
writing() {
|
|
48
|
+
maybeOverwriteFiles(this);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
end() {
|
|
52
|
+
this.log(colors.green('zapier pull completed successfully'));
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
const { join } = require('path');
|
|
2
2
|
|
|
3
3
|
const { Args, Flags } = require('@oclif/core');
|
|
4
|
-
const
|
|
4
|
+
const { createEnv } = require('../../utils/esm-wrapper');
|
|
5
5
|
|
|
6
6
|
const BaseCommand = require('../ZapierBaseCommand');
|
|
7
7
|
const { buildFlags } = require('../buildFlags');
|
|
8
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
TEMPLATE_CHOICES,
|
|
10
|
+
ProjectGenerator: ProjectGeneratorPromise,
|
|
11
|
+
} = require('../../generators');
|
|
9
12
|
|
|
10
13
|
class InitCommand extends BaseCommand {
|
|
11
14
|
async perform() {
|
|
12
15
|
const { path } = this.args;
|
|
13
16
|
const { template, module, language } = this.flags;
|
|
14
17
|
|
|
15
|
-
const env =
|
|
18
|
+
const env = await createEnv(); // await needed because createEnv() uses dynamic import() for ESM-only yeoman-environment
|
|
19
|
+
const ProjectGenerator = await ProjectGeneratorPromise; // await needed because generator classes are now created via ESM dynamic import
|
|
16
20
|
env.registerStub(ProjectGenerator, 'zapier:integration');
|
|
17
21
|
|
|
18
22
|
await env.run('zapier:integration', { path, template, module, language });
|
|
@@ -1086,7 +1086,7 @@ class InvokeCommand extends BaseCommand {
|
|
|
1086
1086
|
async perform() {
|
|
1087
1087
|
let authId = this.flags['authentication-id'];
|
|
1088
1088
|
|
|
1089
|
-
const dotenvResult = dotenv.config({ override: true });
|
|
1089
|
+
const dotenvResult = dotenv.config({ override: true, quiet: true });
|
|
1090
1090
|
if (!authId && _.isEmpty(dotenvResult.parsed)) {
|
|
1091
1091
|
console.warn(
|
|
1092
1092
|
'The .env file does not exist or is empty. ' +
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const AdmZip = require('adm-zip');
|
|
2
2
|
const { ensureFileSync } = require('fs-extra');
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const
|
|
4
|
+
const { createEnv } = require('../../utils/esm-wrapper');
|
|
5
5
|
|
|
6
6
|
const ZapierBaseCommand = require('../ZapierBaseCommand');
|
|
7
7
|
const { downloadSourceZip } = require('../../utils/api');
|
|
8
8
|
const { ensureDir, makeTempDir, removeDirSync } = require('../../utils/files');
|
|
9
9
|
const { walkDirWithPresetBlocklist } = require('../../utils/build');
|
|
10
10
|
const { buildFlags } = require('../buildFlags');
|
|
11
|
-
const
|
|
11
|
+
const PullGeneratorPromise = require('../../generators/pull');
|
|
12
12
|
|
|
13
13
|
const listFiles = (dir) => {
|
|
14
14
|
const relPaths = [];
|
|
@@ -38,7 +38,8 @@ class PullCommand extends ZapierBaseCommand {
|
|
|
38
38
|
const currentDir = process.cwd();
|
|
39
39
|
const sourceFiles = listFiles(srcDst);
|
|
40
40
|
|
|
41
|
-
const env =
|
|
41
|
+
const env = await createEnv(); // await needed because createEnv() uses dynamic import() for ESM-only yeoman-environment
|
|
42
|
+
const PullGenerator = await PullGeneratorPromise; // await needed because generator classes are now created via ESM dynamic import
|
|
42
43
|
const namespace = 'zapier:pull';
|
|
43
44
|
env.registerStub(PullGenerator, namespace);
|
|
44
45
|
await env.run(namespace, {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { createUpdateNotifier } = require('../../utils/esm-wrapper');
|
|
2
2
|
const pkg = require('../../../package.json');
|
|
3
3
|
const { UPDATE_NOTIFICATION_INTERVAL } = require('../../constants');
|
|
4
4
|
|
|
5
5
|
// can't be fat arrow because it inherits `this` from commands
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// Made async because createUpdateNotifier() uses dynamic import() to load ESM-only update-notifier package
|
|
7
|
+
module.exports = async function (options) {
|
|
8
|
+
const notifier = await createUpdateNotifier({
|
|
9
|
+
// await needed for ESM dynamic import
|
|
8
10
|
pkg,
|
|
9
11
|
updateCheckInterval: UPDATE_NOTIFICATION_INTERVAL,
|
|
10
12
|
});
|
package/src/utils/build.js
CHANGED
|
@@ -11,7 +11,7 @@ const archiver = require('archiver');
|
|
|
11
11
|
const colors = require('colors/safe');
|
|
12
12
|
const esbuild = require('esbuild');
|
|
13
13
|
const fse = require('fs-extra');
|
|
14
|
-
const
|
|
14
|
+
const { createUpdateNotifier } = require('./esm-wrapper');
|
|
15
15
|
const decompress = require('decompress');
|
|
16
16
|
|
|
17
17
|
const {
|
|
@@ -468,7 +468,8 @@ const makeSourceZip = async (workingDir, zipPath) => {
|
|
|
468
468
|
await zip.finish();
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
const maybeNotifyAboutOutdated = () => {
|
|
471
|
+
const maybeNotifyAboutOutdated = async () => {
|
|
472
|
+
// Made async because createUpdateNotifier() uses dynamic import() to load ESM-only update-notifier package
|
|
472
473
|
// find a package.json for the app and notify on the core dep
|
|
473
474
|
// `build` won't run if package.json isn't there, so if we get to here we're good
|
|
474
475
|
const requiredVersion = _.get(
|
|
@@ -477,7 +478,7 @@ const maybeNotifyAboutOutdated = () => {
|
|
|
477
478
|
);
|
|
478
479
|
|
|
479
480
|
if (requiredVersion) {
|
|
480
|
-
const notifier =
|
|
481
|
+
const notifier = await createUpdateNotifier({
|
|
481
482
|
pkg: { name: PLATFORM_PACKAGE, version: requiredVersion },
|
|
482
483
|
updateCheckInterval: UPDATE_NOTIFICATION_INTERVAL,
|
|
483
484
|
});
|
|
@@ -603,7 +604,7 @@ const _buildFunc = async (
|
|
|
603
604
|
const maybeEndSpinner = printProgress ? endSpinner : () => {};
|
|
604
605
|
|
|
605
606
|
if (checkOutdated) {
|
|
606
|
-
maybeNotifyAboutOutdated();
|
|
607
|
+
await maybeNotifyAboutOutdated(); // await needed because function is now async due to ESM import
|
|
607
608
|
}
|
|
608
609
|
const appDir = process.cwd();
|
|
609
610
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommonJS wrapper for ESM-only modules
|
|
3
|
+
* This allows us to use yeoman-environment v4+, yeoman-generator v7+, and update-notifier v7+ from CommonJS code without downgrading
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
let yeomanEnvironment = null;
|
|
7
|
+
let yeomanGenerator = null;
|
|
8
|
+
let updateNotifier = null;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Lazy-load yeoman-environment using dynamic import
|
|
12
|
+
* @returns {Promise<Object>} The yeoman-environment module
|
|
13
|
+
*/
|
|
14
|
+
async function getYeomanEnvironment() {
|
|
15
|
+
if (!yeomanEnvironment) {
|
|
16
|
+
yeomanEnvironment = await import('yeoman-environment');
|
|
17
|
+
}
|
|
18
|
+
return yeomanEnvironment;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Lazy-load yeoman-generator using dynamic import
|
|
23
|
+
* @returns {Promise<Object>} The yeoman-generator module
|
|
24
|
+
*/
|
|
25
|
+
async function getYeomanGenerator() {
|
|
26
|
+
if (!yeomanGenerator) {
|
|
27
|
+
yeomanGenerator = await import('yeoman-generator');
|
|
28
|
+
}
|
|
29
|
+
return yeomanGenerator;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Lazy-load update-notifier using dynamic import
|
|
34
|
+
* @returns {Promise<Object>} The update-notifier module
|
|
35
|
+
*/
|
|
36
|
+
async function getUpdateNotifier() {
|
|
37
|
+
if (!updateNotifier) {
|
|
38
|
+
updateNotifier = await import('update-notifier');
|
|
39
|
+
}
|
|
40
|
+
return updateNotifier;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Create a yeoman environment (async version of yeoman.createEnv())
|
|
45
|
+
* @param {Object} options - Environment options
|
|
46
|
+
* @returns {Promise<Object>} Environment instance
|
|
47
|
+
*/
|
|
48
|
+
async function createEnv(options) {
|
|
49
|
+
const yeoman = await getYeomanEnvironment();
|
|
50
|
+
return yeoman.createEnv(options);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get the Generator class (async version of require('yeoman-generator'))
|
|
55
|
+
* @returns {Promise<Function>} The Generator class
|
|
56
|
+
*/
|
|
57
|
+
async function getGenerator() {
|
|
58
|
+
const yeomanGen = await getYeomanGenerator();
|
|
59
|
+
return yeomanGen.default;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Create a generator class factory that extends the yeoman Generator
|
|
64
|
+
* @param {Function} generatorFactory - A function that takes Generator class and returns a class extending it
|
|
65
|
+
* @returns {Promise<Function>} The generated class
|
|
66
|
+
*/
|
|
67
|
+
async function createGeneratorClass(generatorFactory) {
|
|
68
|
+
const Generator = await getGenerator();
|
|
69
|
+
return generatorFactory(Generator);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Create an update notifier (async version of require('update-notifier'))
|
|
74
|
+
* @param {Object} options - Update notifier options (pkg, updateCheckInterval, etc.)
|
|
75
|
+
* @returns {Promise<Object>} Update notifier instance
|
|
76
|
+
*/
|
|
77
|
+
async function createUpdateNotifier(options) {
|
|
78
|
+
const updateNotifierModule = await getUpdateNotifier();
|
|
79
|
+
return updateNotifierModule.default(options);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = {
|
|
83
|
+
createEnv,
|
|
84
|
+
createGeneratorClass,
|
|
85
|
+
createUpdateNotifier,
|
|
86
|
+
};
|
package/src/version-store.js
CHANGED
package/src/bin/run.cmd
DELETED