-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #359 from Fekide/357-feature-support-nodejs-20
fix(deps): support node 20 and strapi v4.13
- Loading branch information
Showing
13 changed files
with
2,543 additions
and
2,019 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,3 +113,4 @@ exports | |
dist | ||
build | ||
.strapi-updater.json | ||
types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
{ | ||
"dependencies": { | ||
"@strapi/plugin-i18n": "4.9.2", | ||
"@strapi/plugin-users-permissions": "4.7.1", | ||
"@strapi/strapi": "4.9.2", | ||
"better-sqlite3": "8.2.0", | ||
"dotenv": "^16.0.3", | ||
"lodash.set": "^4.3.2", | ||
"mime-types": "^2.1.27", | ||
"strapi-plugin-init-admin-user": "^0.2.1" | ||
}, | ||
"name": "playground", | ||
"private": true, | ||
"version": "0.1.0", | ||
"private": true, | ||
"description": "A Strapi application", | ||
"license": "MIT", | ||
"author": { | ||
"name": "A Strapi developer" | ||
}, | ||
"scripts": { | ||
"build": "strapi build", | ||
"cy:run": "cypress run", | ||
"develop": "strapi develop", | ||
"e2e": "ENV_PATH='./.env.test' start-server-and-test 'yarn start' http://0.0.0.0:1337 'yarn cy:run'", | ||
"reset": "node scripts/reset.js", | ||
"start": "strapi start", | ||
"build": "strapi build", | ||
"strapi": "strapi", | ||
"reset": "node scripts/reset.js", | ||
"cy:run": "cypress run", | ||
"test": "echo no unittests", | ||
"e2e": "ENV_PATH='./.env.test' start-server-and-test 'yarn start' http://0.0.0.0:1337 'yarn cy:run'" | ||
"test": "echo no unittests" | ||
}, | ||
"dependencies": { | ||
"@strapi/plugin-i18n": "4.15.0", | ||
"@strapi/plugin-users-permissions": "4.15.0", | ||
"@strapi/strapi": "4.15.0", | ||
"better-sqlite3": "8.2.0", | ||
"dotenv": "^16.0.3", | ||
"lodash.set": "^4.3.2", | ||
"mime-types": "^2.1.27" | ||
}, | ||
"devDependencies": { | ||
"cypress": "^12.7.0", | ||
"start-server-and-test": "^2.0.0" | ||
}, | ||
"author": { | ||
"name": "A Strapi developer" | ||
"engines": { | ||
"node": ">=14.19.1 <=20.x.x", | ||
"npm": ">=6.0.0" | ||
}, | ||
"strapi": { | ||
"uuid": "e52249f8-dcf2-4e7b-8612-7713abc46c04", | ||
"template": "@strapi/template-blog@^1.0.0", | ||
"starter": "@strapi/starter-next-blog", | ||
"telemetryDisabled": true | ||
}, | ||
"engines": { | ||
"node": ">=14.19.1 <=18.x.x", | ||
"npm": ">=6.0.0" | ||
}, | ||
"license": "MIT" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// MIT License | ||
|
||
// Copyright (c) 2022 minzig | ||
|
||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
|
||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
|
||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
module.exports = { | ||
async getSuperAdminRole() { | ||
try { | ||
await strapi.admin.services.role.createRolesIfNoneExist() | ||
} catch (e) { | ||
strapi.log.error(`Couldn't check for & create existing roles.`, e) | ||
} | ||
|
||
let superAdminRole = await strapi.db.query('admin::role').findOne({ | ||
select: [], | ||
where: { code: 'strapi-super-admin' }, | ||
orderBy: {}, | ||
populate: {}, | ||
}) | ||
|
||
if (!superAdminRole) { | ||
superAdminRole = await strapi.db.query('admin::role').create({ | ||
data: { | ||
name: 'Super Admin', | ||
code: 'strapi-super-admin', | ||
description: | ||
'Super Admins can access and manage all features and settings.', | ||
}, | ||
}) | ||
} | ||
|
||
return superAdminRole | ||
}, | ||
initAdminData(env) { | ||
const useJsonData = (initAdminString) => { | ||
let adminData = {} | ||
try { | ||
adminData = JSON.parse(initAdminString) | ||
} catch (e) { | ||
strapi.log.error(`Couldn't parse adminData from INIT_ADMIN.`, e) | ||
} | ||
return adminData | ||
} | ||
return { | ||
username: env.INIT_ADMIN_USERNAME || 'admin', | ||
password: env.INIT_ADMIN_PASSWORD || 'admin', | ||
firstname: env.INIT_ADMIN_FIRSTNAME || 'Admin', | ||
lastname: env.INIT_ADMIN_LASTNAME || 'Admin', | ||
email: env.INIT_ADMIN_EMAIL || '[email protected]', | ||
blocked: false, | ||
isActive: true, | ||
...(typeof env.INIT_ADMIN === 'string' && | ||
env.INIT_ADMIN.includes('{"') && { | ||
...useJsonData(env.INIT_ADMIN), | ||
}), | ||
} | ||
}, | ||
} |
Oops, something went wrong.