node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import { CLIContext } from '../../types';
export declare function getProjectNameFromPackageJson(ctx: CLIContext): Promise<string>;
//# sourceMappingURL=get-project-name-from-pkg.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-project-name-from-pkg.d.ts","sourceRoot":"","sources":["../../../src/create-project/utils/get-project-name-from-pkg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,wBAAsB,6BAA6B,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAOpF"}

View File

@@ -0,0 +1,15 @@
'use strict';
var pkg = require('../../utils/pkg.js');
async function getProjectNameFromPackageJson(ctx) {
try {
const packageJson = await pkg.loadPkg(ctx);
return packageJson.name || 'my-strapi-project';
} catch (e) {
return 'my-strapi-project';
}
}
exports.getProjectNameFromPackageJson = getProjectNameFromPackageJson;
//# sourceMappingURL=get-project-name-from-pkg.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-project-name-from-pkg.js","sources":["../../../src/create-project/utils/get-project-name-from-pkg.ts"],"sourcesContent":["import { CLIContext } from '../../types';\nimport { PackageJson, loadPkg } from '../../utils/pkg';\n\nexport async function getProjectNameFromPackageJson(ctx: CLIContext): Promise<string> {\n try {\n const packageJson = (await loadPkg(ctx)) as PackageJson;\n return packageJson.name || 'my-strapi-project';\n } catch (e) {\n return 'my-strapi-project';\n }\n}\n"],"names":["getProjectNameFromPackageJson","ctx","packageJson","loadPkg","name","e"],"mappings":";;;;AAGO,eAAeA,8BAA8BC,GAAe,EAAA;IACjE,IAAI;QACF,MAAMC,WAAAA,GAAe,MAAMC,WAAQF,CAAAA,GAAAA,CAAAA;QACnC,OAAOC,WAAAA,CAAYE,IAAI,IAAI,mBAAA;AAC7B,KAAA,CAAE,OAAOC,CAAG,EAAA;QACV,OAAO,mBAAA;AACT;AACF;;;;"}

View File

@@ -0,0 +1,13 @@
import { loadPkg } from '../../utils/pkg.mjs';
async function getProjectNameFromPackageJson(ctx) {
try {
const packageJson = await loadPkg(ctx);
return packageJson.name || 'my-strapi-project';
} catch (e) {
return 'my-strapi-project';
}
}
export { getProjectNameFromPackageJson };
//# sourceMappingURL=get-project-name-from-pkg.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-project-name-from-pkg.mjs","sources":["../../../src/create-project/utils/get-project-name-from-pkg.ts"],"sourcesContent":["import { CLIContext } from '../../types';\nimport { PackageJson, loadPkg } from '../../utils/pkg';\n\nexport async function getProjectNameFromPackageJson(ctx: CLIContext): Promise<string> {\n try {\n const packageJson = (await loadPkg(ctx)) as PackageJson;\n return packageJson.name || 'my-strapi-project';\n } catch (e) {\n return 'my-strapi-project';\n }\n}\n"],"names":["getProjectNameFromPackageJson","ctx","packageJson","loadPkg","name","e"],"mappings":";;AAGO,eAAeA,8BAA8BC,GAAe,EAAA;IACjE,IAAI;QACF,MAAMC,WAAAA,GAAe,MAAMC,OAAQF,CAAAA,GAAAA,CAAAA;QACnC,OAAOC,WAAAA,CAAYE,IAAI,IAAI,mBAAA;AAC7B,KAAA,CAAE,OAAOC,CAAG,EAAA;QACV,OAAO,mBAAA;AACT;AACF;;;;"}

View File

@@ -0,0 +1,20 @@
import { DistinctQuestion } from 'inquirer';
import type { ProjectAnswers } from '../../types';
/**
* Apply default values to questions based on the provided mapper
* @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
*/
export declare function questionDefaultValuesMapper(questionsMap: Partial<{
[K in keyof ProjectAnswers]: ((question: DistinctQuestion<ProjectAnswers>) => ProjectAnswers[K]) | ProjectAnswers[K];
}>): (questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>) => ReadonlyArray<DistinctQuestion<ProjectAnswers>>;
/**
* Get default values from questions
* @param questions - An array of questions for project creation
*/
export declare function getDefaultsFromQuestions(questions: ReadonlyArray<DistinctQuestion<ProjectAnswers>>): Partial<ProjectAnswers>;
/**
* Get the default node version based on the current node version if it is in the list of choices
* @param question - The question for the node version in project creation
*/
export declare function getProjectNodeVersionDefault(question: DistinctQuestion<ProjectAnswers>): string;
//# sourceMappingURL=project-questions.utils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"project-questions.utils.d.ts","sourceRoot":"","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,OAAO,CAAC;KACnB,CAAC,IAAI,MAAM,cAAc,GACtB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,cAAc,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,GACnE,cAAc,CAAC,CAAC,CAAC;CACtB,CAAC,eAGW,cAAc,iBAAiB,cAAc,CAAC,CAAC,KACzD,cAAc,iBAAiB,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"}

View File

@@ -0,0 +1,63 @@
'use strict';
/**
* Apply default values to questions based on the provided mapper
* @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
*/ function questionDefaultValuesMapper(questionsMap) {
return (questions)=>{
return questions.map((question)=>{
const questionName = question.name;
// If the question is part of the mapper, apply the default value
if (questionName in questionsMap) {
const questionDefault = questionsMap[questionName];
// If the default value is a function, call it with the question and get the default value
if (typeof questionDefault === 'function') {
return {
...question,
default: questionDefault(question)
};
}
// else we consider it as a static value
return {
...question,
default: questionDefault
};
}
// If the question is not part of the mapper, return the question as is
return question;
});
};
}
/**
* Get default values from questions
* @param questions - An array of questions for project creation
*/ function getDefaultsFromQuestions(questions) {
return questions.reduce((acc, question)=>{
if (question.default && question.name) {
return {
...acc,
[question.name]: question.default
};
}
return acc;
}, {});
}
/**
* Get the default node version based on the current node version if it is in the list of choices
* @param question - The question for the node version in project creation
*/ function getProjectNodeVersionDefault(question) {
const currentNodeVersion = process.versions.node.split('.')[0];
// 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)
if (question.type === 'list' && Array.isArray(question.choices)) {
const choice = question.choices.find((choice)=>choice.value === currentNodeVersion);
if (choice) {
return choice.value;
}
}
return question.default;
}
exports.getDefaultsFromQuestions = getDefaultsFromQuestions;
exports.getProjectNodeVersionDefault = getProjectNodeVersionDefault;
exports.questionDefaultValuesMapper = questionDefaultValuesMapper;
//# sourceMappingURL=project-questions.utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"project-questions.utils.js","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import { 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])\n | 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,YAIE,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,YAAc,EAAA;gBAChC,MAAMM,eAAAA,GAAkBN,YAAY,CAACI,YAAa,CAAA;;gBAGlD,IAAI,OAAOE,oBAAoB,UAAY,EAAA;oBACzC,OAAO;AACL,wBAAA,GAAGH,QAAQ;AACXI,wBAAAA,OAAAA,EAASD,eAAgBH,CAAAA,QAAAA;AAC3B,qBAAA;AACF;;gBAEA,OAAO;AACL,oBAAA,GAAGA,QAAQ;oBACXI,OAASD,EAAAA;AACX,iBAAA;AACF;;YAEA,OAAOH,QAAAA;AACT,SAAA,CAAA;AACF,KAAA;AACF;AAEA;;;IAIO,SAASK,wBAAAA,CACdP,SAA0D,EAAA;AAE1D,IAAA,OAAOA,SAAUQ,CAAAA,MAAM,CAAC,CAACC,GAAKP,EAAAA,QAAAA,GAAAA;AAC5B,QAAA,IAAIA,QAASI,CAAAA,OAAO,IAAIJ,QAAAA,CAASE,IAAI,EAAE;YACrC,OAAO;AAAE,gBAAA,GAAGK,GAAG;AAAE,gBAAA,CAACP,QAASE,CAAAA,IAAI,GAAGF,SAASI;AAAQ,aAAA;AACrD;QACA,OAAOG,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;AAEA;;;IAIO,SAASC,4BAAAA,CAA6BR,QAA0C,EAAA;IACrF,MAAMS,kBAAAA,GAAqBC,OAAQC,CAAAA,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,GAAI,CAAA,CAAC,CAAE,CAAA;;IAG9D,IAAIb,QAAAA,CAASc,IAAI,KAAK,MAAA,IAAUC,MAAMC,OAAO,CAAChB,QAASiB,CAAAA,OAAO,CAAG,EAAA;QAC/D,MAAMC,MAAAA,GAASlB,QAASiB,CAAAA,OAAO,CAACE,IAAI,CAAC,CAACD,MAAAA,GAAWA,MAAOE,CAAAA,KAAK,KAAKX,kBAAAA,CAAAA;AAClE,QAAA,IAAIS,MAAQ,EAAA;AACV,YAAA,OAAOA,OAAOE,KAAK;AACrB;AACF;AACA,IAAA,OAAOpB,SAASI,OAAO;AACzB;;;;;;"}

View File

@@ -0,0 +1,59 @@
/**
* Apply default values to questions based on the provided mapper
* @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
*/ function questionDefaultValuesMapper(questionsMap) {
return (questions)=>{
return questions.map((question)=>{
const questionName = question.name;
// If the question is part of the mapper, apply the default value
if (questionName in questionsMap) {
const questionDefault = questionsMap[questionName];
// If the default value is a function, call it with the question and get the default value
if (typeof questionDefault === 'function') {
return {
...question,
default: questionDefault(question)
};
}
// else we consider it as a static value
return {
...question,
default: questionDefault
};
}
// If the question is not part of the mapper, return the question as is
return question;
});
};
}
/**
* Get default values from questions
* @param questions - An array of questions for project creation
*/ function getDefaultsFromQuestions(questions) {
return questions.reduce((acc, question)=>{
if (question.default && question.name) {
return {
...acc,
[question.name]: question.default
};
}
return acc;
}, {});
}
/**
* Get the default node version based on the current node version if it is in the list of choices
* @param question - The question for the node version in project creation
*/ function getProjectNodeVersionDefault(question) {
const currentNodeVersion = process.versions.node.split('.')[0];
// 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)
if (question.type === 'list' && Array.isArray(question.choices)) {
const choice = question.choices.find((choice)=>choice.value === currentNodeVersion);
if (choice) {
return choice.value;
}
}
return question.default;
}
export { getDefaultsFromQuestions, getProjectNodeVersionDefault, questionDefaultValuesMapper };
//# sourceMappingURL=project-questions.utils.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"project-questions.utils.mjs","sources":["../../../src/create-project/utils/project-questions.utils.ts"],"sourcesContent":["import { 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])\n | 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,YAIE,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,YAAc,EAAA;gBAChC,MAAMM,eAAAA,GAAkBN,YAAY,CAACI,YAAa,CAAA;;gBAGlD,IAAI,OAAOE,oBAAoB,UAAY,EAAA;oBACzC,OAAO;AACL,wBAAA,GAAGH,QAAQ;AACXI,wBAAAA,OAAAA,EAASD,eAAgBH,CAAAA,QAAAA;AAC3B,qBAAA;AACF;;gBAEA,OAAO;AACL,oBAAA,GAAGA,QAAQ;oBACXI,OAASD,EAAAA;AACX,iBAAA;AACF;;YAEA,OAAOH,QAAAA;AACT,SAAA,CAAA;AACF,KAAA;AACF;AAEA;;;IAIO,SAASK,wBAAAA,CACdP,SAA0D,EAAA;AAE1D,IAAA,OAAOA,SAAUQ,CAAAA,MAAM,CAAC,CAACC,GAAKP,EAAAA,QAAAA,GAAAA;AAC5B,QAAA,IAAIA,QAASI,CAAAA,OAAO,IAAIJ,QAAAA,CAASE,IAAI,EAAE;YACrC,OAAO;AAAE,gBAAA,GAAGK,GAAG;AAAE,gBAAA,CAACP,QAASE,CAAAA,IAAI,GAAGF,SAASI;AAAQ,aAAA;AACrD;QACA,OAAOG,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;AAEA;;;IAIO,SAASC,4BAAAA,CAA6BR,QAA0C,EAAA;IACrF,MAAMS,kBAAAA,GAAqBC,OAAQC,CAAAA,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,GAAI,CAAA,CAAC,CAAE,CAAA;;IAG9D,IAAIb,QAAAA,CAASc,IAAI,KAAK,MAAA,IAAUC,MAAMC,OAAO,CAAChB,QAASiB,CAAAA,OAAO,CAAG,EAAA;QAC/D,MAAMC,MAAAA,GAASlB,QAASiB,CAAAA,OAAO,CAACE,IAAI,CAAC,CAACD,MAAAA,GAAWA,MAAOE,CAAAA,KAAK,KAAKX,kBAAAA,CAAAA;AAClE,QAAA,IAAIS,MAAQ,EAAA;AACV,YAAA,OAAOA,OAAOE,KAAK;AACrB;AACF;AACA,IAAA,OAAOpB,SAASI,OAAO;AACzB;;;;"}