@strapi/strapi 4.2.0-beta.1 → 4.2.0-beta.2
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 +1 -0
- package/lib/commands/admin-create.js +8 -1
- package/lib/commands/admin-reset.js +8 -1
- package/lib/commands/configurationDump.js +8 -1
- package/lib/commands/configurationRestore.js +9 -1
- package/lib/commands/console.js +10 -2
- package/lib/commands/routes/list.js +8 -1
- package/lib/commands/start.js +8 -2
- package/package.json +13 -13
package/bin/strapi.js
CHANGED
|
@@ -95,6 +95,7 @@ program
|
|
|
95
95
|
.option('--dbssl <dbssl>', 'Database SSL')
|
|
96
96
|
.option('--dbfile <dbfile>', 'Database file path for sqlite')
|
|
97
97
|
.option('--dbforce', 'Allow overwriting existing database content')
|
|
98
|
+
.option('-ts, --typescript', 'Create a typescript project')
|
|
98
99
|
.description('Create a new application')
|
|
99
100
|
.action(require('../lib/commands/new'));
|
|
100
101
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const path = require('path');
|
|
3
4
|
const { yup } = require('@strapi/utils');
|
|
4
5
|
const _ = require('lodash');
|
|
5
6
|
const inquirer = require('inquirer');
|
|
7
|
+
const tsUtils = require('@strapi/typescript-utils');
|
|
6
8
|
const strapi = require('../index');
|
|
7
9
|
|
|
8
10
|
const emailValidator = yup
|
|
@@ -90,7 +92,12 @@ module.exports = async function(cmdOptions = {}) {
|
|
|
90
92
|
};
|
|
91
93
|
|
|
92
94
|
async function createAdmin({ email, password, firstname, lastname }) {
|
|
93
|
-
const
|
|
95
|
+
const appDir = process.cwd();
|
|
96
|
+
|
|
97
|
+
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
|
|
98
|
+
const distDir = isTSProject ? path.join(appDir, 'dist') : appDir;
|
|
99
|
+
|
|
100
|
+
const app = await strapi({ appDir, distDir }).load();
|
|
94
101
|
|
|
95
102
|
const user = await app.admin.services.user.exists({ email });
|
|
96
103
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const path = require('path');
|
|
3
4
|
const _ = require('lodash');
|
|
4
5
|
const inquirer = require('inquirer');
|
|
6
|
+
const tsUtils = require('@strapi/typescript-utils');
|
|
5
7
|
const strapi = require('../index');
|
|
6
8
|
|
|
7
9
|
const promptQuestions = [
|
|
@@ -42,7 +44,12 @@ module.exports = async function(cmdOptions = {}) {
|
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
async function changePassword({ email, password }) {
|
|
45
|
-
const
|
|
47
|
+
const appDir = process.cwd();
|
|
48
|
+
|
|
49
|
+
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
|
|
50
|
+
const distDir = isTSProject ? path.join(appDir, 'dist') : appDir;
|
|
51
|
+
|
|
52
|
+
const app = await strapi({ appDir, distDir }).load();
|
|
46
53
|
|
|
47
54
|
await app.admin.services.user.resetPasswordByEmail(email, password);
|
|
48
55
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const tsUtils = require('@strapi/typescript-utils');
|
|
4
6
|
const strapi = require('../index');
|
|
5
7
|
|
|
6
8
|
const CHUNK_SIZE = 100;
|
|
@@ -12,7 +14,12 @@ const CHUNK_SIZE = 100;
|
|
|
12
14
|
module.exports = async function({ file: filePath, pretty }) {
|
|
13
15
|
const output = filePath ? fs.createWriteStream(filePath) : process.stdout;
|
|
14
16
|
|
|
15
|
-
const
|
|
17
|
+
const appDir = process.cwd();
|
|
18
|
+
|
|
19
|
+
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
|
|
20
|
+
const distDir = isTSProject ? path.join(appDir, 'dist') : appDir;
|
|
21
|
+
|
|
22
|
+
const app = await strapi({ appDir, distDir }).load();
|
|
16
23
|
|
|
17
24
|
const count = await app.query('strapi::core-store').count();
|
|
18
25
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
4
5
|
const _ = require('lodash');
|
|
6
|
+
const tsUtils = require('@strapi/typescript-utils');
|
|
7
|
+
|
|
5
8
|
const strapi = require('../index');
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -12,7 +15,12 @@ const strapi = require('../index');
|
|
|
12
15
|
module.exports = async function({ file: filePath, strategy = 'replace' }) {
|
|
13
16
|
const input = filePath ? fs.readFileSync(filePath) : await readStdin(process.stdin);
|
|
14
17
|
|
|
15
|
-
const
|
|
18
|
+
const appDir = process.cwd();
|
|
19
|
+
|
|
20
|
+
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
|
|
21
|
+
const distDir = isTSProject ? path.join(appDir, 'dist') : appDir;
|
|
22
|
+
|
|
23
|
+
const app = await strapi({ appDir, distDir }).load();
|
|
16
24
|
|
|
17
25
|
let dataToImport;
|
|
18
26
|
try {
|
package/lib/commands/console.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const REPL = require('repl');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const tsUtils = require('@strapi/typescript-utils');
|
|
6
|
+
|
|
4
7
|
const strapi = require('../index');
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* `$ strapi console`
|
|
8
11
|
*/
|
|
9
|
-
module.exports = () => {
|
|
12
|
+
module.exports = async () => {
|
|
10
13
|
// Now load up the Strapi framework for real.
|
|
11
|
-
const
|
|
14
|
+
const appDir = process.cwd();
|
|
15
|
+
|
|
16
|
+
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
|
|
17
|
+
const distDir = isTSProject ? path.join(appDir, 'dist') : appDir;
|
|
18
|
+
|
|
19
|
+
const app = await strapi({ appDir, distDir }).load();
|
|
12
20
|
|
|
13
21
|
app.start().then(() => {
|
|
14
22
|
const repl = REPL.start(app.config.info.name + ' > ' || 'strapi > '); // eslint-disable-line prefer-template
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const path = require('path');
|
|
3
4
|
const CLITable = require('cli-table3');
|
|
4
5
|
const chalk = require('chalk');
|
|
5
6
|
const { toUpper } = require('lodash/fp');
|
|
7
|
+
const tsUtils = require('@strapi/typescript-utils');
|
|
6
8
|
|
|
7
9
|
const strapi = require('../../index');
|
|
8
10
|
|
|
9
11
|
module.exports = async function() {
|
|
10
|
-
const
|
|
12
|
+
const appDir = process.cwd();
|
|
13
|
+
|
|
14
|
+
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
|
|
15
|
+
const distDir = isTSProject ? path.join(appDir, 'dist') : appDir;
|
|
16
|
+
|
|
17
|
+
const app = await strapi({ appDir, distDir }).load();
|
|
11
18
|
|
|
12
19
|
const list = app.server.listRoutes();
|
|
13
20
|
|
package/lib/commands/start.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
2
|
+
const tsUtils = require('@strapi/typescript-utils')
|
|
3
3
|
const strapi = require('../index');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* `$ strapi start`
|
|
7
7
|
*/
|
|
8
|
-
module.exports =
|
|
8
|
+
module.exports = async specifiedDir => {
|
|
9
|
+
const appDir = process.cwd();
|
|
10
|
+
const isTSProject = await tsUtils.isUsingTypeScript(appDir)
|
|
11
|
+
const distDir = isTSProject && !specifiedDir ? 'dist' : specifiedDir;
|
|
12
|
+
|
|
13
|
+
strapi({ distDir }).start()
|
|
14
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/strapi",
|
|
3
|
-
"version": "4.2.0-beta.
|
|
3
|
+
"version": "4.2.0-beta.2",
|
|
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,17 +80,17 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@koa/cors": "3.1.0",
|
|
82
82
|
"@koa/router": "10.1.1",
|
|
83
|
-
"@strapi/admin": "4.2.0-beta.
|
|
84
|
-
"@strapi/database": "4.2.0-beta.
|
|
85
|
-
"@strapi/generate-new": "4.2.0-beta.
|
|
86
|
-
"@strapi/generators": "4.2.0-beta.
|
|
87
|
-
"@strapi/logger": "4.2.0-beta.
|
|
88
|
-
"@strapi/plugin-content-manager": "4.2.0-beta.
|
|
89
|
-
"@strapi/plugin-content-type-builder": "4.2.0-beta.
|
|
90
|
-
"@strapi/plugin-email": "4.2.0-beta.
|
|
91
|
-
"@strapi/plugin-upload": "4.2.0-beta.
|
|
92
|
-
"@strapi/typescript-utils": "4.2.0-beta.
|
|
93
|
-
"@strapi/utils": "4.2.0-beta.
|
|
83
|
+
"@strapi/admin": "4.2.0-beta.2",
|
|
84
|
+
"@strapi/database": "4.2.0-beta.2",
|
|
85
|
+
"@strapi/generate-new": "4.2.0-beta.2",
|
|
86
|
+
"@strapi/generators": "4.2.0-beta.2",
|
|
87
|
+
"@strapi/logger": "4.2.0-beta.2",
|
|
88
|
+
"@strapi/plugin-content-manager": "4.2.0-beta.2",
|
|
89
|
+
"@strapi/plugin-content-type-builder": "4.2.0-beta.2",
|
|
90
|
+
"@strapi/plugin-email": "4.2.0-beta.2",
|
|
91
|
+
"@strapi/plugin-upload": "4.2.0-beta.2",
|
|
92
|
+
"@strapi/typescript-utils": "4.2.0-beta.2",
|
|
93
|
+
"@strapi/utils": "4.2.0-beta.2",
|
|
94
94
|
"bcryptjs": "2.4.3",
|
|
95
95
|
"boxen": "5.1.2",
|
|
96
96
|
"chalk": "4.1.2",
|
|
@@ -138,5 +138,5 @@
|
|
|
138
138
|
"node": ">=12.22.0 <=16.x.x",
|
|
139
139
|
"npm": ">=6.0.0"
|
|
140
140
|
},
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "bff73257e7695d6f361c91dda8cc810a2bb70b6e"
|
|
142
142
|
}
|