create-strapi-app 5.13.0-beta.1 → 5.13.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/cloud.d.ts.map +1 -1
- package/dist/cloud.js +8 -3
- package/dist/cloud.js.map +1 -1
- package/dist/cloud.mjs +8 -3
- package/dist/cloud.mjs.map +1 -1
- package/dist/utils/dot-env.d.ts.map +1 -1
- package/dist/utils/dot-env.js +2 -0
- package/dist/utils/dot-env.js.map +1 -1
- package/dist/utils/dot-env.mjs +2 -0
- package/dist/utils/dot-env.mjs.map +1 -1
- package/package.json +4 -4
- package/templates/example/.env.example +1 -0
- package/templates/example/config/admin.ts +3 -0
- package/templates/example-js/.env.example +1 -0
- package/templates/example-js/config/admin.js +3 -0
- package/templates/vanilla/.env.example +1 -0
- package/templates/vanilla/config/admin.ts +3 -0
- package/templates/vanilla-js/.env.example +1 -0
- package/dist/utils/machine-id.d.ts +0 -2
- package/dist/utils/machine-id.d.ts.map +0 -1
- package/dist/utils/machine-id.js +0 -17
- package/dist/utils/machine-id.js.map +0 -1
- package/dist/utils/machine-id.mjs +0 -15
- package/dist/utils/machine-id.mjs.map +0 -1
package/dist/cloud.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAiBA,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAiBA,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CA4DtD"}
|
package/dist/cloud.js
CHANGED
|
@@ -10,6 +10,7 @@ function assertCloudError(e) {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
async function handleCloudLogin() {
|
|
13
|
+
let cloudApiConfig;
|
|
13
14
|
const logger = cloudCli.services.createLogger({
|
|
14
15
|
silent: false,
|
|
15
16
|
debug: process.argv.includes('--debug'),
|
|
@@ -21,13 +22,14 @@ async function handleCloudLogin() {
|
|
|
21
22
|
const defaultErrorMessage = 'An error occurred while trying to interact with Strapi Cloud. Use strapi deploy command once the project is generated.';
|
|
22
23
|
try {
|
|
23
24
|
const { data: config } = await cloudApiService.config();
|
|
25
|
+
cloudApiConfig = config;
|
|
24
26
|
logger.log(parseToChalk(config.projectCreation.introText));
|
|
25
27
|
} catch (e) {
|
|
26
28
|
logger.debug(e);
|
|
27
29
|
logger.error(defaultErrorMessage);
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
|
-
const { userChoice } = await inquirer.prompt([
|
|
32
|
+
const { userChoice } = await inquirer.prompt(cloudApiConfig.projectCreation?.userChoice || [
|
|
31
33
|
{
|
|
32
34
|
type: 'list',
|
|
33
35
|
name: 'userChoice',
|
|
@@ -38,10 +40,13 @@ async function handleCloudLogin() {
|
|
|
38
40
|
]
|
|
39
41
|
}
|
|
40
42
|
]);
|
|
41
|
-
if (userChoice
|
|
43
|
+
if (!userChoice.toLowerCase().includes('skip')) {
|
|
42
44
|
const cliContext = {
|
|
43
45
|
logger,
|
|
44
|
-
cwd: process.cwd()
|
|
46
|
+
cwd: process.cwd(),
|
|
47
|
+
...cloudApiConfig.projectCreation?.reference && {
|
|
48
|
+
promptExperiment: cloudApiConfig.projectCreation?.reference
|
|
49
|
+
}
|
|
45
50
|
};
|
|
46
51
|
try {
|
|
47
52
|
await cloudCli.cli.login.action(cliContext);
|
package/dist/cloud.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.js","sources":["../src/cloud.ts"],"sourcesContent":["import inquirer from 'inquirer';\nimport { cli as cloudCli, services as cloudServices } from '@strapi/cloud-cli';\nimport parseToChalk from './utils/parse-to-chalk';\n\ninterface CloudError {\n response: {\n status: number;\n data: string | object;\n };\n}\n\nfunction assertCloudError(e: unknown): asserts e is CloudError {\n if ((e as CloudError).response === undefined) {\n throw Error('Expected CloudError');\n }\n}\n\nexport async function handleCloudLogin(): Promise<void> {\n const logger = cloudServices.createLogger({\n silent: false,\n debug: process.argv.includes('--debug'),\n timestamp: false,\n });\n const cloudApiService = await cloudServices.cloudApiFactory({ logger });\n const defaultErrorMessage =\n 'An error occurred while trying to interact with Strapi Cloud. Use strapi deploy command once the project is generated.';\n\n try {\n const { data: config } = await cloudApiService.config();\n logger.log(parseToChalk(config.projectCreation.introText));\n } catch (e: unknown) {\n logger.debug(e);\n logger.error(defaultErrorMessage);\n return;\n }\n const { userChoice } = await inquirer.prompt<{ userChoice: string }>([\n
|
|
1
|
+
{"version":3,"file":"cloud.js","sources":["../src/cloud.ts"],"sourcesContent":["import inquirer from 'inquirer';\nimport { cli as cloudCli, services as cloudServices } from '@strapi/cloud-cli';\nimport parseToChalk from './utils/parse-to-chalk';\n\ninterface CloudError {\n response: {\n status: number;\n data: string | object;\n };\n}\n\nfunction assertCloudError(e: unknown): asserts e is CloudError {\n if ((e as CloudError).response === undefined) {\n throw Error('Expected CloudError');\n }\n}\n\nexport async function handleCloudLogin(): Promise<void> {\n let cloudApiConfig;\n const logger = cloudServices.createLogger({\n silent: false,\n debug: process.argv.includes('--debug'),\n timestamp: false,\n });\n const cloudApiService = await cloudServices.cloudApiFactory({ logger });\n const defaultErrorMessage =\n 'An error occurred while trying to interact with Strapi Cloud. Use strapi deploy command once the project is generated.';\n\n try {\n const { data: config } = await cloudApiService.config();\n cloudApiConfig = config;\n logger.log(parseToChalk(config.projectCreation.introText));\n } catch (e: unknown) {\n logger.debug(e);\n logger.error(defaultErrorMessage);\n return;\n }\n const { userChoice } = await inquirer.prompt<{ userChoice: string }>(\n cloudApiConfig.projectCreation?.userChoice || [\n {\n type: 'list',\n name: 'userChoice',\n message: `Please log in or sign up.`,\n choices: ['Login/Sign up', 'Skip'],\n },\n ]\n );\n\n if (!userChoice.toLowerCase().includes('skip')) {\n const cliContext = {\n logger,\n cwd: process.cwd(),\n ...(cloudApiConfig.projectCreation?.reference && {\n promptExperiment: cloudApiConfig.projectCreation?.reference,\n }),\n };\n\n try {\n await cloudCli.login.action(cliContext);\n } catch (e: Error | CloudError | unknown) {\n logger.debug(e);\n try {\n assertCloudError(e);\n if (e.response.status === 403) {\n const message =\n typeof e.response.data === 'string'\n ? e.response.data\n : 'We are sorry, but we are not able to log you into Strapi Cloud at the moment.';\n logger.warn(message);\n return;\n }\n } catch (e) {\n /* empty */\n }\n logger.error(defaultErrorMessage);\n }\n }\n}\n"],"names":["assertCloudError","e","response","undefined","Error","handleCloudLogin","cloudApiConfig","logger","cloudServices","createLogger","silent","debug","process","argv","includes","timestamp","cloudApiService","cloudApiFactory","defaultErrorMessage","data","config","log","parseToChalk","projectCreation","introText","error","userChoice","inquirer","prompt","type","name","message","choices","toLowerCase","cliContext","cwd","reference","promptExperiment","cloudCli","login","action","status","warn"],"mappings":";;;;;;AAWA,SAASA,iBAAiBC,CAAU,EAAA;AAClC,IAAA,IAAI,CAACA,CAAiBC,QAAQ,KAAKC,SAAW,EAAA;AAC5C,QAAA,MAAMC,KAAM,CAAA,qBAAA,CAAA;AACd;AACF;AAEO,eAAeC,gBAAAA,GAAAA;IACpB,IAAIC,cAAAA;IACJ,MAAMC,MAAAA,GAASC,iBAAcC,CAAAA,YAAY,CAAC;QACxCC,MAAQ,EAAA,KAAA;AACRC,QAAAA,KAAAA,EAAOC,OAAQC,CAAAA,IAAI,CAACC,QAAQ,CAAC,SAAA,CAAA;QAC7BC,SAAW,EAAA;AACb,KAAA,CAAA;AACA,IAAA,MAAMC,eAAkB,GAAA,MAAMR,iBAAcS,CAAAA,eAAe,CAAC;AAAEV,QAAAA;AAAO,KAAA,CAAA;AACrE,IAAA,MAAMW,mBACJ,GAAA,wHAAA;IAEF,IAAI;AACF,QAAA,MAAM,EAAEC,IAAMC,EAAAA,MAAM,EAAE,GAAG,MAAMJ,gBAAgBI,MAAM,EAAA;QACrDd,cAAiBc,GAAAA,MAAAA;AAC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C,CAAAA,QAAQ,CAACiB,IAAI,KAAK,QAAA,GACvBlB,CAAEC,CAAAA,QAAQ,CAACiB,IAAI,GACf,+EAAA;AACNZ,oBAAAA,MAAAA,CAAOmC,IAAI,CAACX,OAAAA,CAAAA;AACZ,oBAAA;AACF;AACF,aAAA,CAAE,OAAO9B,CAAG,EAAA;AACV;AAEFM,YAAAA,MAAAA,CAAOkB,KAAK,CAACP,mBAAAA,CAAAA;AACf;AACF;AACF;;;;"}
|
package/dist/cloud.mjs
CHANGED
|
@@ -8,6 +8,7 @@ function assertCloudError(e) {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
async function handleCloudLogin() {
|
|
11
|
+
let cloudApiConfig;
|
|
11
12
|
const logger = services.createLogger({
|
|
12
13
|
silent: false,
|
|
13
14
|
debug: process.argv.includes('--debug'),
|
|
@@ -19,13 +20,14 @@ async function handleCloudLogin() {
|
|
|
19
20
|
const defaultErrorMessage = 'An error occurred while trying to interact with Strapi Cloud. Use strapi deploy command once the project is generated.';
|
|
20
21
|
try {
|
|
21
22
|
const { data: config } = await cloudApiService.config();
|
|
23
|
+
cloudApiConfig = config;
|
|
22
24
|
logger.log(parseToChalk(config.projectCreation.introText));
|
|
23
25
|
} catch (e) {
|
|
24
26
|
logger.debug(e);
|
|
25
27
|
logger.error(defaultErrorMessage);
|
|
26
28
|
return;
|
|
27
29
|
}
|
|
28
|
-
const { userChoice } = await inquirer.prompt([
|
|
30
|
+
const { userChoice } = await inquirer.prompt(cloudApiConfig.projectCreation?.userChoice || [
|
|
29
31
|
{
|
|
30
32
|
type: 'list',
|
|
31
33
|
name: 'userChoice',
|
|
@@ -36,10 +38,13 @@ async function handleCloudLogin() {
|
|
|
36
38
|
]
|
|
37
39
|
}
|
|
38
40
|
]);
|
|
39
|
-
if (userChoice
|
|
41
|
+
if (!userChoice.toLowerCase().includes('skip')) {
|
|
40
42
|
const cliContext = {
|
|
41
43
|
logger,
|
|
42
|
-
cwd: process.cwd()
|
|
44
|
+
cwd: process.cwd(),
|
|
45
|
+
...cloudApiConfig.projectCreation?.reference && {
|
|
46
|
+
promptExperiment: cloudApiConfig.projectCreation?.reference
|
|
47
|
+
}
|
|
43
48
|
};
|
|
44
49
|
try {
|
|
45
50
|
await cli.login.action(cliContext);
|
package/dist/cloud.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.mjs","sources":["../src/cloud.ts"],"sourcesContent":["import inquirer from 'inquirer';\nimport { cli as cloudCli, services as cloudServices } from '@strapi/cloud-cli';\nimport parseToChalk from './utils/parse-to-chalk';\n\ninterface CloudError {\n response: {\n status: number;\n data: string | object;\n };\n}\n\nfunction assertCloudError(e: unknown): asserts e is CloudError {\n if ((e as CloudError).response === undefined) {\n throw Error('Expected CloudError');\n }\n}\n\nexport async function handleCloudLogin(): Promise<void> {\n const logger = cloudServices.createLogger({\n silent: false,\n debug: process.argv.includes('--debug'),\n timestamp: false,\n });\n const cloudApiService = await cloudServices.cloudApiFactory({ logger });\n const defaultErrorMessage =\n 'An error occurred while trying to interact with Strapi Cloud. Use strapi deploy command once the project is generated.';\n\n try {\n const { data: config } = await cloudApiService.config();\n logger.log(parseToChalk(config.projectCreation.introText));\n } catch (e: unknown) {\n logger.debug(e);\n logger.error(defaultErrorMessage);\n return;\n }\n const { userChoice } = await inquirer.prompt<{ userChoice: string }>([\n
|
|
1
|
+
{"version":3,"file":"cloud.mjs","sources":["../src/cloud.ts"],"sourcesContent":["import inquirer from 'inquirer';\nimport { cli as cloudCli, services as cloudServices } from '@strapi/cloud-cli';\nimport parseToChalk from './utils/parse-to-chalk';\n\ninterface CloudError {\n response: {\n status: number;\n data: string | object;\n };\n}\n\nfunction assertCloudError(e: unknown): asserts e is CloudError {\n if ((e as CloudError).response === undefined) {\n throw Error('Expected CloudError');\n }\n}\n\nexport async function handleCloudLogin(): Promise<void> {\n let cloudApiConfig;\n const logger = cloudServices.createLogger({\n silent: false,\n debug: process.argv.includes('--debug'),\n timestamp: false,\n });\n const cloudApiService = await cloudServices.cloudApiFactory({ logger });\n const defaultErrorMessage =\n 'An error occurred while trying to interact with Strapi Cloud. Use strapi deploy command once the project is generated.';\n\n try {\n const { data: config } = await cloudApiService.config();\n cloudApiConfig = config;\n logger.log(parseToChalk(config.projectCreation.introText));\n } catch (e: unknown) {\n logger.debug(e);\n logger.error(defaultErrorMessage);\n return;\n }\n const { userChoice } = await inquirer.prompt<{ userChoice: string }>(\n cloudApiConfig.projectCreation?.userChoice || [\n {\n type: 'list',\n name: 'userChoice',\n message: `Please log in or sign up.`,\n choices: ['Login/Sign up', 'Skip'],\n },\n ]\n );\n\n if (!userChoice.toLowerCase().includes('skip')) {\n const cliContext = {\n logger,\n cwd: process.cwd(),\n ...(cloudApiConfig.projectCreation?.reference && {\n promptExperiment: cloudApiConfig.projectCreation?.reference,\n }),\n };\n\n try {\n await cloudCli.login.action(cliContext);\n } catch (e: Error | CloudError | unknown) {\n logger.debug(e);\n try {\n assertCloudError(e);\n if (e.response.status === 403) {\n const message =\n typeof e.response.data === 'string'\n ? e.response.data\n : 'We are sorry, but we are not able to log you into Strapi Cloud at the moment.';\n logger.warn(message);\n return;\n }\n } catch (e) {\n /* empty */\n }\n logger.error(defaultErrorMessage);\n }\n }\n}\n"],"names":["assertCloudError","e","response","undefined","Error","handleCloudLogin","cloudApiConfig","logger","cloudServices","createLogger","silent","debug","process","argv","includes","timestamp","cloudApiService","cloudApiFactory","defaultErrorMessage","data","config","log","parseToChalk","projectCreation","introText","error","userChoice","inquirer","prompt","type","name","message","choices","toLowerCase","cliContext","cwd","reference","promptExperiment","cloudCli","login","action","status","warn"],"mappings":";;;;AAWA,SAASA,iBAAiBC,CAAU,EAAA;AAClC,IAAA,IAAI,CAACA,CAAiBC,QAAQ,KAAKC,SAAW,EAAA;AAC5C,QAAA,MAAMC,KAAM,CAAA,qBAAA,CAAA;AACd;AACF;AAEO,eAAeC,gBAAAA,GAAAA;IACpB,IAAIC,cAAAA;IACJ,M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AAAA,CAAeiB,eAAe,EAAEa,SAAa,IAAA;gBAC/CC,gBAAkB/B,EAAAA,cAAAA,CAAeiB,eAAe,EAAEa;;AAEtD,SAAA;QAEA,IAAI;AACF,YAAA,MAAME,GAASC,CAAAA,KAAK,CAACC,MAAM,CAACN,UAAAA,CAAAA;AAC9B,SAAA,CAAE,OAAOjC,CAAiC,EAAA;AACxCM,YAAAA,MAAAA,CAAOI,KAAK,CAACV,CAAAA,CAAAA;YACb,IAAI;gBACFD,gBAAiBC,CAAAA,CAAAA,CAAAA;AACjB,gBAAA,IAAIA,CAAEC,CAAAA,QAAQ,CAACuC,MAAM,KAAK,GAAK,EAAA;AAC7B,oBAAA,MAAMV,OACJ,GAAA,OAAO9B,CAAEC,CAAAA,QAAQ,CAACiB,IAAI,KAAK,QAAA,GACvBlB,CAAEC,CAAAA,QAAQ,CAACiB,IAAI,GACf,+EAAA;AACNZ,oBAAAA,MAAAA,CAAOmC,IAAI,CAACX,OAAAA,CAAAA;AACZ,oBAAA;AACF;AACF,aAAA,CAAE,OAAO9B,CAAG,EAAA;AACV;AAEFM,YAAAA,MAAAA,CAAOkB,KAAK,CAACP,mBAAAA,CAAAA;AACf;AACF;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dot-env.d.ts","sourceRoot":"","sources":["../../src/utils/dot-env.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"dot-env.d.ts","sourceRoot":"","sources":["../../src/utils/dot-env.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AA2BtC,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,UAiB1C"}
|
package/dist/utils/dot-env.js
CHANGED
|
@@ -14,6 +14,7 @@ APP_KEYS=<%= appKeys %>
|
|
|
14
14
|
API_TOKEN_SALT=<%= apiTokenSalt %>
|
|
15
15
|
ADMIN_JWT_SECRET=<%= adminJwtToken %>
|
|
16
16
|
TRANSFER_TOKEN_SALT=<%= transferTokenSalt %>
|
|
17
|
+
ENCRYPTION_KEY=<%= encryptionKey %>
|
|
17
18
|
|
|
18
19
|
# Database
|
|
19
20
|
DATABASE_CLIENT=<%= database.client %>
|
|
@@ -32,6 +33,7 @@ function generateDotEnv(scope) {
|
|
|
32
33
|
apiTokenSalt: generateASecret(),
|
|
33
34
|
transferTokenSalt: generateASecret(),
|
|
34
35
|
adminJwtToken: generateASecret(),
|
|
36
|
+
encryptionKey: generateASecret(),
|
|
35
37
|
database: {
|
|
36
38
|
client: scope.database.client,
|
|
37
39
|
connection: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dot-env.js","sources":["../../src/utils/dot-env.ts"],"sourcesContent":["import crypto from 'crypto';\nimport _ from 'lodash';\n\nimport type { Scope } from '../types';\n\nconst generateASecret = () => crypto.randomBytes(16).toString('base64');\n\nconst envTmpl = `\n# Server\nHOST=0.0.0.0\nPORT=1337\n\n# Secrets\nAPP_KEYS=<%= appKeys %>\nAPI_TOKEN_SALT=<%= apiTokenSalt %>\nADMIN_JWT_SECRET=<%= adminJwtToken %>\nTRANSFER_TOKEN_SALT=<%= transferTokenSalt %>\n\n# Database\nDATABASE_CLIENT=<%= database.client %>\nDATABASE_HOST=<%= database.connection.host %>\nDATABASE_PORT=<%= database.connection.port %>\nDATABASE_NAME=<%= database.connection.database %>\nDATABASE_USERNAME=<%= database.connection.username %>\nDATABASE_PASSWORD=<%= database.connection.password %>\nDATABASE_SSL=<%= database.connection.ssl %>\nDATABASE_FILENAME=<%= database.connection.filename %>\n`;\n\nexport function generateDotEnv(scope: Scope) {\n const compile = _.template(envTmpl);\n\n return compile({\n appKeys: new Array(4).fill(null).map(generateASecret).join(','),\n apiTokenSalt: generateASecret(),\n transferTokenSalt: generateASecret(),\n adminJwtToken: generateASecret(),\n database: {\n client: scope.database.client,\n connection: {\n ...scope.database.connection,\n ssl: scope.database.connection?.ssl || false,\n },\n },\n });\n}\n"],"names":["generateASecret","crypto","randomBytes","toString","envTmpl","generateDotEnv","scope","compile","_","template","appKeys","Array","fill","map","join","apiTokenSalt","transferTokenSalt","adminJwtToken","database","client","connection","ssl"],"mappings":";;;;;AAKA,MAAMA,kBAAkB,IAAMC,MAAAA,CAAOC,WAAW,CAAC,EAAA,CAAA,CAAIC,QAAQ,CAAC,QAAA,CAAA;AAE9D,MAAMC,UAAU
|
|
1
|
+
{"version":3,"file":"dot-env.js","sources":["../../src/utils/dot-env.ts"],"sourcesContent":["import crypto from 'crypto';\nimport _ from 'lodash';\n\nimport type { Scope } from '../types';\n\nconst generateASecret = () => crypto.randomBytes(16).toString('base64');\n\nconst envTmpl = `\n# Server\nHOST=0.0.0.0\nPORT=1337\n\n# Secrets\nAPP_KEYS=<%= appKeys %>\nAPI_TOKEN_SALT=<%= apiTokenSalt %>\nADMIN_JWT_SECRET=<%= adminJwtToken %>\nTRANSFER_TOKEN_SALT=<%= transferTokenSalt %>\nENCRYPTION_KEY=<%= encryptionKey %>\n\n# Database\nDATABASE_CLIENT=<%= database.client %>\nDATABASE_HOST=<%= database.connection.host %>\nDATABASE_PORT=<%= database.connection.port %>\nDATABASE_NAME=<%= database.connection.database %>\nDATABASE_USERNAME=<%= database.connection.username %>\nDATABASE_PASSWORD=<%= database.connection.password %>\nDATABASE_SSL=<%= database.connection.ssl %>\nDATABASE_FILENAME=<%= database.connection.filename %>\n`;\n\nexport function generateDotEnv(scope: Scope) {\n const compile = _.template(envTmpl);\n\n return compile({\n appKeys: new Array(4).fill(null).map(generateASecret).join(','),\n apiTokenSalt: generateASecret(),\n transferTokenSalt: generateASecret(),\n adminJwtToken: generateASecret(),\n encryptionKey: generateASecret(),\n database: {\n client: scope.database.client,\n connection: {\n ...scope.database.connection,\n ssl: scope.database.connection?.ssl || false,\n },\n },\n });\n}\n"],"names":["generateASecret","crypto","randomBytes","toString","envTmpl","generateDotEnv","scope","compile","_","template","appKeys","Array","fill","map","join","apiTokenSalt","transferTokenSalt","adminJwtToken","encryptionKey","database","client","connection","ssl"],"mappings":";;;;;AAKA,MAAMA,kBAAkB,IAAMC,MAAAA,CAAOC,WAAW,CAAC,EAAA,CAAA,CAAIC,QAAQ,CAAC,QAAA,CAAA;AAE9D,MAAMC,UAAU;;;;;;;;;;;;;;;;;;;;;AAqBhB,CAAC;AAEM,SAASC,eAAeC,KAAY,EAAA;IACzC,MAAMC,OAAAA,GAAUC,CAAEC,CAAAA,QAAQ,CAACL,OAAAA,CAAAA;AAE3B,IAAA,OAAOG,OAAQ,CAAA;QACbG,OAAS,EAAA,IAAIC,KAAM,CAAA,CAAA,CAAA,CAAGC,IAAI,CAAC,MAAMC,GAAG,CAACb,eAAiBc,CAAAA,CAAAA,IAAI,CAAC,GAAA,CAAA;QAC3DC,YAAcf,EAAAA,eAAAA,EAAAA;QACdgB,iBAAmBhB,EAAAA,eAAAA,EAAAA;QACnBiB,aAAejB,EAAAA,eAAAA,EAAAA;QACfkB,aAAelB,EAAAA,eAAAA,EAAAA;QACfmB,QAAU,EAAA;YACRC,MAAQd,EAAAA,KAAAA,CAAMa,QAAQ,CAACC,MAAM;YAC7BC,UAAY,EAAA;gBACV,GAAGf,KAAAA,CAAMa,QAAQ,CAACE,UAAU;AAC5BC,gBAAAA,GAAAA,EAAKhB,KAAMa,CAAAA,QAAQ,CAACE,UAAU,EAAEC,GAAO,IAAA;AACzC;AACF;AACF,KAAA,CAAA;AACF;;;;"}
|
package/dist/utils/dot-env.mjs
CHANGED
|
@@ -12,6 +12,7 @@ APP_KEYS=<%= appKeys %>
|
|
|
12
12
|
API_TOKEN_SALT=<%= apiTokenSalt %>
|
|
13
13
|
ADMIN_JWT_SECRET=<%= adminJwtToken %>
|
|
14
14
|
TRANSFER_TOKEN_SALT=<%= transferTokenSalt %>
|
|
15
|
+
ENCRYPTION_KEY=<%= encryptionKey %>
|
|
15
16
|
|
|
16
17
|
# Database
|
|
17
18
|
DATABASE_CLIENT=<%= database.client %>
|
|
@@ -30,6 +31,7 @@ function generateDotEnv(scope) {
|
|
|
30
31
|
apiTokenSalt: generateASecret(),
|
|
31
32
|
transferTokenSalt: generateASecret(),
|
|
32
33
|
adminJwtToken: generateASecret(),
|
|
34
|
+
encryptionKey: generateASecret(),
|
|
33
35
|
database: {
|
|
34
36
|
client: scope.database.client,
|
|
35
37
|
connection: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dot-env.mjs","sources":["../../src/utils/dot-env.ts"],"sourcesContent":["import crypto from 'crypto';\nimport _ from 'lodash';\n\nimport type { Scope } from '../types';\n\nconst generateASecret = () => crypto.randomBytes(16).toString('base64');\n\nconst envTmpl = `\n# Server\nHOST=0.0.0.0\nPORT=1337\n\n# Secrets\nAPP_KEYS=<%= appKeys %>\nAPI_TOKEN_SALT=<%= apiTokenSalt %>\nADMIN_JWT_SECRET=<%= adminJwtToken %>\nTRANSFER_TOKEN_SALT=<%= transferTokenSalt %>\n\n# Database\nDATABASE_CLIENT=<%= database.client %>\nDATABASE_HOST=<%= database.connection.host %>\nDATABASE_PORT=<%= database.connection.port %>\nDATABASE_NAME=<%= database.connection.database %>\nDATABASE_USERNAME=<%= database.connection.username %>\nDATABASE_PASSWORD=<%= database.connection.password %>\nDATABASE_SSL=<%= database.connection.ssl %>\nDATABASE_FILENAME=<%= database.connection.filename %>\n`;\n\nexport function generateDotEnv(scope: Scope) {\n const compile = _.template(envTmpl);\n\n return compile({\n appKeys: new Array(4).fill(null).map(generateASecret).join(','),\n apiTokenSalt: generateASecret(),\n transferTokenSalt: generateASecret(),\n adminJwtToken: generateASecret(),\n database: {\n client: scope.database.client,\n connection: {\n ...scope.database.connection,\n ssl: scope.database.connection?.ssl || false,\n },\n },\n });\n}\n"],"names":["generateASecret","crypto","randomBytes","toString","envTmpl","generateDotEnv","scope","compile","_","template","appKeys","Array","fill","map","join","apiTokenSalt","transferTokenSalt","adminJwtToken","database","client","connection","ssl"],"mappings":";;;AAKA,MAAMA,kBAAkB,IAAMC,MAAAA,CAAOC,WAAW,CAAC,EAAA,CAAA,CAAIC,QAAQ,CAAC,QAAA,CAAA;AAE9D,MAAMC,UAAU
|
|
1
|
+
{"version":3,"file":"dot-env.mjs","sources":["../../src/utils/dot-env.ts"],"sourcesContent":["import crypto from 'crypto';\nimport _ from 'lodash';\n\nimport type { Scope } from '../types';\n\nconst generateASecret = () => crypto.randomBytes(16).toString('base64');\n\nconst envTmpl = `\n# Server\nHOST=0.0.0.0\nPORT=1337\n\n# Secrets\nAPP_KEYS=<%= appKeys %>\nAPI_TOKEN_SALT=<%= apiTokenSalt %>\nADMIN_JWT_SECRET=<%= adminJwtToken %>\nTRANSFER_TOKEN_SALT=<%= transferTokenSalt %>\nENCRYPTION_KEY=<%= encryptionKey %>\n\n# Database\nDATABASE_CLIENT=<%= database.client %>\nDATABASE_HOST=<%= database.connection.host %>\nDATABASE_PORT=<%= database.connection.port %>\nDATABASE_NAME=<%= database.connection.database %>\nDATABASE_USERNAME=<%= database.connection.username %>\nDATABASE_PASSWORD=<%= database.connection.password %>\nDATABASE_SSL=<%= database.connection.ssl %>\nDATABASE_FILENAME=<%= database.connection.filename %>\n`;\n\nexport function generateDotEnv(scope: Scope) {\n const compile = _.template(envTmpl);\n\n return compile({\n appKeys: new Array(4).fill(null).map(generateASecret).join(','),\n apiTokenSalt: generateASecret(),\n transferTokenSalt: generateASecret(),\n adminJwtToken: generateASecret(),\n encryptionKey: generateASecret(),\n database: {\n client: scope.database.client,\n connection: {\n ...scope.database.connection,\n ssl: scope.database.connection?.ssl || false,\n },\n },\n });\n}\n"],"names":["generateASecret","crypto","randomBytes","toString","envTmpl","generateDotEnv","scope","compile","_","template","appKeys","Array","fill","map","join","apiTokenSalt","transferTokenSalt","adminJwtToken","encryptionKey","database","client","connection","ssl"],"mappings":";;;AAKA,MAAMA,kBAAkB,IAAMC,MAAAA,CAAOC,WAAW,CAAC,EAAA,CAAA,CAAIC,QAAQ,CAAC,QAAA,CAAA;AAE9D,MAAMC,UAAU;;;;;;;;;;;;;;;;;;;;;AAqBhB,CAAC;AAEM,SAASC,eAAeC,KAAY,EAAA;IACzC,MAAMC,OAAAA,GAAUC,CAAEC,CAAAA,QAAQ,CAACL,OAAAA,CAAAA;AAE3B,IAAA,OAAOG,OAAQ,CAAA;QACbG,OAAS,EAAA,IAAIC,KAAM,CAAA,CAAA,CAAA,CAAGC,IAAI,CAAC,MAAMC,GAAG,CAACb,eAAiBc,CAAAA,CAAAA,IAAI,CAAC,GAAA,CAAA;QAC3DC,YAAcf,EAAAA,eAAAA,EAAAA;QACdgB,iBAAmBhB,EAAAA,eAAAA,EAAAA;QACnBiB,aAAejB,EAAAA,eAAAA,EAAAA;QACfkB,aAAelB,EAAAA,eAAAA,EAAAA;QACfmB,QAAU,EAAA;YACRC,MAAQd,EAAAA,KAAAA,CAAMa,QAAQ,CAACC,MAAM;YAC7BC,UAAY,EAAA;gBACV,GAAGf,KAAAA,CAAMa,QAAQ,CAACE,UAAU;AAC5BC,gBAAAA,GAAAA,EAAKhB,KAAMa,CAAAA,QAAQ,CAACE,UAAU,EAAEC,GAAO,IAAA;AACzC;AACF;AACF,KAAA,CAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-strapi-app",
|
|
3
|
-
"version": "5.13.0
|
|
3
|
+
"version": "5.13.0",
|
|
4
4
|
"description": "Generate a new Strapi application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create-strapi-app",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"watch": "run -T rollup -c -w"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@strapi/cloud-cli": "5.13.0
|
|
53
|
+
"@strapi/cloud-cli": "5.13.0",
|
|
54
54
|
"async-retry": "1.3.3",
|
|
55
55
|
"chalk": "4.1.2",
|
|
56
56
|
"commander": "8.3.0",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@types/async-retry": "^1",
|
|
70
70
|
"@types/fs-extra": "11.0.4",
|
|
71
71
|
"@types/inquirer": "8.2.5",
|
|
72
|
-
"eslint-config-custom": "5.13.0
|
|
73
|
-
"tsconfig": "5.13.0
|
|
72
|
+
"eslint-config-custom": "5.13.0",
|
|
73
|
+
"tsconfig": "5.13.0"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=18.0.0 <=22.x.x",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"machine-id.d.ts","sourceRoot":"","sources":["../../src/utils/machine-id.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,WAQxB"}
|
package/dist/utils/machine-id.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var crypto = require('crypto');
|
|
4
|
-
var nodeMachineId = require('node-machine-id');
|
|
5
|
-
|
|
6
|
-
function machineID() {
|
|
7
|
-
try {
|
|
8
|
-
const deviceId = nodeMachineId.machineIdSync();
|
|
9
|
-
return deviceId;
|
|
10
|
-
} catch (error) {
|
|
11
|
-
const deviceId = crypto.randomUUID();
|
|
12
|
-
return deviceId;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
exports.machineID = machineID;
|
|
17
|
-
//# sourceMappingURL=machine-id.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"machine-id.js","sources":["../../src/utils/machine-id.ts"],"sourcesContent":["import { randomUUID } from 'crypto';\nimport { machineIdSync } from 'node-machine-id';\n\nexport function machineID() {\n try {\n const deviceId = machineIdSync();\n return deviceId;\n } catch (error) {\n const deviceId = randomUUID();\n return deviceId;\n }\n}\n"],"names":["machineID","deviceId","machineIdSync","error","randomUUID"],"mappings":";;;;;AAGO,SAASA,SAAAA,GAAAA;IACd,IAAI;AACF,QAAA,MAAMC,QAAWC,GAAAA,2BAAAA,EAAAA;QACjB,OAAOD,QAAAA;AACT,KAAA,CAAE,OAAOE,KAAO,EAAA;AACd,QAAA,MAAMF,QAAWG,GAAAA,iBAAAA,EAAAA;QACjB,OAAOH,QAAAA;AACT;AACF;;;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from 'crypto';
|
|
2
|
-
import { machineIdSync } from 'node-machine-id';
|
|
3
|
-
|
|
4
|
-
function machineID() {
|
|
5
|
-
try {
|
|
6
|
-
const deviceId = machineIdSync();
|
|
7
|
-
return deviceId;
|
|
8
|
-
} catch (error) {
|
|
9
|
-
const deviceId = randomUUID();
|
|
10
|
-
return deviceId;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { machineID };
|
|
15
|
-
//# sourceMappingURL=machine-id.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"machine-id.mjs","sources":["../../src/utils/machine-id.ts"],"sourcesContent":["import { randomUUID } from 'crypto';\nimport { machineIdSync } from 'node-machine-id';\n\nexport function machineID() {\n try {\n const deviceId = machineIdSync();\n return deviceId;\n } catch (error) {\n const deviceId = randomUUID();\n return deviceId;\n }\n}\n"],"names":["machineID","deviceId","machineIdSync","error","randomUUID"],"mappings":";;;AAGO,SAASA,SAAAA,GAAAA;IACd,IAAI;AACF,QAAA,MAAMC,QAAWC,GAAAA,aAAAA,EAAAA;QACjB,OAAOD,QAAAA;AACT,KAAA,CAAE,OAAOE,KAAO,EAAA;AACd,QAAA,MAAMF,QAAWG,GAAAA,UAAAA,EAAAA;QACjB,OAAOH,QAAAA;AACT;AACF;;;;"}
|