@strapi/cloud-cli 5.58.0 → 5.59.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/dist/create-project/utils/project-questions.utils.d.ts.map +1 -1
- package/dist/create-project/utils/project-questions.utils.js.map +1 -1
- package/dist/create-project/utils/project-questions.utils.mjs.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/package.json.mjs +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-questions.utils.d.ts","sourceRoot":"","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,OAAO,CAAC;KACnB,CAAC,IAAI,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"project-questions.utils.d.ts","sourceRoot":"","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,OAAO,CAAC;KACnB,CAAC,IAAI,MAAM,cAAc,GACxB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,cAAc,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC;CAC1F,CAAC,IAGA,WAAW,aAAa,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,KACzD,aAAa,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAyBnD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,GACzD,OAAO,CAAC,cAAc,CAAC,CAOzB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAAG,MAAM,CAW/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-questions.utils.js","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import type { DistinctQuestion } from 'inquirer';\nimport type { ProjectAnswers } from '../../types';\n\n/**\n * Apply default values to questions based on the provided mapper\n * @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value\n */\nexport function questionDefaultValuesMapper(\n questionsMap: Partial<{\n [K in keyof ProjectAnswers]:\n
|
|
1
|
+
{"version":3,"file":"project-questions.utils.js","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import type { DistinctQuestion } from 'inquirer';\nimport type { ProjectAnswers } from '../../types';\n\n/**\n * Apply default values to questions based on the provided mapper\n * @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value\n */\nexport function questionDefaultValuesMapper(\n questionsMap: Partial<{\n [K in keyof ProjectAnswers]:\n ((question: DistinctQuestion<ProjectAnswers>) => ProjectAnswers[K]) | ProjectAnswers[K];\n }>\n) {\n return (\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n ): ReadonlyArray<DistinctQuestion<ProjectAnswers>> => {\n return questions.map((question) => {\n const questionName = question.name as keyof ProjectAnswers;\n\n // If the question is part of the mapper, apply the default value\n if (questionName in questionsMap) {\n const questionDefault = questionsMap[questionName];\n\n // If the default value is a function, call it with the question and get the default value\n if (typeof questionDefault === 'function') {\n return {\n ...question,\n default: questionDefault(question),\n };\n }\n // else we consider it as a static value\n return {\n ...question,\n default: questionDefault,\n };\n }\n // If the question is not part of the mapper, return the question as is\n return question;\n });\n };\n}\n\n/**\n * Get default values from questions\n * @param questions - An array of questions for project creation\n */\nexport function getDefaultsFromQuestions(\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n): Partial<ProjectAnswers> {\n return questions.reduce((acc, question) => {\n if (question.default && question.name) {\n return { ...acc, [question.name]: question.default };\n }\n return acc;\n }, {});\n}\n\n/**\n * Get the default node version based on the current node version if it is in the list of choices\n * @param question - The question for the node version in project creation\n */\nexport function getProjectNodeVersionDefault(question: DistinctQuestion<ProjectAnswers>): string {\n const currentNodeVersion = process.versions.node.split('.')[0];\n\n // Node Version question is set up as a list, but the type of inquirer is dynamic and the question can change in the future (it comes from API)\n if (question.type === 'list' && Array.isArray(question.choices)) {\n const choice = question.choices.find((choice) => choice.value === currentNodeVersion);\n if (choice) {\n return choice.value;\n }\n }\n return question.default;\n}\n"],"names":["questionDefaultValuesMapper","questionsMap","questions","map","question","questionName","name","questionDefault","default","getDefaultsFromQuestions","reduce","acc","getProjectNodeVersionDefault","currentNodeVersion","process","versions","node","split","type","Array","isArray","choices","choice","find","value"],"mappings":";;AAGA;;;IAIO,SAASA,2BAAAA,CACdC,YAGE,EAAA;AAEF,IAAA,OAAO,CACLC,SAAAA,GAAAA;QAEA,OAAOA,SAAAA,CAAUC,GAAG,CAAC,CAACC,QAAAA,GAAAA;YACpB,MAAMC,YAAAA,GAAeD,SAASE,IAAI;;AAGlC,YAAA,IAAID,gBAAgBJ,YAAAA,EAAc;gBAChC,MAAMM,eAAAA,GAAkBN,YAAY,CAACI,YAAAA,CAAa;;gBAGlD,IAAI,OAAOE,oBAAoB,UAAA,EAAY;oBACzC,OAAO;AACL,wBAAA,GAAGH,QAAQ;AACXI,wBAAAA,OAAAA,EAASD,eAAAA,CAAgBH,QAAAA;AAC3B,qBAAA;AACF,gBAAA;;gBAEA,OAAO;AACL,oBAAA,GAAGA,QAAQ;oBACXI,OAAAA,EAASD;AACX,iBAAA;AACF,YAAA;;YAEA,OAAOH,QAAAA;AACT,QAAA,CAAA,CAAA;AACF,IAAA,CAAA;AACF;AAEA;;;IAIO,SAASK,wBAAAA,CACdP,SAA0D,EAAA;AAE1D,IAAA,OAAOA,SAAAA,CAAUQ,MAAM,CAAC,CAACC,GAAAA,EAAKP,QAAAA,GAAAA;AAC5B,QAAA,IAAIA,QAAAA,CAASI,OAAO,IAAIJ,QAAAA,CAASE,IAAI,EAAE;YACrC,OAAO;AAAE,gBAAA,GAAGK,GAAG;AAAE,gBAAA,CAACP,QAAAA,CAASE,IAAI,GAAGF,SAASI;AAAQ,aAAA;AACrD,QAAA;QACA,OAAOG,GAAAA;AACT,IAAA,CAAA,EAAG,EAAC,CAAA;AACN;AAEA;;;IAIO,SAASC,4BAAAA,CAA6BR,QAA0C,EAAA;IACrF,MAAMS,kBAAAA,GAAqBC,OAAAA,CAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,GAAA,CAAI,CAAC,CAAA,CAAE;;IAG9D,IAAIb,QAAAA,CAASc,IAAI,KAAK,MAAA,IAAUC,MAAMC,OAAO,CAAChB,QAAAA,CAASiB,OAAO,CAAA,EAAG;QAC/D,MAAMC,MAAAA,GAASlB,QAAAA,CAASiB,OAAO,CAACE,IAAI,CAAC,CAACD,MAAAA,GAAWA,MAAAA,CAAOE,KAAK,KAAKX,kBAAAA,CAAAA;AAClE,QAAA,IAAIS,MAAAA,EAAQ;AACV,YAAA,OAAOA,OAAOE,KAAK;AACrB,QAAA;AACF,IAAA;AACA,IAAA,OAAOpB,SAASI,OAAO;AACzB;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-questions.utils.mjs","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import type { DistinctQuestion } from 'inquirer';\nimport type { ProjectAnswers } from '../../types';\n\n/**\n * Apply default values to questions based on the provided mapper\n * @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value\n */\nexport function questionDefaultValuesMapper(\n questionsMap: Partial<{\n [K in keyof ProjectAnswers]:\n
|
|
1
|
+
{"version":3,"file":"project-questions.utils.mjs","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import type { DistinctQuestion } from 'inquirer';\nimport type { ProjectAnswers } from '../../types';\n\n/**\n * Apply default values to questions based on the provided mapper\n * @param questionsMap - A partial object with keys matching the ProjectAnswers keys and values being the default value or a function to get the default value\n */\nexport function questionDefaultValuesMapper(\n questionsMap: Partial<{\n [K in keyof ProjectAnswers]:\n ((question: DistinctQuestion<ProjectAnswers>) => ProjectAnswers[K]) | ProjectAnswers[K];\n }>\n) {\n return (\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n ): ReadonlyArray<DistinctQuestion<ProjectAnswers>> => {\n return questions.map((question) => {\n const questionName = question.name as keyof ProjectAnswers;\n\n // If the question is part of the mapper, apply the default value\n if (questionName in questionsMap) {\n const questionDefault = questionsMap[questionName];\n\n // If the default value is a function, call it with the question and get the default value\n if (typeof questionDefault === 'function') {\n return {\n ...question,\n default: questionDefault(question),\n };\n }\n // else we consider it as a static value\n return {\n ...question,\n default: questionDefault,\n };\n }\n // If the question is not part of the mapper, return the question as is\n return question;\n });\n };\n}\n\n/**\n * Get default values from questions\n * @param questions - An array of questions for project creation\n */\nexport function getDefaultsFromQuestions(\n questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>\n): Partial<ProjectAnswers> {\n return questions.reduce((acc, question) => {\n if (question.default && question.name) {\n return { ...acc, [question.name]: question.default };\n }\n return acc;\n }, {});\n}\n\n/**\n * Get the default node version based on the current node version if it is in the list of choices\n * @param question - The question for the node version in project creation\n */\nexport function getProjectNodeVersionDefault(question: DistinctQuestion<ProjectAnswers>): string {\n const currentNodeVersion = process.versions.node.split('.')[0];\n\n // Node Version question is set up as a list, but the type of inquirer is dynamic and the question can change in the future (it comes from API)\n if (question.type === 'list' && Array.isArray(question.choices)) {\n const choice = question.choices.find((choice) => choice.value === currentNodeVersion);\n if (choice) {\n return choice.value;\n }\n }\n return question.default;\n}\n"],"names":["questionDefaultValuesMapper","questionsMap","questions","map","question","questionName","name","questionDefault","default","getDefaultsFromQuestions","reduce","acc","getProjectNodeVersionDefault","currentNodeVersion","process","versions","node","split","type","Array","isArray","choices","choice","find","value"],"mappings":"AAGA;;;IAIO,SAASA,2BAAAA,CACdC,YAGE,EAAA;AAEF,IAAA,OAAO,CACLC,SAAAA,GAAAA;QAEA,OAAOA,SAAAA,CAAUC,GAAG,CAAC,CAACC,QAAAA,GAAAA;YACpB,MAAMC,YAAAA,GAAeD,SAASE,IAAI;;AAGlC,YAAA,IAAID,gBAAgBJ,YAAAA,EAAc;gBAChC,MAAMM,eAAAA,GAAkBN,YAAY,CAACI,YAAAA,CAAa;;gBAGlD,IAAI,OAAOE,oBAAoB,UAAA,EAAY;oBACzC,OAAO;AACL,wBAAA,GAAGH,QAAQ;AACXI,wBAAAA,OAAAA,EAASD,eAAAA,CAAgBH,QAAAA;AAC3B,qBAAA;AACF,gBAAA;;gBAEA,OAAO;AACL,oBAAA,GAAGA,QAAQ;oBACXI,OAAAA,EAASD;AACX,iBAAA;AACF,YAAA;;YAEA,OAAOH,QAAAA;AACT,QAAA,CAAA,CAAA;AACF,IAAA,CAAA;AACF;AAEA;;;IAIO,SAASK,wBAAAA,CACdP,SAA0D,EAAA;AAE1D,IAAA,OAAOA,SAAAA,CAAUQ,MAAM,CAAC,CAACC,GAAAA,EAAKP,QAAAA,GAAAA;AAC5B,QAAA,IAAIA,QAAAA,CAASI,OAAO,IAAIJ,QAAAA,CAASE,IAAI,EAAE;YACrC,OAAO;AAAE,gBAAA,GAAGK,GAAG;AAAE,gBAAA,CAACP,QAAAA,CAASE,IAAI,GAAGF,SAASI;AAAQ,aAAA;AACrD,QAAA;QACA,OAAOG,GAAAA;AACT,IAAA,CAAA,EAAG,EAAC,CAAA;AACN;AAEA;;;IAIO,SAASC,4BAAAA,CAA6BR,QAA0C,EAAA;IACrF,MAAMS,kBAAAA,GAAqBC,OAAAA,CAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,GAAA,CAAI,CAAC,CAAA,CAAE;;IAG9D,IAAIb,QAAAA,CAASc,IAAI,KAAK,MAAA,IAAUC,MAAMC,OAAO,CAAChB,QAAAA,CAASiB,OAAO,CAAA,EAAG;QAC/D,MAAMC,MAAAA,GAASlB,QAAAA,CAASiB,OAAO,CAACE,IAAI,CAAC,CAACD,MAAAA,GAAWA,MAAAA,CAAOE,KAAK,KAAKX,kBAAAA,CAAAA;AAClE,QAAA,IAAIS,MAAAA,EAAQ;AACV,YAAA,OAAOA,OAAOE,KAAK;AACrB,QAAA;AACF,IAAA;AACA,IAAA,OAAOpB,SAASI,OAAO;AACzB;;;;"}
|
package/dist/package.json.js
CHANGED
package/dist/package.json.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/cloud-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.59.0",
|
|
4
4
|
"description": "Commands to interact with the Strapi Cloud",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"test:unit:vitest:watch": "vitest --watch"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@strapi/utils": "5.
|
|
53
|
+
"@strapi/utils": "5.59.0",
|
|
54
54
|
"axios": "1.20.0",
|
|
55
55
|
"boxen": "5.1.2",
|
|
56
56
|
"chalk": "4.1.2",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"@types/eventsource": "1.1.15",
|
|
77
77
|
"@types/lodash": "^4.14.191",
|
|
78
78
|
"@types/node": "20.19.41",
|
|
79
|
-
"eslint-config-custom": "5.
|
|
80
|
-
"tsconfig": "5.
|
|
79
|
+
"eslint-config-custom": "5.59.0",
|
|
80
|
+
"tsconfig": "5.59.0",
|
|
81
81
|
"vitest": "catalog:",
|
|
82
|
-
"vitest-config": "5.
|
|
82
|
+
"vitest-config": "5.59.0"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">=20.0.0 <=26.x.x",
|