@swell/cli 2.9.0 → 2.9.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.
package/dist/lib/apps/index.js
CHANGED
|
@@ -354,8 +354,11 @@ export function appAssetImage(appPath, fileName) {
|
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
+
function getNameFromFilePath(filePath) {
|
|
358
|
+
return path.parse(filePath).name.replaceAll('_', '-');
|
|
359
|
+
}
|
|
357
360
|
export function appConfigFromFile(filePath, configType, appPath) {
|
|
358
|
-
const
|
|
361
|
+
const name = getNameFromFilePath(filePath);
|
|
359
362
|
// Notification basenames must not contain dots: the inspect identifier
|
|
360
363
|
// grammar (app.<slug>.<model>.<name>) splits on '.', so a dotted name
|
|
361
364
|
// would silently misparse on lookup.
|
|
@@ -376,7 +379,7 @@ export function appConfigFromFile(filePath, configType, appPath) {
|
|
|
376
379
|
return config;
|
|
377
380
|
}
|
|
378
381
|
export function findAppConfig(app, filePath, configType) {
|
|
379
|
-
const
|
|
382
|
+
const name = getNameFromFilePath(filePath);
|
|
380
383
|
const config = app?.configs?.find((c) => c && c.type === configType && c.name === name);
|
|
381
384
|
return config;
|
|
382
385
|
}
|
|
@@ -26,7 +26,11 @@ async function request(originalRequest, _env, context) {
|
|
|
26
26
|
catch (error) {
|
|
27
27
|
// Log the error for Swell
|
|
28
28
|
console.error(error);
|
|
29
|
-
|
|
29
|
+
const errorBody = {
|
|
30
|
+
...(error.body ?? { error: error.message }),
|
|
31
|
+
retry: error.retry === false ? false : undefined,
|
|
32
|
+
};
|
|
33
|
+
response = new SwellResponse(errorBody, { status: error.status || 500 });
|
|
30
34
|
}
|
|
31
35
|
return SwellResponse._respond(req, response, context);
|
|
32
36
|
}
|
|
@@ -392,6 +396,7 @@ class SwellError extends Error {
|
|
|
392
396
|
this.status = options.status || 500;
|
|
393
397
|
this.body = body;
|
|
394
398
|
this.code = options.code || body?.error?.code;
|
|
399
|
+
this.retry = options.retry;
|
|
395
400
|
}
|
|
396
401
|
get isRetryable() {
|
|
397
402
|
return RETRYABLE_CODES.has(this.code);
|
package/oclif.manifest.json
CHANGED
|
@@ -809,7 +809,7 @@
|
|
|
809
809
|
"name": "versions"
|
|
810
810
|
}
|
|
811
811
|
},
|
|
812
|
-
"description": "The command shows the latest information about your app including the name,\ndescription, version, public ID, test store, and more. If the
|
|
812
|
+
"description": "The command shows the latest information about your app including the name,\ndescription, version, public ID, test store, and more. If the versions argument is passed,\nit will output all versions of the app instead.",
|
|
813
813
|
"examples": [
|
|
814
814
|
{
|
|
815
815
|
"command": "swell app info",
|
|
@@ -1108,7 +1108,7 @@
|
|
|
1108
1108
|
"name": "targetPath"
|
|
1109
1109
|
}
|
|
1110
1110
|
},
|
|
1111
|
-
"description": "Pull all app files, a specific file, or a specific configuration\ntype from an app in your store's test environment to your local machine.\n\nIf APPID is not specified, you will be prompted with a list of apps to choose from.\n\nApp file directories:\
|
|
1111
|
+
"description": "Pull all app files, a specific file, or a specific configuration\ntype from an app in your store's test environment to your local machine.\n\nIf APPID is not specified, you will be prompted with a list of apps to choose from.\n\nApp file directories:\nassets/\ncontent/\nfrontend/\ncomponents/\nfunctions/\nmodels/\nnotifications/\nsettings/\ntheme/\nwebhooks/\nfrontend/",
|
|
1112
1112
|
"examples": [
|
|
1113
1113
|
"swell app pull",
|
|
1114
1114
|
"swell app pull example_app",
|
|
@@ -1157,7 +1157,7 @@
|
|
|
1157
1157
|
"name": "file"
|
|
1158
1158
|
}
|
|
1159
1159
|
},
|
|
1160
|
-
"description": "Push all app files, a specific file, or a specific configuration\ntype to an app in your store's test environment.\n\nIf the app does not exist, it will be created and its global ID saved to a .swellrc file.\n\n- If no file is specified, all configuration files will be pushed to the store.\n This includes the app icon (assets/icon.png) and swell.json.\n- If a file is specified, only that file will be pushed to the store.\n- If a directory is specified, only files in that directory will be pushed.\n\nApp file directories:\
|
|
1160
|
+
"description": "Push all app files, a specific file, or a specific configuration\ntype to an app in your store's test environment.\n\nIf the app does not exist, it will be created and its global ID saved to a .swellrc file.\n\n- If no file is specified, all configuration files will be pushed to the store.\n This includes the app icon (assets/icon.png) and swell.json.\n- If a file is specified, only that file will be pushed to the store.\n- If a directory is specified, only files in that directory will be pushed.\n\nApp file directories:\nassets/\ncontent/\nfrontend/\ncomponents/\nfunctions/\nmodels/\nnotifications/\nsettings/\ntheme/\nwebhooks/",
|
|
1161
1161
|
"examples": [
|
|
1162
1162
|
"swell app push",
|
|
1163
1163
|
"swell app push content",
|
|
@@ -3072,7 +3072,7 @@
|
|
|
3072
3072
|
"name": "targetPath"
|
|
3073
3073
|
}
|
|
3074
3074
|
},
|
|
3075
|
-
"description": "Pull all theme files, a specific file, or a specific configuration\ntype from a theme in your store's test environment to your local machine.\n\nIf APPID is not specified, you will be prompted with a list of themes to choose from.\n\nTheme file directories:\
|
|
3075
|
+
"description": "Pull all theme files, a specific file, or a specific configuration\ntype from a theme in your store's test environment to your local machine.\n\nIf APPID is not specified, you will be prompted with a list of themes to choose from.\n\nTheme file directories:\nassets/\ntheme/",
|
|
3076
3076
|
"examples": [
|
|
3077
3077
|
"swell theme pull",
|
|
3078
3078
|
"swell theme pull mytheme",
|
|
@@ -3143,7 +3143,7 @@
|
|
|
3143
3143
|
"name": "file"
|
|
3144
3144
|
}
|
|
3145
3145
|
},
|
|
3146
|
-
"description": "Push all theme files, a specific file, or a specific configuration\ntype to an theme in your store's test environment.\n\nIf the theme does not exist, it will be created and its global ID saved to a .swellrc file.\n\n- If no file is specified, all configuration files will be pushed to the store.\n This includes the theme icon (assets/icon.png) and swell.json.\n- If a file is specified, only that file will be pushed to the store.\n- If a directory is specified, only files in that directory will be pushed.\n\nTheme file directories:\
|
|
3146
|
+
"description": "Push all theme files, a specific file, or a specific configuration\ntype to an theme in your store's test environment.\n\nIf the theme does not exist, it will be created and its global ID saved to a .swellrc file.\n\n- If no file is specified, all configuration files will be pushed to the store.\n This includes the theme icon (assets/icon.png) and swell.json.\n- If a file is specified, only that file will be pushed to the store.\n- If a directory is specified, only files in that directory will be pushed.\n\nTheme file directories:\nassets/\ntheme/",
|
|
3147
3147
|
"examples": [
|
|
3148
3148
|
"swell theme push",
|
|
3149
3149
|
"swell theme push assets",
|
|
@@ -3378,5 +3378,5 @@
|
|
|
3378
3378
|
]
|
|
3379
3379
|
}
|
|
3380
3380
|
},
|
|
3381
|
-
"version": "2.9.
|
|
3381
|
+
"version": "2.9.2"
|
|
3382
3382
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swell/cli",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Swell's command line interface/utility",
|
|
6
6
|
"keywords": [
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
117
117
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
118
118
|
"posttest": "npm run lint",
|
|
119
|
-
"prepack": "npm run build && oclif manifest && oclif readme",
|
|
119
|
+
"prepack": "npm run build && oclif manifest && NODE_ENV=production oclif readme",
|
|
120
120
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
121
121
|
"publish-alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha"
|
|
122
122
|
},
|