Fix build due to layout

This commit is contained in:
Aurelsicoko 2017-12-04 14:29:16 +01:00
parent b195ae0ef8
commit 2b86bde1b4
7 changed files with 46 additions and 281 deletions

View File

@ -26,21 +26,20 @@ module.exports = scope => {
'description': `Description of ${scope.id} plugin.`
},
'scripts': {
'analyze:clean': 'rimraf stats.json',
'analyze:clean': 'node ./node_modules/strapi-helper-plugin/node_modules/.bin/rimraf stats.json',
'preanalyze': 'npm run analyze:clean',
'analyze': 'node node_modules/strapi-helper-plugin/lib/internals/scripts/analyze.js',
'analyze': 'node ./node_modules/strapi-helper-plugin/lib/internals/scripts/analyze.js',
'prebuild': 'npm run build:clean && npm run test',
'build:dev': 'cross-env NODE_ENV=development webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress',
'build': 'cross-env NODE_ENV=production webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress',
'build:clean': 'rimraf admin/build',
'start': 'cross-env NODE_ENV=development node node_modules/strapi-helper-plugin/lib/server',
'generate': 'plop --plopfile node_modules/strapi-helper-plugin/lib/internals/generators/index.js',
'lint': 'eslint --ignore-path .gitignore --config node_modules/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json admin',
'build:dev': 'node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=development node ./node_modules/strapi-helper-plugin/node_modules/.bin/webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress',
'build': 'node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=production node node_modules/strapi-helper-plugin/node_modules/.bin/webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress',
'build:clean': 'node ./node_modules/strapi-helper-plugin/node_modules/.bin/rimraf admin/build',
'start': 'node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=development node ./node_modules/strapi-helper-plugin/lib/server',
'generate': 'node ./node_modules/plop/plop.js --plopfile node_modules/strapi-helper-plugin/lib/internals/generators/index.js',
'lint': 'node ./node_modules/strapi-helper-plugin/node_modules/.bin/eslint --ignore-path .gitignore --config ./node_modules/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json admin',
'pretest': 'npm run lint',
'prettier': 'prettier --single-quote --trailing-comma es5 --write \"{admin,__{tests,mocks}__}/**/*.js\"',
'prettier': 'node ./node_modules/strapi-helper-plugin/node_modules/.bin/prettier --single-quote --trailing-comma es5 --write "{admin,__{tests,mocks}__}/**/*.js"',
'test': 'echo Tests are not implemented.',
'prepublish': 'npm run build',
'postinstall': 'node node_modules/strapi-helper-plugin/lib/internals/scripts/postinstall.js'
'prepublishOnly': 'npm run build'
},
'dependencies': {},
'devDependencies': {

File diff suppressed because one or more lines are too long

View File

@ -39,9 +39,13 @@ const plugins = [
// Minify and optimize the JavaScript
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
parallel: true,
compress: {
warnings: false
},
uglifyOptions: {
ecma: 8,
},
}),
new webpack.LoaderOptionsPlugin({
minimize: true

View File

@ -22,17 +22,16 @@ const tryRequireRoot = (source) => {
}
};
const tryRequireConfig = (source) => {
const bootstrap = tryRequireRoot('bootstrap');
const pluginRequirements = tryRequireRoot('requirements');
const layout = (() => {
try {
return require('../../../../config/' + source + '.js');
return require('../../../../config/layout.js');
} catch(err) {
return null;
}
};
const bootstrap = tryRequireRoot('bootstrap');
const pluginRequirements = tryRequireRoot('requirements');
const layout = tryRequireConfig('layout');
})();
const injectedComponents = (() => {
try {

View File

@ -256,268 +256,34 @@
}
},
"application": {
"controllers": {}
}
}
},
"1": {
"name": "Guest",
"description": "",
"permissions": {
"content-manager": {
"controllers": {
"contentmanager": {
"models": {
"enabled": false,
"policy": ""
},
"product": {
"find": {
"enabled": false,
"policy": ""
},
"count": {
"enabled": false,
"policy": ""
},
"findOne": {
"enabled": false,
"policy": ""
},
"create": {
"enabled": false,
"policy": ""
},
"update": {
"enabled": false,
"policy": ""
},
"delete": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
}
}
},
"content-type-builder": {
"controllers": {
"contenttypebuilder": {
"getModels": {
"enabled": false,
"policy": ""
},
"updateModel": {
"enabled": false,
"policy": ""
},
"checkTableExists": {
"enabled": false,
"policy": ""
},
"autoReload": {
"enabled": false,
"policy": ""
},
"createModel": {
"enabled": false,
"policy": ""
},
"getModel": {
"enabled": false,
"policy": ""
},
"deleteModel": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
},
"getConnections": {
"enabled": false,
"policy": ""
}
}
}
},
"settings-manager": {
"controllers": {
"settingsmanager": {
"environments": {
"enabled": false,
"policy": ""
},
"deleteLanguage": {
"enabled": false,
"policy": ""
},
"updateDatabase": {
"enabled": false,
"policy": ""
},
"deleteDatabase": {
"enabled": false,
"policy": ""
},
"autoReload": {
"enabled": false,
"policy": ""
},
"update": {
"enabled": false,
"policy": ""
},
"databaseModel": {
"enabled": false,
"policy": ""
},
"createLanguage": {
"enabled": false,
"policy": ""
},
"get": {
"enabled": false,
"policy": ""
},
"createDatabase": {
"enabled": false,
"policy": ""
},
"databases": {
"enabled": false,
"policy": ""
},
"languages": {
"enabled": false,
"policy": ""
},
"database": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
},
"menu": {
"enabled": false,
"policy": ""
}
}
}
},
"users-permissions": {
"controllers": {
"auth": {
"callback": {
"enabled": true,
"policy": ""
},
"register": {
"findOne": {
"enabled": true,
"policy": ""
},
"forgotPassword": {
"enabled": false,
"policy": ""
},
"changePassword": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
},
"user": {
"find": {
"enabled": false,
"policy": ""
},
"findOne": {
"enabled": false,
"policy": ""
},
"create": {
"enabled": false,
"enabled": true,
"policy": ""
},
"update": {
"enabled": false,
"enabled": true,
"policy": ""
},
"destroy": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
}
},
"userspermissions": {
"searchUsers": {
"enabled": false,
"policy": ""
},
"getRoutes": {
"enabled": false,
"policy": ""
},
"deleteRole": {
"enabled": false,
"policy": ""
},
"getPolicies": {
"enabled": false,
"policy": ""
},
"getRoles": {
"enabled": false,
"policy": ""
},
"getRole": {
"enabled": false,
"policy": ""
},
"getPermissions": {
"enabled": false,
"policy": ""
},
"init": {
"enabled": true,
"policy": ""
},
"index": {
"enabled": false,
"policy": ""
},
"createRole": {
"enabled": false,
"policy": ""
},
"deleteProvider": {
"enabled": false,
"policy": ""
},
"identity": {
"enabled": false,
"policy": ""
},
"updateRole": {
"enabled": false,
"enabled": true,
"policy": ""
}
}
}
},
"application": {
"controllers": {}
}
}
}

View File

@ -8,36 +8,38 @@
"description": "users-permissions.plugin.description"
},
"scripts": {
"analyze:clean": "rimraf stats.json",
"analyze:clean": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/rimraf stats.json",
"preanalyze": "npm run analyze:clean",
"analyze": "node node_modules/strapi-helper-plugin/lib/internals/scripts/analyze.js",
"analyze": "node ./node_modules/strapi-helper-plugin/lib/internals/scripts/analyze.js",
"prebuild": "npm run build:clean && npm run test",
"build": "cross-env NODE_ENV=production webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress",
"build:clean": "rimraf admin/build",
"start": "cross-env NODE_ENV=development node node_modules/strapi-helper-plugin/lib/server",
"generate": "plop --plopfile node_modules/strapi-helper-plugin/lib/internals/generators/index.js",
"lint": "eslint --ignore-path .gitignore --config node_modules/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json admin",
"build:dev": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=development node ./node_modules/strapi-helper-plugin/node_modules/.bin/webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress",
"build": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=production node node_modules/strapi-helper-plugin/node_modules/.bin/webpack --config node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress",
"build:clean": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/rimraf admin/build",
"start": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=development node ./node_modules/strapi-helper-plugin/lib/server",
"generate": "node ./node_modules/plop/plop.js --plopfile node_modules/strapi-helper-plugin/lib/internals/generators/index.js",
"lint": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/eslint --ignore-path .gitignore --config ./node_modules/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json admin",
"pretest": "npm run lint",
"prettier": "prettier --single-quote --trailing-comma es5 --write \"{admin,__{tests,mocks}__}/**/*.js\"",
"prettier": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/prettier --single-quote --trailing-comma es5 --write \"{admin,__{tests,mocks}__}/**/*.js\"",
"test": "echo Tests are not implemented.",
"prepublish": "npm run build",
"postinstall": "node node_modules/strapi-helper-plugin/lib/internals/scripts/postinstall.js"
"prepublishOnly": "npm run build"
},
"dependencies": {
"bcryptjs": "^2.4.3",
"jsonwebtoken": "^8.1.0",
"jsonwebtoken": "^8.1.0"
},
"devDependencies": {
"strapi-helper-plugin": "3.0.0-alpha.6.7"
},
"author": {
"name": "A Strapi developer",
"email": "",
"url": ""
"name": "Strapi team",
"email": "hi@strapi.io",
"url": "http://strapi.io"
},
"maintainers": [
{
"name": "A Strapi developer",
"email": "",
"url": ""
"name": "Strapi team",
"email": "hi@strapi.io",
"url": "http://strapi.io"
}
],
"engines": {
@ -61,4 +63,4 @@
"rimraf": "^2.6.2",
"webpack": "^3.9.1"
}
}
}

View File

@ -48,7 +48,6 @@ module.exports = {
},
getActions: () => {
console.log(strapi);
const generateActions = (data) => (
Object.keys(data).reduce((acc, key) => {
acc[key] = { enabled: false, policy: '' };