@strapi/strapi 5.38.0 → 5.39.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/package.json.js +1 -1
- package/dist/package.json.mjs +1 -1
- package/dist/src/cli/commands/admin/create-user.js +1 -2
- package/dist/src/cli/commands/admin/create-user.js.map +1 -1
- package/dist/src/cli/commands/admin/create-user.mjs +1 -2
- package/dist/src/cli/commands/admin/create-user.mjs.map +1 -1
- package/package.json +24 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/admin/create-user.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"create-user.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/admin/create-user.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA8FD;;GAEG;AACH,QAAA,MAAM,MAAM,gBAAsB,UAAU,kBA8B3C,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,OAAO,EAAE,aASd,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/package.json.js
CHANGED
package/dist/package.json.mjs
CHANGED
|
@@ -28,8 +28,7 @@ const adminCreateSchema = utils.yup.object().shape({
|
|
|
28
28
|
* It's not an observable, in reality this is
|
|
29
29
|
* `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`
|
|
30
30
|
* but then the logic of the validate function needs to change.
|
|
31
|
-
*/
|
|
32
|
-
const promptQuestions = [
|
|
31
|
+
*/ const promptQuestions = [
|
|
33
32
|
{
|
|
34
33
|
type: 'input',
|
|
35
34
|
name: 'email',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.js","sources":["../../../../../src/cli/commands/admin/create-user.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { yup } from '@strapi/utils';\nimport _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport { runAction } from '../../utils/helpers';\nimport type { StrapiCommand } from '../../types';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n firstname?: string;\n lastname?: string;\n}\n\nconst emailValidator = yup.string().email('Invalid email address').lowercase();\n\nconst passwordValidator = yup\n .string()\n .min(8, 'Password must be at least 8 characters long')\n .test('lowercase', 'Password must contain at least one lowercase character', (value) => {\n if (!value) return true;\n return /[a-z]/.test(value);\n })\n .test('uppercase', 'Password must contain at least one uppercase character', (value) => {\n if (!value) return true;\n return /[A-Z]/.test(value);\n })\n .test('number', 'Password must contain at least one number', (value) => {\n if (!value) return true;\n return /\\d/.test(value);\n });\n\nconst adminCreateSchema = yup.object().shape({\n email: emailValidator,\n password: passwordValidator,\n firstname: yup.string().trim().required('First name is required'),\n lastname: yup.string(),\n});\n\ninterface Answers {\n email: string;\n password: string;\n firstname: string;\n lastname: string;\n confirm: boolean;\n}\n\n/**\n * It's not an observable, in reality this is\n * `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`\n * but then the logic of the validate function needs to change.\n */\
|
|
1
|
+
{"version":3,"file":"create-user.js","sources":["../../../../../src/cli/commands/admin/create-user.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { yup } from '@strapi/utils';\nimport _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport { runAction } from '../../utils/helpers';\nimport type { StrapiCommand } from '../../types';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n firstname?: string;\n lastname?: string;\n}\n\nconst emailValidator = yup.string().email('Invalid email address').lowercase();\n\nconst passwordValidator = yup\n .string()\n .min(8, 'Password must be at least 8 characters long')\n .test('lowercase', 'Password must contain at least one lowercase character', (value) => {\n if (!value) return true;\n return /[a-z]/.test(value);\n })\n .test('uppercase', 'Password must contain at least one uppercase character', (value) => {\n if (!value) return true;\n return /[A-Z]/.test(value);\n })\n .test('number', 'Password must contain at least one number', (value) => {\n if (!value) return true;\n return /\\d/.test(value);\n });\n\nconst adminCreateSchema = yup.object().shape({\n email: emailValidator,\n password: passwordValidator,\n firstname: yup.string().trim().required('First name is required'),\n lastname: yup.string(),\n});\n\ninterface Answers {\n email: string;\n password: string;\n firstname: string;\n lastname: string;\n confirm: boolean;\n}\n\n/**\n * It's not an observable, in reality this is\n * `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`\n * but then the logic of the validate function needs to change.\n */\nconst promptQuestions: inquirer.QuestionCollection<Answers> = [\n {\n type: 'input',\n name: 'email',\n message: 'Admin email?',\n async validate(value: string) {\n const validEmail = await emailValidator.validate(value);\n return validEmail === value || validEmail;\n },\n },\n {\n type: 'password',\n name: 'password',\n message: 'Admin password?',\n async validate(value: string) {\n const validPassword = await passwordValidator.validate(value);\n return validPassword === value || validPassword;\n },\n },\n { type: 'input', name: 'firstname', message: 'First name?' },\n { type: 'input', name: 'lastname', message: 'Last name?' },\n {\n type: 'confirm',\n name: 'confirm',\n message: 'Do you really want to create a new admin?',\n },\n];\n\nasync function createAdmin({ email, password, firstname, lastname }: CmdOptions) {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const user = await app.admin!.services.user.exists({ email });\n\n if (user) {\n console.error(`User with email \"${email}\" already exists`);\n process.exit(1);\n }\n\n const superAdminRole = await app.admin!.services.role.getSuperAdmin();\n\n await app.admin!.services.user.create({\n email,\n firstname,\n lastname,\n isActive: true,\n roles: [superAdminRole.id],\n ...(password && { password, registrationToken: null }),\n });\n\n console.log(`Successfully created new admin`);\n process.exit(0);\n}\n\n/**\n * Create new admin user\n */\nconst action = async (cmdOptions: CmdOptions = {}) => {\n let { email, password, firstname, lastname } = cmdOptions;\n\n if (\n _.isEmpty(email) &&\n _.isEmpty(password) &&\n _.isEmpty(firstname) &&\n _.isEmpty(lastname) &&\n process.stdin.isTTY\n ) {\n const inquiry = await inquirer.prompt(promptQuestions);\n\n if (!inquiry.confirm) {\n process.exit(0);\n }\n\n ({ email, password, firstname, lastname } = inquiry);\n }\n\n try {\n await adminCreateSchema.validate({ email, password, firstname, lastname });\n } catch (err) {\n if (err instanceof yup.ValidationError) {\n console.error(err.errors[0]);\n }\n\n process.exit(1);\n }\n\n return createAdmin({ email, password, firstname, lastname });\n};\n\n/**\n * `$ strapi admin:create-user`\n */\nconst command: StrapiCommand = () => {\n return createCommand('admin:create-user')\n .alias('admin:create')\n .description('Create a new admin')\n .option('-e, --email <email>', 'Email of the new admin')\n .option('-p, --password <password>', 'Password of the new admin')\n .option('-f, --firstname <first name>', 'First name of the new admin')\n .option('-l, --lastname <last name>', 'Last name of the new admin')\n .action(runAction('admin:create-user', action));\n};\n\nexport { action, command };\n"],"names":["emailValidator","yup","string","email","lowercase","passwordValidator","min","test","value","adminCreateSchema","object","shape","password","firstname","trim","required","lastname","promptQuestions","type","name","message","validate","validEmail","validPassword","createAdmin","appContext","compileStrapi","app","createStrapi","load","user","admin","services","exists","console","error","process","exit","superAdminRole","role","getSuperAdmin","create","isActive","roles","id","registrationToken","log","action","cmdOptions","_","isEmpty","stdin","isTTY","inquiry","inquirer","prompt","confirm","err","ValidationError","errors","command","createCommand","alias","description","option","runAction"],"mappings":";;;;;;;;;AAgBA,MAAMA,iBAAiBC,SAAAA,CAAIC,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AC;AAAElB,YAAAA,KAAAA;AAAOS,YAAAA,QAAAA;AAAUC,YAAAA,SAAAA;AAAWG,YAAAA;AAAS,SAAA,CAAA;AAC1E,IAAA,CAAA,CAAE,OAAOyC,GAAAA,EAAK;QACZ,IAAIA,GAAAA,YAAexD,SAAAA,CAAIyD,eAAe,EAAE;AACtCxB,YAAAA,OAAAA,CAAQC,KAAK,CAACsB,GAAAA,CAAIE,MAAM,CAAC,CAAA,CAAE,CAAA;AAC7B,QAAA;AAEAvB,QAAAA,OAAAA,CAAQC,IAAI,CAAC,CAAA,CAAA;AACf,IAAA;AAEA,IAAA,OAAOb,WAAAA,CAAY;AAAErB,QAAAA,KAAAA;AAAOS,QAAAA,QAAAA;AAAUC,QAAAA,SAAAA;AAAWG,QAAAA;AAAS,KAAA,CAAA;AAC5D;AAEA;;AAEC,UACK4C,OAAAA,GAAyB,IAAA;IAC7B,OAAOC,uBAAAA,CAAc,mBAAA,CAAA,CAClBC,KAAK,CAAC,cAAA,CAAA,CACNC,WAAW,CAAC,oBAAA,CAAA,CACZC,MAAM,CAAC,qBAAA,EAAuB,wBAAA,CAAA,CAC9BA,MAAM,CAAC,2BAAA,EAA6B,2BAAA,CAAA,CACpCA,MAAM,CAAC,8BAAA,EAAgC,6BAAA,CAAA,CACvCA,MAAM,CAAC,4BAAA,EAA8B,4BAAA,CAAA,CACrCjB,MAAM,CAACkB,iBAAAA,CAAU,mBAAA,EAAqBlB,MAAAA,CAAAA,CAAAA;AAC3C;;;;;"}
|
|
@@ -26,8 +26,7 @@ const adminCreateSchema = yup.object().shape({
|
|
|
26
26
|
* It's not an observable, in reality this is
|
|
27
27
|
* `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`
|
|
28
28
|
* but then the logic of the validate function needs to change.
|
|
29
|
-
*/
|
|
30
|
-
const promptQuestions = [
|
|
29
|
+
*/ const promptQuestions = [
|
|
31
30
|
{
|
|
32
31
|
type: 'input',
|
|
33
32
|
name: 'email',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.mjs","sources":["../../../../../src/cli/commands/admin/create-user.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { yup } from '@strapi/utils';\nimport _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport { runAction } from '../../utils/helpers';\nimport type { StrapiCommand } from '../../types';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n firstname?: string;\n lastname?: string;\n}\n\nconst emailValidator = yup.string().email('Invalid email address').lowercase();\n\nconst passwordValidator = yup\n .string()\n .min(8, 'Password must be at least 8 characters long')\n .test('lowercase', 'Password must contain at least one lowercase character', (value) => {\n if (!value) return true;\n return /[a-z]/.test(value);\n })\n .test('uppercase', 'Password must contain at least one uppercase character', (value) => {\n if (!value) return true;\n return /[A-Z]/.test(value);\n })\n .test('number', 'Password must contain at least one number', (value) => {\n if (!value) return true;\n return /\\d/.test(value);\n });\n\nconst adminCreateSchema = yup.object().shape({\n email: emailValidator,\n password: passwordValidator,\n firstname: yup.string().trim().required('First name is required'),\n lastname: yup.string(),\n});\n\ninterface Answers {\n email: string;\n password: string;\n firstname: string;\n lastname: string;\n confirm: boolean;\n}\n\n/**\n * It's not an observable, in reality this is\n * `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`\n * but then the logic of the validate function needs to change.\n */\
|
|
1
|
+
{"version":3,"file":"create-user.mjs","sources":["../../../../../src/cli/commands/admin/create-user.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { yup } from '@strapi/utils';\nimport _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport { runAction } from '../../utils/helpers';\nimport type { StrapiCommand } from '../../types';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n firstname?: string;\n lastname?: string;\n}\n\nconst emailValidator = yup.string().email('Invalid email address').lowercase();\n\nconst passwordValidator = yup\n .string()\n .min(8, 'Password must be at least 8 characters long')\n .test('lowercase', 'Password must contain at least one lowercase character', (value) => {\n if (!value) return true;\n return /[a-z]/.test(value);\n })\n .test('uppercase', 'Password must contain at least one uppercase character', (value) => {\n if (!value) return true;\n return /[A-Z]/.test(value);\n })\n .test('number', 'Password must contain at least one number', (value) => {\n if (!value) return true;\n return /\\d/.test(value);\n });\n\nconst adminCreateSchema = yup.object().shape({\n email: emailValidator,\n password: passwordValidator,\n firstname: yup.string().trim().required('First name is required'),\n lastname: yup.string(),\n});\n\ninterface Answers {\n email: string;\n password: string;\n firstname: string;\n lastname: string;\n confirm: boolean;\n}\n\n/**\n * It's not an observable, in reality this is\n * `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`\n * but then the logic of the validate function needs to change.\n */\nconst promptQuestions: inquirer.QuestionCollection<Answers> = [\n {\n type: 'input',\n name: 'email',\n message: 'Admin email?',\n async validate(value: string) {\n const validEmail = await emailValidator.validate(value);\n return validEmail === value || validEmail;\n },\n },\n {\n type: 'password',\n name: 'password',\n message: 'Admin password?',\n async validate(value: string) {\n const validPassword = await passwordValidator.validate(value);\n return validPassword === value || validPassword;\n },\n },\n { type: 'input', name: 'firstname', message: 'First name?' },\n { type: 'input', name: 'lastname', message: 'Last name?' },\n {\n type: 'confirm',\n name: 'confirm',\n message: 'Do you really want to create a new admin?',\n },\n];\n\nasync function createAdmin({ email, password, firstname, lastname }: CmdOptions) {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const user = await app.admin!.services.user.exists({ email });\n\n if (user) {\n console.error(`User with email \"${email}\" already exists`);\n process.exit(1);\n }\n\n const superAdminRole = await app.admin!.services.role.getSuperAdmin();\n\n await app.admin!.services.user.create({\n email,\n firstname,\n lastname,\n isActive: true,\n roles: [superAdminRole.id],\n ...(password && { password, registrationToken: null }),\n });\n\n console.log(`Successfully created new admin`);\n process.exit(0);\n}\n\n/**\n * Create new admin user\n */\nconst action = async (cmdOptions: CmdOptions = {}) => {\n let { email, password, firstname, lastname } = cmdOptions;\n\n if (\n _.isEmpty(email) &&\n _.isEmpty(password) &&\n _.isEmpty(firstname) &&\n _.isEmpty(lastname) &&\n process.stdin.isTTY\n ) {\n const inquiry = await inquirer.prompt(promptQuestions);\n\n if (!inquiry.confirm) {\n process.exit(0);\n }\n\n ({ email, password, firstname, lastname } = inquiry);\n }\n\n try {\n await adminCreateSchema.validate({ email, password, firstname, lastname });\n } catch (err) {\n if (err instanceof yup.ValidationError) {\n console.error(err.errors[0]);\n }\n\n process.exit(1);\n }\n\n return createAdmin({ email, password, firstname, lastname });\n};\n\n/**\n * `$ strapi admin:create-user`\n */\nconst command: StrapiCommand = () => {\n return createCommand('admin:create-user')\n .alias('admin:create')\n .description('Create a new admin')\n .option('-e, --email <email>', 'Email of the new admin')\n .option('-p, --password <password>', 'Password of the new admin')\n .option('-f, --firstname <first name>', 'First name of the new admin')\n .option('-l, --lastname <last name>', 'Last name of the new admin')\n .action(runAction('admin:create-user', action));\n};\n\nexport { action, command };\n"],"names":["emailValidator","yup","string","email","lowercase","passwordValidator","min","test","value","adminCreateSchema","object","shape","password","firstname","trim","required","lastname","promptQuestions","type","name","message","validate","validEmail","validPassword","createAdmin","appContext","compileStrapi","app","createStrapi","load","user","admin","services","exists","console","error","process","exit","superAdminRole","role","getSuperAdmin","create","isActive","roles","id","registrationToken","log","action","cmdOptions","_","isEmpty","stdin","isTTY","inquiry","inquirer","prompt","confirm","err","ValidationError","errors","command","createCommand","alias","description","option","runAction"],"mappings":";;;;;;;AAgBA,MAAMA,iBAAiBC,GAAAA,CAAIC,MAAM,GAAGC,KAAK,CAAC,yBAAyBC,SAAS,EAAA;AAE5E,MAAMC,iBAAAA,GAAoBJ,GAAAA,CACvBC,MAAM,EAAA,CACNI,GAAG,CAAC,CAAA,EAAG,6CAAA,CAAA,CACPC,IAAI,CAAC,WAAA,EAAa,wDAAA,EAA0D,CAACC,KAAAA,GAAAA;IAC5E,IAAI,CAACA,OAAO,OAAO,IAAA;IACnB,OAAO,OAAA,CAAQD,IAAI,CAACC,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AAC7B,QAAA;AAEAvB,QAAAA,OAAAA,CAAQC,IAAI,CAAC,CAAA,CAAA;AACf,IAAA;AAEA,IAAA,OAAOb,WAAAA,CAAY;AAAErB,QAAAA,KAAAA;AAAOS,QAAAA,QAAAA;AAAUC,QAAAA,SAAAA;AAAWG,QAAAA;AAAS,KAAA,CAAA;AAC5D;AAEA;;AAEC,UACK4C,OAAAA,GAAyB,IAAA;IAC7B,OAAOC,aAAAA,CAAc,mBAAA,CAAA,CAClBC,KAAK,CAAC,cAAA,CAAA,CACNC,WAAW,CAAC,oBAAA,CAAA,CACZC,MAAM,CAAC,qBAAA,EAAuB,wBAAA,CAAA,CAC9BA,MAAM,CAAC,2BAAA,EAA6B,2BAAA,CAAA,CACpCA,MAAM,CAAC,8BAAA,EAAgC,6BAAA,CAAA,CACvCA,MAAM,CAAC,4BAAA,EAA8B,4BAAA,CAAA,CACrCjB,MAAM,CAACkB,SAAAA,CAAU,mBAAA,EAAqBlB,MAAAA,CAAAA,CAAAA;AAC3C;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/strapi",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.39.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",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|
|
51
|
-
"url": "git://github.com/strapi/strapi.git"
|
|
51
|
+
"url": "git://github.com/strapi/strapi.git",
|
|
52
|
+
"directory": "packages/core/strapi"
|
|
52
53
|
},
|
|
53
54
|
"license": "SEE LICENSE IN LICENSE",
|
|
54
55
|
"author": {
|
|
@@ -110,25 +111,25 @@
|
|
|
110
111
|
},
|
|
111
112
|
"dependencies": {
|
|
112
113
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
113
|
-
"@strapi/admin": "5.
|
|
114
|
-
"@strapi/cloud-cli": "5.
|
|
115
|
-
"@strapi/content-manager": "5.
|
|
116
|
-
"@strapi/content-releases": "5.
|
|
117
|
-
"@strapi/content-type-builder": "5.
|
|
118
|
-
"@strapi/core": "5.
|
|
119
|
-
"@strapi/data-transfer": "5.
|
|
120
|
-
"@strapi/database": "5.
|
|
121
|
-
"@strapi/email": "5.
|
|
122
|
-
"@strapi/generators": "5.
|
|
123
|
-
"@strapi/i18n": "5.
|
|
124
|
-
"@strapi/logger": "5.
|
|
125
|
-
"@strapi/openapi": "5.
|
|
126
|
-
"@strapi/permissions": "5.
|
|
127
|
-
"@strapi/review-workflows": "5.
|
|
128
|
-
"@strapi/types": "5.
|
|
129
|
-
"@strapi/typescript-utils": "5.
|
|
130
|
-
"@strapi/upload": "5.
|
|
131
|
-
"@strapi/utils": "5.
|
|
114
|
+
"@strapi/admin": "5.39.0",
|
|
115
|
+
"@strapi/cloud-cli": "5.39.0",
|
|
116
|
+
"@strapi/content-manager": "5.39.0",
|
|
117
|
+
"@strapi/content-releases": "5.39.0",
|
|
118
|
+
"@strapi/content-type-builder": "5.39.0",
|
|
119
|
+
"@strapi/core": "5.39.0",
|
|
120
|
+
"@strapi/data-transfer": "5.39.0",
|
|
121
|
+
"@strapi/database": "5.39.0",
|
|
122
|
+
"@strapi/email": "5.39.0",
|
|
123
|
+
"@strapi/generators": "5.39.0",
|
|
124
|
+
"@strapi/i18n": "5.39.0",
|
|
125
|
+
"@strapi/logger": "5.39.0",
|
|
126
|
+
"@strapi/openapi": "5.39.0",
|
|
127
|
+
"@strapi/permissions": "5.39.0",
|
|
128
|
+
"@strapi/review-workflows": "5.39.0",
|
|
129
|
+
"@strapi/types": "5.39.0",
|
|
130
|
+
"@strapi/typescript-utils": "5.39.0",
|
|
131
|
+
"@strapi/upload": "5.39.0",
|
|
132
|
+
"@strapi/utils": "5.39.0",
|
|
132
133
|
"@types/nodemon": "1.19.6",
|
|
133
134
|
"@vitejs/plugin-react-swc": "3.6.0",
|
|
134
135
|
"boxen": "5.1.2",
|
|
@@ -182,11 +183,11 @@
|
|
|
182
183
|
"@types/node": "24.10.0",
|
|
183
184
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
184
185
|
"@types/webpack-hot-middleware": "2.25.9",
|
|
185
|
-
"eslint-config-custom": "5.
|
|
186
|
+
"eslint-config-custom": "5.39.0",
|
|
186
187
|
"jest": "29.6.0",
|
|
187
188
|
"react": "18.3.1",
|
|
188
189
|
"react-dom": "18.3.1",
|
|
189
|
-
"tsconfig": "5.
|
|
190
|
+
"tsconfig": "5.39.0"
|
|
190
191
|
},
|
|
191
192
|
"peerDependencies": {
|
|
192
193
|
"react": "^17.0.0 || ^18.0.0",
|