@strapi/strapi 5.41.0 → 5.42.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/cli/commands/admin/create-user.d.ts.map +1 -1
- package/dist/cli/commands/admin/reset-user-password.d.ts.map +1 -1
- package/dist/cli/commands/export/action.d.ts +2 -0
- package/dist/cli/commands/export/action.d.ts.map +1 -1
- package/dist/cli/commands/export/command.d.ts.map +1 -1
- package/dist/cli/commands/export/validate-dir-format.d.ts +18 -0
- package/dist/cli/commands/export/validate-dir-format.d.ts.map +1 -0
- package/dist/cli/commands/import/action.d.ts +1 -1
- package/dist/cli/commands/import/action.d.ts.map +1 -1
- package/dist/cli/commands/import/command.d.ts.map +1 -1
- package/dist/cli/commands/transfer/command.d.ts.map +1 -1
- package/dist/cli/utils/commander.d.ts.map +1 -1
- package/dist/cli/utils/get-inquirer.d.ts +5 -0
- package/dist/cli/utils/get-inquirer.d.ts.map +1 -0
- package/dist/cli/utils/helpers.d.ts.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/package.json.mjs +1 -1
- package/dist/src/cli/commands/admin/create-user.js +2 -1
- package/dist/src/cli/commands/admin/create-user.js.map +1 -1
- package/dist/src/cli/commands/admin/create-user.mjs +2 -1
- package/dist/src/cli/commands/admin/create-user.mjs.map +1 -1
- package/dist/src/cli/commands/admin/reset-user-password.js +2 -1
- package/dist/src/cli/commands/admin/reset-user-password.js.map +1 -1
- package/dist/src/cli/commands/admin/reset-user-password.mjs +2 -1
- package/dist/src/cli/commands/admin/reset-user-password.mjs.map +1 -1
- package/dist/src/cli/commands/export/action.js +23 -4
- package/dist/src/cli/commands/export/action.js.map +1 -1
- package/dist/src/cli/commands/export/action.mjs +24 -5
- package/dist/src/cli/commands/export/action.mjs.map +1 -1
- package/dist/src/cli/commands/export/command.js +5 -1
- package/dist/src/cli/commands/export/command.js.map +1 -1
- package/dist/src/cli/commands/export/command.mjs +5 -1
- package/dist/src/cli/commands/export/command.mjs.map +1 -1
- package/dist/src/cli/commands/export/validate-dir-format.js +48 -0
- package/dist/src/cli/commands/export/validate-dir-format.js.map +1 -0
- package/dist/src/cli/commands/export/validate-dir-format.mjs +43 -0
- package/dist/src/cli/commands/export/validate-dir-format.mjs.map +1 -0
- package/dist/src/cli/commands/import/action.js +9 -5
- package/dist/src/cli/commands/import/action.js.map +1 -1
- package/dist/src/cli/commands/import/action.mjs +10 -6
- package/dist/src/cli/commands/import/action.mjs.map +1 -1
- package/dist/src/cli/commands/import/command.js +19 -5
- package/dist/src/cli/commands/import/command.js.map +1 -1
- package/dist/src/cli/commands/import/command.mjs +19 -5
- package/dist/src/cli/commands/import/command.mjs.map +1 -1
- package/dist/src/cli/commands/transfer/command.js +6 -1
- package/dist/src/cli/commands/transfer/command.js.map +1 -1
- package/dist/src/cli/commands/transfer/command.mjs +6 -1
- package/dist/src/cli/commands/transfer/command.mjs.map +1 -1
- package/dist/src/cli/utils/commander.js +3 -1
- package/dist/src/cli/utils/commander.js.map +1 -1
- package/dist/src/cli/utils/commander.mjs +3 -1
- package/dist/src/cli/utils/commander.mjs.map +1 -1
- package/dist/src/cli/utils/get-inquirer.js +10 -0
- package/dist/src/cli/utils/get-inquirer.js.map +1 -0
- package/dist/src/cli/utils/get-inquirer.mjs +8 -0
- package/dist/src/cli/utils/get-inquirer.mjs.map +1 -0
- package/dist/src/cli/utils/helpers.js +0 -1
- package/dist/src/cli/utils/helpers.js.map +1 -1
- package/dist/src/cli/utils/helpers.mjs +0 -1
- package/dist/src/cli/utils/helpers.mjs.map +1 -1
- package/package.json +22 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.mjs","sources":["../../../../src/cli/utils/helpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\nimport chalk from 'chalk';\nimport { has, isString, isArray } from 'lodash/fp';\nimport
|
|
1
|
+
{"version":3,"file":"helpers.mjs","sources":["../../../../src/cli/utils/helpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\nimport chalk from 'chalk';\nimport { has, isString, isArray } from 'lodash/fp';\nimport boxen from 'boxen';\nimport type { Command } from 'commander';\nimport { getInquirer } from './get-inquirer';\n\n/**\n * Helper functions for the Strapi CLI\n */\nconst bytesPerKb = 1024;\nconst sizes = ['B ', 'KB', 'MB', 'GB', 'TB', 'PB'];\n\n/**\n * Convert bytes to a human readable formatted string, for example \"1024\" becomes \"1KB\"\n */\nconst readableBytes = (bytes: number, decimals = 1, padStart = 0) => {\n if (!bytes) {\n return '0';\n }\n const i = Math.floor(Math.log(bytes) / Math.log(bytesPerKb));\n const result = `${parseFloat((bytes / bytesPerKb ** i).toFixed(decimals))} ${sizes[i].padStart(\n 2\n )}`;\n\n return result.padStart(padStart);\n};\n\ninterface ExitWithOptions {\n logger?: Console;\n prc?: NodeJS.Process;\n}\n\n/**\n *\n * Display message(s) to console and then call process.exit with code.\n * If code is zero, console.log and green text is used for messages, otherwise console.error and red text.\n *\n */\nconst exitWith = (code: number, message?: string | string[], options: ExitWithOptions = {}) => {\n const { logger = console, prc = process } = options;\n\n const log = (message: string) => {\n if (code === 0) {\n logger.log(chalk.green(message));\n } else {\n logger.error(chalk.red(message));\n }\n };\n\n if (isString(message)) {\n log(message);\n } else if (isArray(message)) {\n message.forEach((msg) => log(msg));\n }\n\n prc.exit(code);\n};\n\n/**\n * assert that a URL object has a protocol value\n *\n */\nconst assertUrlHasProtocol = (url: URL, protocol?: string | string[]) => {\n if (!url.protocol) {\n exitWith(1, `${url.toString()} does not have a protocol`);\n }\n\n // if just checking for the existence of a protocol, return\n if (!protocol) {\n return;\n }\n\n if (isString(protocol)) {\n if (protocol !== url.protocol) {\n exitWith(1, `${url.toString()} must have the protocol ${protocol}`);\n }\n return;\n }\n\n // assume an array\n if (!protocol.some((protocol) => url.protocol === protocol)) {\n return exitWith(\n 1,\n `${url.toString()} must have one of the following protocols: ${protocol.join(',')}`\n );\n }\n};\n\ntype ConditionCallback = (opts: Record<string, any>) => Promise<boolean>;\ntype IsMetCallback = (command: Command) => Promise<void>;\ntype IsNotMetCallback = (command: Command) => Promise<void>;\n\n/**\n * Passes commander options to conditionCallback(). If it returns true, call isMetCallback otherwise call isNotMetCallback\n */\nconst ifOptions = (\n conditionCallback: ConditionCallback,\n isMetCallback: IsMetCallback = async () => {},\n isNotMetCallback: IsNotMetCallback = async () => {}\n) => {\n return async (command: Command) => {\n const opts = command.opts();\n if (await conditionCallback(opts)) {\n await isMetCallback(command);\n } else {\n await isNotMetCallback(command);\n }\n };\n};\n\nconst assertCwdContainsStrapiProject = (name: string) => {\n const logErrorAndExit = () => {\n console.log(\n `You need to run ${chalk.yellow(\n `strapi ${name}`\n )} in a Strapi project. Make sure you are in the right directory.`\n );\n process.exit(1);\n };\n\n try {\n const pkgJSON = require(`${process.cwd()}/package.json`);\n if (\n !has('dependencies.@strapi/strapi', pkgJSON) &&\n !has('devDependencies.@strapi/strapi', pkgJSON)\n ) {\n logErrorAndExit();\n }\n } catch (err) {\n logErrorAndExit();\n }\n};\n\nconst runAction =\n (name: string, action: (...args: any[]) => Promise<void>) =>\n (...args: unknown[]) => {\n assertCwdContainsStrapiProject(name);\n\n Promise.resolve()\n .then(() => {\n return action(...args);\n })\n .catch((error) => {\n console.error(error);\n process.exit(1);\n });\n };\n\n/**\n * @description Notify users this is an experimental command and get them to approve first\n * this can be opted out by passing `yes` as a property of the args object.\n *\n * @example\n * ```ts\n * const { notifyExperimentalCommand } = require('../utils/helpers');\n *\n * const myCommand = async ({ force }) => {\n * await notifyExperimentalCommand('plugin:build', { force });\n * }\n * ```\n */\nconst notifyExperimentalCommand = async (name: string, { force }: { force?: boolean } = {}) => {\n console.log(\n boxen(\n `The ${chalk.bold(\n chalk.underline(name)\n )} command is considered experimental, use at your own risk.`,\n {\n title: 'Warning',\n padding: 1,\n margin: 1,\n align: 'center',\n borderColor: 'yellow',\n borderStyle: 'bold',\n }\n )\n );\n\n if (!force) {\n const inquirer = await getInquirer();\n const { confirmed } = await inquirer.prompt({\n type: 'confirm',\n name: 'confirmed',\n message: 'Do you want to continue?',\n });\n\n if (!confirmed) {\n process.exit(0);\n }\n }\n};\n\nexport {\n exitWith,\n assertUrlHasProtocol,\n ifOptions,\n readableBytes,\n runAction,\n assertCwdContainsStrapiProject,\n notifyExperimentalCommand,\n};\n"],"names":["bytesPerKb","sizes","readableBytes","bytes","decimals","padStart","i","Math","floor","log","result","parseFloat","toFixed","exitWith","code","message","options","logger","console","prc","process","chalk","green","error","red","isString","isArray","forEach","msg","exit","assertUrlHasProtocol","url","protocol","toString","some","join","ifOptions","conditionCallback","isMetCallback","isNotMetCallback","command","opts","assertCwdContainsStrapiProject","name","logErrorAndExit","yellow","pkgJSON","require","cwd","has","err","runAction","action","args","Promise","resolve","then","catch"],"mappings":";;;;AAOA;;AAEC,IACD,MAAMA,UAAAA,GAAa,IAAA;AACnB,MAAMC,KAAAA,GAAQ;AAAC,IAAA,IAAA;AAAM,IAAA,IAAA;AAAM,IAAA,IAAA;AAAM,IAAA,IAAA;AAAM,IAAA,IAAA;AAAM,IAAA;AAAK,CAAA;AAElD;;IAGA,MAAMC,gBAAgB,CAACC,KAAAA,EAAeC,WAAW,CAAC,EAAEC,WAAW,CAAC,GAAA;AAC9D,IAAA,IAAI,CAACF,KAAAA,EAAO;QACV,OAAO,GAAA;AACT,IAAA;IACA,MAAMG,CAAAA,GAAIC,IAAAA,CAAKC,KAAK,CAACD,IAAAA,CAAKE,GAAG,CAACN,KAAAA,CAAAA,GAASI,IAAAA,CAAKE,GAAG,CAACT,UAAAA,CAAAA,CAAAA;IAChD,MAAMU,MAAAA,GAAS,GAAGC,UAAAA,CAAYR,CAAAA,KAAAA,GAAQH,UAAAA,IAAcM,CAAAA,EAAGM,OAAO,CAACR,QAAAA,CAAAA,CAAAA,CAAW,CAAC,EAAEH,KAAK,CAACK,EAAE,CAACD,QAAQ,CAC5F,CAAA,CAAA,CAAA,CACC;IAEH,OAAOK,MAAAA,CAAOL,Q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G3B,QAAQ4B,GAAG,EAAA,CAAG,aAAa,CAAC,CAAA;AACvD,QAAA,IACE,CAACC,GAAAA,CAAI,6BAAA,EAA+BH,YACpC,CAACG,GAAAA,CAAI,kCAAkCH,OAAAA,CAAAA,EACvC;AACAF,YAAAA,eAAAA,EAAAA;AACF,QAAA;AACF,IAAA,CAAA,CAAE,OAAOM,GAAAA,EAAK;AACZN,QAAAA,eAAAA,EAAAA;AACF,IAAA;AACF;AAEA,MAAMO,SAAAA,GACJ,CAACR,IAAAA,EAAcS,MAAAA,GACf,CAAC,GAAGC,IAAAA,GAAAA;QACFX,8BAAAA,CAA+BC,IAAAA,CAAAA;QAE/BW,OAAAA,CAAQC,OAAO,EAAA,CACZC,IAAI,CAAC,IAAA;AACJ,YAAA,OAAOJ,MAAAA,CAAAA,GAAUC,IAAAA,CAAAA;QACnB,CAAA,CAAA,CACCI,KAAK,CAAC,CAAClC,KAAAA,GAAAA;AACNL,YAAAA,OAAAA,CAAQK,KAAK,CAACA,KAAAA,CAAAA;AACdH,YAAAA,OAAAA,CAAQS,IAAI,CAAC,CAAA,CAAA;AACf,QAAA,CAAA,CAAA;AACJ,IAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/strapi",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.42.0",
|
|
4
4
|
"description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -109,25 +109,25 @@
|
|
|
109
109
|
},
|
|
110
110
|
"dependencies": {
|
|
111
111
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
112
|
-
"@strapi/admin": "5.
|
|
113
|
-
"@strapi/cloud-cli": "5.
|
|
114
|
-
"@strapi/content-manager": "5.
|
|
115
|
-
"@strapi/content-releases": "5.
|
|
116
|
-
"@strapi/content-type-builder": "5.
|
|
117
|
-
"@strapi/core": "5.
|
|
118
|
-
"@strapi/data-transfer": "5.
|
|
119
|
-
"@strapi/database": "5.
|
|
120
|
-
"@strapi/email": "5.
|
|
121
|
-
"@strapi/generators": "5.
|
|
122
|
-
"@strapi/i18n": "5.
|
|
123
|
-
"@strapi/logger": "5.
|
|
124
|
-
"@strapi/openapi": "5.
|
|
125
|
-
"@strapi/permissions": "5.
|
|
126
|
-
"@strapi/review-workflows": "5.
|
|
127
|
-
"@strapi/types": "5.
|
|
128
|
-
"@strapi/typescript-utils": "5.
|
|
129
|
-
"@strapi/upload": "5.
|
|
130
|
-
"@strapi/utils": "5.
|
|
112
|
+
"@strapi/admin": "5.42.0",
|
|
113
|
+
"@strapi/cloud-cli": "5.42.0",
|
|
114
|
+
"@strapi/content-manager": "5.42.0",
|
|
115
|
+
"@strapi/content-releases": "5.42.0",
|
|
116
|
+
"@strapi/content-type-builder": "5.42.0",
|
|
117
|
+
"@strapi/core": "5.42.0",
|
|
118
|
+
"@strapi/data-transfer": "5.42.0",
|
|
119
|
+
"@strapi/database": "5.42.0",
|
|
120
|
+
"@strapi/email": "5.42.0",
|
|
121
|
+
"@strapi/generators": "5.42.0",
|
|
122
|
+
"@strapi/i18n": "5.42.0",
|
|
123
|
+
"@strapi/logger": "5.42.0",
|
|
124
|
+
"@strapi/openapi": "5.42.0",
|
|
125
|
+
"@strapi/permissions": "5.42.0",
|
|
126
|
+
"@strapi/review-workflows": "5.42.0",
|
|
127
|
+
"@strapi/types": "5.42.0",
|
|
128
|
+
"@strapi/typescript-utils": "5.42.0",
|
|
129
|
+
"@strapi/upload": "5.42.0",
|
|
130
|
+
"@strapi/utils": "5.42.0",
|
|
131
131
|
"@types/nodemon": "1.19.6",
|
|
132
132
|
"@vitejs/plugin-react-swc": "3.6.0",
|
|
133
133
|
"boxen": "5.1.2",
|
|
@@ -180,11 +180,11 @@
|
|
|
180
180
|
"@types/node": "24.10.0",
|
|
181
181
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
182
182
|
"@types/webpack-hot-middleware": "2.25.9",
|
|
183
|
-
"eslint-config-custom": "5.
|
|
183
|
+
"eslint-config-custom": "5.42.0",
|
|
184
184
|
"jest": "29.6.0",
|
|
185
185
|
"react": "18.3.1",
|
|
186
186
|
"react-dom": "18.3.1",
|
|
187
|
-
"tsconfig": "5.
|
|
187
|
+
"tsconfig": "5.42.0",
|
|
188
188
|
"yalc": "1.0.0-pre.53"
|
|
189
189
|
},
|
|
190
190
|
"peerDependencies": {
|