create-directus-docker 1.3.0 → 1.3.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/package.json +3 -1
- package/src/cli.js +24 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-directus-docker",
|
|
3
3
|
"description": "An installer for Dockerized Directus + MySQL + Adminer + GraphiQL with a helper Node app",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Dave Kobrenski",
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"chalk": "^5.2.0",
|
|
35
35
|
"create-create-app": "7.1.0",
|
|
36
|
+
"execa": "^6.1.0",
|
|
37
|
+
"log-update": "^5.0.1",
|
|
36
38
|
"upath": "^2.0.1"
|
|
37
39
|
},
|
|
38
40
|
"license": "MIT",
|
package/src/cli.js
CHANGED
|
@@ -5,12 +5,36 @@ import chalk from 'chalk';
|
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import {fileURLToPath} from 'url';
|
|
7
7
|
import { create } from 'create-create-app';
|
|
8
|
+
import { spawn } from 'node:child_process';
|
|
9
|
+
import logUpdate from 'log-update';
|
|
10
|
+
import {execa} from 'execa';
|
|
8
11
|
|
|
9
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
13
|
const __dirname = path.dirname(__filename);
|
|
11
14
|
|
|
12
15
|
create('create-directus-docker', {
|
|
13
16
|
templateRoot: upath.resolve(__dirname, '../templates'),
|
|
17
|
+
promptForDescription: false,
|
|
18
|
+
promptForAuthor: false,
|
|
19
|
+
promptForEmail: false,
|
|
20
|
+
promptForLicense: false,
|
|
21
|
+
|
|
22
|
+
after: ({packageDir}) => {
|
|
23
|
+
const cd = spawn('cd', [packageDir]);
|
|
24
|
+
cd.on('close', code => {
|
|
25
|
+
const install = spawn('npm', ['install']);
|
|
26
|
+
|
|
27
|
+
install.stdout.on('data', (data) => {
|
|
28
|
+
logUpdate(`${data}`);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
install.on('close', (code) => {
|
|
32
|
+
logUpdate.done();
|
|
33
|
+
execa('npm', ['start']).stdout.pipe(process.stdout);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
|
|
14
38
|
caveat: ({ packageDir }) => {
|
|
15
39
|
return `
|
|
16
40
|
${chalk.bold.yellowBright("Directus with MySQL, Adminer, and GraphiQL:")}
|