@commercetools-frontend/application-cli 1.5.0 → 1.6.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/README.md
CHANGED
|
@@ -46,7 +46,7 @@ The above configuration would compile for two environments in `gcp-production-us
|
|
|
46
46
|
- upload-assets-merchant-center-asia.sh
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
1. The `upload-index.sh` and `upload-assets-<bucket>.sh` scripts are generated pre-configured bash scripts for uploading the `application.html` and static assets to the respective storage bucket using `
|
|
49
|
+
1. The `upload-index.sh` and `upload-assets-<bucket>.sh` scripts are generated pre-configured bash scripts for uploading the `application.html` and static assets to the respective storage bucket using `gcloud storage`.
|
|
50
50
|
2. The `public` folder contains shared static assets for all environments.
|
|
51
51
|
3. The `application.html` references the static assets from its respective environment's bucket
|
|
52
52
|
|
|
@@ -74,7 +74,7 @@ function createApplicationIndexUploadScript(_ref) {
|
|
|
74
74
|
buildRevision = _ref.buildRevision,
|
|
75
75
|
buildNumber = _ref.buildNumber,
|
|
76
76
|
applicationIndexOutFile = _ref.applicationIndexOutFile;
|
|
77
|
-
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = _concatInstanceProperty__default["default"](_context7 = _concatInstanceProperty__default["default"](_context8 = _concatInstanceProperty__default["default"](_context9 = _concatInstanceProperty__default["default"](_context10 = "#!/usr/bin/env bash\n\nset -e\n\necho \"Uploading compiled ".concat(applicationIndexOutFile, " to bucket ")).call(_context10, bucketUrl, "\"\
|
|
77
|
+
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = _concatInstanceProperty__default["default"](_context7 = _concatInstanceProperty__default["default"](_context8 = _concatInstanceProperty__default["default"](_context9 = _concatInstanceProperty__default["default"](_context10 = "#!/usr/bin/env bash\n\nset -e\n\necho \"Uploading compiled ".concat(applicationIndexOutFile, " to bucket ")).call(_context10, bucketUrl, "\"\ngcloud storage cp \\\n \"$(dirname \"$0\")/")).call(_context9, applicationIndexOutFile, "\" \\\n \"")).call(_context8, bucketUrl, "/\" \\\n -z html \\\n --content-type=\"text/html\" \\\n --cache-control=\"public,max-age=0,no-transform\"\n\necho \"Creating version.json and uploading it to bucket ")).call(_context7, bucketUrl, "\"\n\nNODE_ENV=production ")).call(_context6, packageManagerName, " application-cli create-version \\\n --version-url=")).call(_context5, cdnUrl, "/")).call(_context4, cloudEnvironment, "/version.json \\\n --build-revision=")).call(_context3, buildRevision, " \\\n --build-number=")).call(_context2, buildNumber, " \\\n --out-file=$(dirname \"$0\")/version.json\n\ngcloud storage cp \\\n \"$(dirname \"$0\")/version.json\" \\\n \"")).call(_context, bucketUrl, "/\" \\\n -z json \\\n --content-type=\"application/json\" \\\n --cache-control=\"public,max-age=0,no-transform\"\n");
|
|
78
78
|
return uploadScriptContent;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -83,7 +83,7 @@ function createApplicationAssetsUploadScript(_ref) {
|
|
|
83
83
|
let bucketUrl = _ref.bucketUrl,
|
|
84
84
|
assetsPath = _ref.assetsPath,
|
|
85
85
|
skipMenu = _ref.skipMenu;
|
|
86
|
-
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = "#!/usr/bin/env bash\n\nset -e\n\n# NOTES:\n# https://cloud.google.com/
|
|
86
|
+
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = "#!/usr/bin/env bash\n\nset -e\n\n# NOTES:\n# https://cloud.google.com/sdk/gcloud/reference/storage/cp\n# 1. The '-z' option triggers compressing the assets before\n# uploading them and sets the 'Content-Encoding' to 'gzip'.\n# 2. The 'Accept-encoding: gzip' is set automatically by the 'gcloud storage'.\n# 3. The 'max-age' is set to 1 year which is considered the maximum\n# \"valid\" lifetime of an asset to be cached.\n# 4. The '-n' will skip uploading existing files and prevents them to\n# be overwritten\necho \"Uploading static assets to bucket ".concat(bucketUrl, "\"\n\ngcloud storage cp \\\n ")).call(_context6, assetsPath, "/public/{*.css,*.js,*.js.map,*.png,*.html,robots.txt} \\\n \"")).call(_context5, bucketUrl, "\" \\\n -n \\\n -z js,css \\\n --cache-control=\"public,max-age=31536000,no-transform\"\n\nif ")).call(_context4, skipMenu, "; then\n echo \"Skipping menu.json upload\"\nelse\n echo \"Uploading menu.json to bucket ")).call(_context3, bucketUrl, "\"\n # NOTE: somehow the 'cache-control:private' doesn't work.\n # I mean, the file is uploaded with the correct metadata but when I fetch\n # the file the response contains the header\n # 'cache-control: public,max-age=31536000,no-transform', even though the\n # documentation clearly states that by marking the header as 'private' will\n # disable the cache (for publicly readable objects).\n # https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata#cache-control\n # However, I found out that, by requesting the file with any RANDOM\n # query parameter, will instruct the storage to return a 'fresh' object\n # (without any cache control).\n # Unofficial source: https://stackoverflow.com/a/49052895\n # This seems to be the 'easiest' option to 'disable' the cache for public\n # objects. Other alternative approaces are:\n # * make the object private with some simple ACL (private objects are not cached)\n # * suffix the file name with e.g. the git SHA, so we have different files\n # for each upload ('index.html.template-${CIRCLE_SHA1}'). The server knows\n # the git SHA on runtime and can get the correct file when it starts.\n # * find out why the 'private' cache control does not work\n gcloud storage cp \\\n ")).call(_context2, assetsPath, "/menu.json \\\n ")).call(_context, bucketUrl, " \\\n -z json \\\n --content-type=\"application/json\" \\\n --cache-control=\"public,max-age=0,no-transform\"\nfi\n");
|
|
87
87
|
return uploadScriptContent;
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -277,7 +277,7 @@ async function compileEnvironmentApplicationIndexes(_ref6) {
|
|
|
277
277
|
buildNumber: cliFlags.buildNumber,
|
|
278
278
|
applicationIndexOutFile: cliFlags.applicationIndexOutFile
|
|
279
279
|
});
|
|
280
|
-
// Generate bash scripts to run the `
|
|
280
|
+
// Generate bash scripts to run the `gcloud storage` upload command.
|
|
281
281
|
|
|
282
282
|
writeUploadScriptFile({
|
|
283
283
|
fileName: cliFlags.applicationIndexUploadScriptOutFile,
|
|
@@ -619,7 +619,7 @@ async function command(cliFlags) {
|
|
|
619
619
|
|
|
620
620
|
var pkgJson = {
|
|
621
621
|
name: "@commercetools-frontend/application-cli",
|
|
622
|
-
version: "1.
|
|
622
|
+
version: "1.6.0",
|
|
623
623
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
624
624
|
keywords: [
|
|
625
625
|
"commercetools",
|
|
@@ -644,22 +644,22 @@ var pkgJson = {
|
|
|
644
644
|
"@babel/core": "^7.21.0",
|
|
645
645
|
"@babel/runtime": "^7.21.0",
|
|
646
646
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
647
|
-
"@commercetools-frontend/application-config": "22.
|
|
648
|
-
"@commercetools-frontend/constants": "22.
|
|
649
|
-
"@manypkg/find-root": "2.
|
|
647
|
+
"@commercetools-frontend/application-config": "22.3.0",
|
|
648
|
+
"@commercetools-frontend/constants": "22.3.0",
|
|
649
|
+
"@manypkg/find-root": "2.2.0",
|
|
650
650
|
cac: "^6.7.14",
|
|
651
|
-
cosmiconfig: "8.
|
|
652
|
-
dotenv: "16.
|
|
651
|
+
cosmiconfig: "8.2.0",
|
|
652
|
+
dotenv: "16.3.1",
|
|
653
653
|
execa: "5.1.1",
|
|
654
654
|
jsonschema: "^1.4.1",
|
|
655
655
|
listr2: "^6.4.2",
|
|
656
|
-
"node-fetch": "2.6.
|
|
656
|
+
"node-fetch": "2.6.11"
|
|
657
657
|
},
|
|
658
658
|
devDependencies: {
|
|
659
659
|
"@tsconfig/node18": "1.0.3",
|
|
660
|
-
"@types/node": "18.
|
|
661
|
-
"@types/node-fetch": "2.6.
|
|
662
|
-
typescript: "^
|
|
660
|
+
"@types/node": "18.16.18",
|
|
661
|
+
"@types/node-fetch": "2.6.2",
|
|
662
|
+
typescript: "^5.1.3"
|
|
663
663
|
},
|
|
664
664
|
engines: {
|
|
665
665
|
node: ">=14",
|
|
@@ -74,7 +74,7 @@ function createApplicationIndexUploadScript(_ref) {
|
|
|
74
74
|
buildRevision = _ref.buildRevision,
|
|
75
75
|
buildNumber = _ref.buildNumber,
|
|
76
76
|
applicationIndexOutFile = _ref.applicationIndexOutFile;
|
|
77
|
-
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = _concatInstanceProperty__default["default"](_context7 = _concatInstanceProperty__default["default"](_context8 = _concatInstanceProperty__default["default"](_context9 = _concatInstanceProperty__default["default"](_context10 = "#!/usr/bin/env bash\n\nset -e\n\necho \"Uploading compiled ".concat(applicationIndexOutFile, " to bucket ")).call(_context10, bucketUrl, "\"\
|
|
77
|
+
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = _concatInstanceProperty__default["default"](_context7 = _concatInstanceProperty__default["default"](_context8 = _concatInstanceProperty__default["default"](_context9 = _concatInstanceProperty__default["default"](_context10 = "#!/usr/bin/env bash\n\nset -e\n\necho \"Uploading compiled ".concat(applicationIndexOutFile, " to bucket ")).call(_context10, bucketUrl, "\"\ngcloud storage cp \\\n \"$(dirname \"$0\")/")).call(_context9, applicationIndexOutFile, "\" \\\n \"")).call(_context8, bucketUrl, "/\" \\\n -z html \\\n --content-type=\"text/html\" \\\n --cache-control=\"public,max-age=0,no-transform\"\n\necho \"Creating version.json and uploading it to bucket ")).call(_context7, bucketUrl, "\"\n\nNODE_ENV=production ")).call(_context6, packageManagerName, " application-cli create-version \\\n --version-url=")).call(_context5, cdnUrl, "/")).call(_context4, cloudEnvironment, "/version.json \\\n --build-revision=")).call(_context3, buildRevision, " \\\n --build-number=")).call(_context2, buildNumber, " \\\n --out-file=$(dirname \"$0\")/version.json\n\ngcloud storage cp \\\n \"$(dirname \"$0\")/version.json\" \\\n \"")).call(_context, bucketUrl, "/\" \\\n -z json \\\n --content-type=\"application/json\" \\\n --cache-control=\"public,max-age=0,no-transform\"\n");
|
|
78
78
|
return uploadScriptContent;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -83,7 +83,7 @@ function createApplicationAssetsUploadScript(_ref) {
|
|
|
83
83
|
let bucketUrl = _ref.bucketUrl,
|
|
84
84
|
assetsPath = _ref.assetsPath,
|
|
85
85
|
skipMenu = _ref.skipMenu;
|
|
86
|
-
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = "#!/usr/bin/env bash\n\nset -e\n\n# NOTES:\n# https://cloud.google.com/
|
|
86
|
+
const uploadScriptContent = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = "#!/usr/bin/env bash\n\nset -e\n\n# NOTES:\n# https://cloud.google.com/sdk/gcloud/reference/storage/cp\n# 1. The '-z' option triggers compressing the assets before\n# uploading them and sets the 'Content-Encoding' to 'gzip'.\n# 2. The 'Accept-encoding: gzip' is set automatically by the 'gcloud storage'.\n# 3. The 'max-age' is set to 1 year which is considered the maximum\n# \"valid\" lifetime of an asset to be cached.\n# 4. The '-n' will skip uploading existing files and prevents them to\n# be overwritten\necho \"Uploading static assets to bucket ".concat(bucketUrl, "\"\n\ngcloud storage cp \\\n ")).call(_context6, assetsPath, "/public/{*.css,*.js,*.js.map,*.png,*.html,robots.txt} \\\n \"")).call(_context5, bucketUrl, "\" \\\n -n \\\n -z js,css \\\n --cache-control=\"public,max-age=31536000,no-transform\"\n\nif ")).call(_context4, skipMenu, "; then\n echo \"Skipping menu.json upload\"\nelse\n echo \"Uploading menu.json to bucket ")).call(_context3, bucketUrl, "\"\n # NOTE: somehow the 'cache-control:private' doesn't work.\n # I mean, the file is uploaded with the correct metadata but when I fetch\n # the file the response contains the header\n # 'cache-control: public,max-age=31536000,no-transform', even though the\n # documentation clearly states that by marking the header as 'private' will\n # disable the cache (for publicly readable objects).\n # https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata#cache-control\n # However, I found out that, by requesting the file with any RANDOM\n # query parameter, will instruct the storage to return a 'fresh' object\n # (without any cache control).\n # Unofficial source: https://stackoverflow.com/a/49052895\n # This seems to be the 'easiest' option to 'disable' the cache for public\n # objects. Other alternative approaces are:\n # * make the object private with some simple ACL (private objects are not cached)\n # * suffix the file name with e.g. the git SHA, so we have different files\n # for each upload ('index.html.template-${CIRCLE_SHA1}'). The server knows\n # the git SHA on runtime and can get the correct file when it starts.\n # * find out why the 'private' cache control does not work\n gcloud storage cp \\\n ")).call(_context2, assetsPath, "/menu.json \\\n ")).call(_context, bucketUrl, " \\\n -z json \\\n --content-type=\"application/json\" \\\n --cache-control=\"public,max-age=0,no-transform\"\nfi\n");
|
|
87
87
|
return uploadScriptContent;
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -277,7 +277,7 @@ async function compileEnvironmentApplicationIndexes(_ref6) {
|
|
|
277
277
|
buildNumber: cliFlags.buildNumber,
|
|
278
278
|
applicationIndexOutFile: cliFlags.applicationIndexOutFile
|
|
279
279
|
});
|
|
280
|
-
// Generate bash scripts to run the `
|
|
280
|
+
// Generate bash scripts to run the `gcloud storage` upload command.
|
|
281
281
|
|
|
282
282
|
writeUploadScriptFile({
|
|
283
283
|
fileName: cliFlags.applicationIndexUploadScriptOutFile,
|
|
@@ -619,7 +619,7 @@ async function command(cliFlags) {
|
|
|
619
619
|
|
|
620
620
|
var pkgJson = {
|
|
621
621
|
name: "@commercetools-frontend/application-cli",
|
|
622
|
-
version: "1.
|
|
622
|
+
version: "1.6.0",
|
|
623
623
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
624
624
|
keywords: [
|
|
625
625
|
"commercetools",
|
|
@@ -644,22 +644,22 @@ var pkgJson = {
|
|
|
644
644
|
"@babel/core": "^7.21.0",
|
|
645
645
|
"@babel/runtime": "^7.21.0",
|
|
646
646
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
647
|
-
"@commercetools-frontend/application-config": "22.
|
|
648
|
-
"@commercetools-frontend/constants": "22.
|
|
649
|
-
"@manypkg/find-root": "2.
|
|
647
|
+
"@commercetools-frontend/application-config": "22.3.0",
|
|
648
|
+
"@commercetools-frontend/constants": "22.3.0",
|
|
649
|
+
"@manypkg/find-root": "2.2.0",
|
|
650
650
|
cac: "^6.7.14",
|
|
651
|
-
cosmiconfig: "8.
|
|
652
|
-
dotenv: "16.
|
|
651
|
+
cosmiconfig: "8.2.0",
|
|
652
|
+
dotenv: "16.3.1",
|
|
653
653
|
execa: "5.1.1",
|
|
654
654
|
jsonschema: "^1.4.1",
|
|
655
655
|
listr2: "^6.4.2",
|
|
656
|
-
"node-fetch": "2.6.
|
|
656
|
+
"node-fetch": "2.6.11"
|
|
657
657
|
},
|
|
658
658
|
devDependencies: {
|
|
659
659
|
"@tsconfig/node18": "1.0.3",
|
|
660
|
-
"@types/node": "18.
|
|
661
|
-
"@types/node-fetch": "2.6.
|
|
662
|
-
typescript: "^
|
|
660
|
+
"@types/node": "18.16.18",
|
|
661
|
+
"@types/node-fetch": "2.6.2",
|
|
662
|
+
typescript: "^5.1.3"
|
|
663
663
|
},
|
|
664
664
|
engines: {
|
|
665
665
|
node: ">=14",
|
|
@@ -48,7 +48,7 @@ function createApplicationIndexUploadScript(_ref) {
|
|
|
48
48
|
buildRevision = _ref.buildRevision,
|
|
49
49
|
buildNumber = _ref.buildNumber,
|
|
50
50
|
applicationIndexOutFile = _ref.applicationIndexOutFile;
|
|
51
|
-
const uploadScriptContent = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = _concatInstanceProperty(_context9 = _concatInstanceProperty(_context10 = "#!/usr/bin/env bash\n\nset -e\n\necho \"Uploading compiled ".concat(applicationIndexOutFile, " to bucket ")).call(_context10, bucketUrl, "\"\
|
|
51
|
+
const uploadScriptContent = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = _concatInstanceProperty(_context9 = _concatInstanceProperty(_context10 = "#!/usr/bin/env bash\n\nset -e\n\necho \"Uploading compiled ".concat(applicationIndexOutFile, " to bucket ")).call(_context10, bucketUrl, "\"\ngcloud storage cp \\\n \"$(dirname \"$0\")/")).call(_context9, applicationIndexOutFile, "\" \\\n \"")).call(_context8, bucketUrl, "/\" \\\n -z html \\\n --content-type=\"text/html\" \\\n --cache-control=\"public,max-age=0,no-transform\"\n\necho \"Creating version.json and uploading it to bucket ")).call(_context7, bucketUrl, "\"\n\nNODE_ENV=production ")).call(_context6, packageManagerName, " application-cli create-version \\\n --version-url=")).call(_context5, cdnUrl, "/")).call(_context4, cloudEnvironment, "/version.json \\\n --build-revision=")).call(_context3, buildRevision, " \\\n --build-number=")).call(_context2, buildNumber, " \\\n --out-file=$(dirname \"$0\")/version.json\n\ngcloud storage cp \\\n \"$(dirname \"$0\")/version.json\" \\\n \"")).call(_context, bucketUrl, "/\" \\\n -z json \\\n --content-type=\"application/json\" \\\n --cache-control=\"public,max-age=0,no-transform\"\n");
|
|
52
52
|
return uploadScriptContent;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -57,7 +57,7 @@ function createApplicationAssetsUploadScript(_ref) {
|
|
|
57
57
|
let bucketUrl = _ref.bucketUrl,
|
|
58
58
|
assetsPath = _ref.assetsPath,
|
|
59
59
|
skipMenu = _ref.skipMenu;
|
|
60
|
-
const uploadScriptContent = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = "#!/usr/bin/env bash\n\nset -e\n\n# NOTES:\n# https://cloud.google.com/
|
|
60
|
+
const uploadScriptContent = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = "#!/usr/bin/env bash\n\nset -e\n\n# NOTES:\n# https://cloud.google.com/sdk/gcloud/reference/storage/cp\n# 1. The '-z' option triggers compressing the assets before\n# uploading them and sets the 'Content-Encoding' to 'gzip'.\n# 2. The 'Accept-encoding: gzip' is set automatically by the 'gcloud storage'.\n# 3. The 'max-age' is set to 1 year which is considered the maximum\n# \"valid\" lifetime of an asset to be cached.\n# 4. The '-n' will skip uploading existing files and prevents them to\n# be overwritten\necho \"Uploading static assets to bucket ".concat(bucketUrl, "\"\n\ngcloud storage cp \\\n ")).call(_context6, assetsPath, "/public/{*.css,*.js,*.js.map,*.png,*.html,robots.txt} \\\n \"")).call(_context5, bucketUrl, "\" \\\n -n \\\n -z js,css \\\n --cache-control=\"public,max-age=31536000,no-transform\"\n\nif ")).call(_context4, skipMenu, "; then\n echo \"Skipping menu.json upload\"\nelse\n echo \"Uploading menu.json to bucket ")).call(_context3, bucketUrl, "\"\n # NOTE: somehow the 'cache-control:private' doesn't work.\n # I mean, the file is uploaded with the correct metadata but when I fetch\n # the file the response contains the header\n # 'cache-control: public,max-age=31536000,no-transform', even though the\n # documentation clearly states that by marking the header as 'private' will\n # disable the cache (for publicly readable objects).\n # https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata#cache-control\n # However, I found out that, by requesting the file with any RANDOM\n # query parameter, will instruct the storage to return a 'fresh' object\n # (without any cache control).\n # Unofficial source: https://stackoverflow.com/a/49052895\n # This seems to be the 'easiest' option to 'disable' the cache for public\n # objects. Other alternative approaces are:\n # * make the object private with some simple ACL (private objects are not cached)\n # * suffix the file name with e.g. the git SHA, so we have different files\n # for each upload ('index.html.template-${CIRCLE_SHA1}'). The server knows\n # the git SHA on runtime and can get the correct file when it starts.\n # * find out why the 'private' cache control does not work\n gcloud storage cp \\\n ")).call(_context2, assetsPath, "/menu.json \\\n ")).call(_context, bucketUrl, " \\\n -z json \\\n --content-type=\"application/json\" \\\n --cache-control=\"public,max-age=0,no-transform\"\nfi\n");
|
|
61
61
|
return uploadScriptContent;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -251,7 +251,7 @@ async function compileEnvironmentApplicationIndexes(_ref6) {
|
|
|
251
251
|
buildNumber: cliFlags.buildNumber,
|
|
252
252
|
applicationIndexOutFile: cliFlags.applicationIndexOutFile
|
|
253
253
|
});
|
|
254
|
-
// Generate bash scripts to run the `
|
|
254
|
+
// Generate bash scripts to run the `gcloud storage` upload command.
|
|
255
255
|
|
|
256
256
|
writeUploadScriptFile({
|
|
257
257
|
fileName: cliFlags.applicationIndexUploadScriptOutFile,
|
|
@@ -593,7 +593,7 @@ async function command(cliFlags) {
|
|
|
593
593
|
|
|
594
594
|
var pkgJson = {
|
|
595
595
|
name: "@commercetools-frontend/application-cli",
|
|
596
|
-
version: "1.
|
|
596
|
+
version: "1.6.0",
|
|
597
597
|
description: "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
598
598
|
keywords: [
|
|
599
599
|
"commercetools",
|
|
@@ -618,22 +618,22 @@ var pkgJson = {
|
|
|
618
618
|
"@babel/core": "^7.21.0",
|
|
619
619
|
"@babel/runtime": "^7.21.0",
|
|
620
620
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
621
|
-
"@commercetools-frontend/application-config": "22.
|
|
622
|
-
"@commercetools-frontend/constants": "22.
|
|
623
|
-
"@manypkg/find-root": "2.
|
|
621
|
+
"@commercetools-frontend/application-config": "22.3.0",
|
|
622
|
+
"@commercetools-frontend/constants": "22.3.0",
|
|
623
|
+
"@manypkg/find-root": "2.2.0",
|
|
624
624
|
cac: "^6.7.14",
|
|
625
|
-
cosmiconfig: "8.
|
|
626
|
-
dotenv: "16.
|
|
625
|
+
cosmiconfig: "8.2.0",
|
|
626
|
+
dotenv: "16.3.1",
|
|
627
627
|
execa: "5.1.1",
|
|
628
628
|
jsonschema: "^1.4.1",
|
|
629
629
|
listr2: "^6.4.2",
|
|
630
|
-
"node-fetch": "2.6.
|
|
630
|
+
"node-fetch": "2.6.11"
|
|
631
631
|
},
|
|
632
632
|
devDependencies: {
|
|
633
633
|
"@tsconfig/node18": "1.0.3",
|
|
634
|
-
"@types/node": "18.
|
|
635
|
-
"@types/node-fetch": "2.6.
|
|
636
|
-
typescript: "^
|
|
634
|
+
"@types/node": "18.16.18",
|
|
635
|
+
"@types/node-fetch": "2.6.2",
|
|
636
|
+
typescript: "^5.1.3"
|
|
637
637
|
},
|
|
638
638
|
engines: {
|
|
639
639
|
node: ">=14",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Internal CLI to manage Merchant Center application deployments across various environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commercetools",
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"@babel/core": "^7.21.0",
|
|
23
23
|
"@babel/runtime": "^7.21.0",
|
|
24
24
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
25
|
-
"@commercetools-frontend/application-config": "22.
|
|
26
|
-
"@commercetools-frontend/constants": "22.
|
|
27
|
-
"@manypkg/find-root": "2.
|
|
25
|
+
"@commercetools-frontend/application-config": "22.3.0",
|
|
26
|
+
"@commercetools-frontend/constants": "22.3.0",
|
|
27
|
+
"@manypkg/find-root": "2.2.0",
|
|
28
28
|
"cac": "^6.7.14",
|
|
29
|
-
"cosmiconfig": "8.
|
|
30
|
-
"dotenv": "16.
|
|
29
|
+
"cosmiconfig": "8.2.0",
|
|
30
|
+
"dotenv": "16.3.1",
|
|
31
31
|
"execa": "5.1.1",
|
|
32
32
|
"jsonschema": "^1.4.1",
|
|
33
33
|
"listr2": "^6.4.2",
|
|
34
|
-
"node-fetch": "2.6.
|
|
34
|
+
"node-fetch": "2.6.11"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@tsconfig/node18": "1.0.3",
|
|
38
|
-
"@types/node": "18.
|
|
39
|
-
"@types/node-fetch": "2.6.
|
|
40
|
-
"typescript": "^
|
|
38
|
+
"@types/node": "18.16.18",
|
|
39
|
+
"@types/node-fetch": "2.6.2",
|
|
40
|
+
"typescript": "^5.1.3"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=14",
|