@strapi/strapi 4.0.7 → 4.1.1-alpha.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/bin/strapi.js +11 -11
- package/lib/middlewares/body.js +15 -1
- package/lib/services/entity-service/params.js +1 -1
- package/package.json +12 -12
package/bin/strapi.js
CHANGED
|
@@ -17,7 +17,7 @@ const checkCwdIsStrapiApp = name => {
|
|
|
17
17
|
console.log(
|
|
18
18
|
`You need to run ${yellow(
|
|
19
19
|
`strapi ${name}`
|
|
20
|
-
)} in a Strapi project. Make sure you are in the right directory
|
|
20
|
+
)} in a Strapi project. Make sure you are in the right directory.`
|
|
21
21
|
);
|
|
22
22
|
process.exit(1);
|
|
23
23
|
};
|
|
@@ -40,7 +40,7 @@ const getLocalScript = name => (...args) => {
|
|
|
40
40
|
console.log(
|
|
41
41
|
`Error loading the local ${yellow(
|
|
42
42
|
name
|
|
43
|
-
)} command. Strapi might not be installed in your "node_modules". You may need to run "
|
|
43
|
+
)} command. Strapi might not be installed in your "node_modules". You may need to run "yarn install".`
|
|
44
44
|
);
|
|
45
45
|
process.exit(1);
|
|
46
46
|
}
|
|
@@ -67,7 +67,7 @@ program.addHelpCommand('help [command]', 'Display help for command');
|
|
|
67
67
|
program.version(packageJSON.version, '-v, --version', 'Output the version number');
|
|
68
68
|
program
|
|
69
69
|
.command('version')
|
|
70
|
-
.description('Output
|
|
70
|
+
.description('Output the version of Strapi')
|
|
71
71
|
.action(() => {
|
|
72
72
|
process.stdout.write(packageJSON.version + '\n');
|
|
73
73
|
process.exit(0);
|
|
@@ -84,8 +84,8 @@ program
|
|
|
84
84
|
.command('new <directory>')
|
|
85
85
|
.option('--no-run', 'Do not start the application after it is created')
|
|
86
86
|
.option('--use-npm', 'Force usage of npm instead of yarn to create the project')
|
|
87
|
-
.option('--debug', 'Display database connection
|
|
88
|
-
.option('--quickstart', '
|
|
87
|
+
.option('--debug', 'Display database connection errors')
|
|
88
|
+
.option('--quickstart', 'Create quickstart app')
|
|
89
89
|
.option('--dbclient <dbclient>', 'Database client')
|
|
90
90
|
.option('--dbhost <dbhost>', 'Database host')
|
|
91
91
|
.option('--dbport <dbport>', 'Database port')
|
|
@@ -94,7 +94,7 @@ program
|
|
|
94
94
|
.option('--dbpassword <dbpassword>', 'Database password')
|
|
95
95
|
.option('--dbssl <dbssl>', 'Database SSL')
|
|
96
96
|
.option('--dbfile <dbfile>', 'Database file path for sqlite')
|
|
97
|
-
.option('--dbforce', '
|
|
97
|
+
.option('--dbforce', 'Allow overwriting existing database content')
|
|
98
98
|
.description('Create a new application')
|
|
99
99
|
.action(require('../lib/commands/new'));
|
|
100
100
|
|
|
@@ -110,7 +110,7 @@ program
|
|
|
110
110
|
.alias('dev')
|
|
111
111
|
.option('--no-build', 'Disable build')
|
|
112
112
|
.option('--watch-admin', 'Enable watch', false)
|
|
113
|
-
.option('--polling', '
|
|
113
|
+
.option('--polling', 'Watch for file changes in network directories', false)
|
|
114
114
|
.option('--browser <name>', 'Open the browser', true)
|
|
115
115
|
.description('Start your Strapi application in development mode')
|
|
116
116
|
.action(getLocalScript('develop'));
|
|
@@ -118,7 +118,7 @@ program
|
|
|
118
118
|
// $ strapi generate
|
|
119
119
|
program
|
|
120
120
|
.command('generate')
|
|
121
|
-
.description('Launch interactive API generator')
|
|
121
|
+
.description('Launch the interactive API generator')
|
|
122
122
|
.action(() => {
|
|
123
123
|
checkCwdIsStrapiApp('generate');
|
|
124
124
|
process.argv.splice(2, 1);
|
|
@@ -133,8 +133,8 @@ program
|
|
|
133
133
|
|
|
134
134
|
program
|
|
135
135
|
.command('build')
|
|
136
|
-
.option('--no-optimization', 'Build the
|
|
137
|
-
.description('
|
|
136
|
+
.option('--no-optimization', 'Build the admin app without optimizing assets')
|
|
137
|
+
.description('Build the strapi admin app')
|
|
138
138
|
.action(getLocalScript('build'));
|
|
139
139
|
|
|
140
140
|
// `$ strapi install`
|
|
@@ -154,7 +154,7 @@ program
|
|
|
154
154
|
program
|
|
155
155
|
.command('watch-admin')
|
|
156
156
|
.option('--browser <name>', 'Open the browser', true)
|
|
157
|
-
.description('
|
|
157
|
+
.description('Start the admin development server')
|
|
158
158
|
.action(getLocalScript('watchAdmin'));
|
|
159
159
|
|
|
160
160
|
program
|
package/lib/middlewares/body.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const fse = require('fs-extra');
|
|
4
|
+
const { defaultsDeep, get } = require('lodash/fp');
|
|
4
5
|
const body = require('koa-body');
|
|
5
6
|
|
|
6
7
|
const defaults = {
|
|
@@ -29,5 +30,18 @@ module.exports = config => {
|
|
|
29
30
|
|
|
30
31
|
throw e;
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
// clean any file that was uploaded
|
|
35
|
+
const files = get('request.files.files', ctx);
|
|
36
|
+
if (files) {
|
|
37
|
+
if (Array.isArray(files)) {
|
|
38
|
+
// not awaiting to not slow the request
|
|
39
|
+
Promise.all(files.map(file => fse.remove(file.path)));
|
|
40
|
+
} else if (files && files.path) {
|
|
41
|
+
// not awaiting to not slow the request
|
|
42
|
+
fse.remove(files.path);
|
|
43
|
+
}
|
|
44
|
+
delete ctx.request.files;
|
|
45
|
+
}
|
|
32
46
|
};
|
|
33
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/strapi",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.1-alpha.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",
|
|
@@ -80,16 +80,16 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@koa/cors": "3.1.0",
|
|
82
82
|
"@koa/router": "10.1.1",
|
|
83
|
-
"@strapi/admin": "4.0
|
|
84
|
-
"@strapi/database": "4.0
|
|
85
|
-
"@strapi/generate-new": "4.0
|
|
86
|
-
"@strapi/generators": "4.0
|
|
87
|
-
"@strapi/logger": "4.0
|
|
88
|
-
"@strapi/plugin-content-manager": "4.0
|
|
89
|
-
"@strapi/plugin-content-type-builder": "4.0
|
|
90
|
-
"@strapi/plugin-email": "4.0
|
|
91
|
-
"@strapi/plugin-upload": "4.0
|
|
92
|
-
"@strapi/utils": "4.0
|
|
83
|
+
"@strapi/admin": "4.1.1-alpha.0",
|
|
84
|
+
"@strapi/database": "4.1.1-alpha.0",
|
|
85
|
+
"@strapi/generate-new": "4.1.1-alpha.0",
|
|
86
|
+
"@strapi/generators": "4.1.1-alpha.0",
|
|
87
|
+
"@strapi/logger": "4.1.1-alpha.0",
|
|
88
|
+
"@strapi/plugin-content-manager": "4.1.1-alpha.0",
|
|
89
|
+
"@strapi/plugin-content-type-builder": "4.1.1-alpha.0",
|
|
90
|
+
"@strapi/plugin-email": "4.1.1-alpha.0",
|
|
91
|
+
"@strapi/plugin-upload": "4.1.1-alpha.0",
|
|
92
|
+
"@strapi/utils": "4.1.1-alpha.0",
|
|
93
93
|
"bcryptjs": "2.4.3",
|
|
94
94
|
"boxen": "5.1.2",
|
|
95
95
|
"chalk": "4.1.2",
|
|
@@ -136,5 +136,5 @@
|
|
|
136
136
|
"node": ">=12.22.0 <=16.x.x",
|
|
137
137
|
"npm": ">=6.0.0"
|
|
138
138
|
},
|
|
139
|
-
"gitHead": "
|
|
139
|
+
"gitHead": "bedb04a0cc23719e4eac43e6005fe0fa3d48a9a6"
|
|
140
140
|
}
|