@newlogic-digital/cli 1.1.0 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newlogic-digital/cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "main": "index.mjs",
5
5
  "bin": {
6
6
  "newlogic-cli": "index.mjs",
@@ -36,7 +36,53 @@ async function install(name, branch) {
36
36
  ])
37
37
 
38
38
  if (install === 'yes') {
39
- execSync(`cd ${name || '.'} && make install ${branch || ''}`)
39
+ execSync(`cd ${name || '.'} && composer install`)
40
+
41
+ if (fs.existsSync(resolve(process.cwd(), 'Makefile'))) {
42
+ execSync(`cd ${name || '.'} && make install ${branch || ''}`)
43
+ } else {
44
+ execSync(`cd ${name || '.'} && composer install-${branch || ''}`)
45
+ }
46
+
47
+ if (fs.existsSync(resolve(process.cwd(), 'package.json'))) {
48
+ execSync(`cd ${name || '.'} && npm i && npx vite build`)
49
+ }
50
+ }
51
+ }
52
+
53
+ async function dev(name) {
54
+ const { install } = await prompts([
55
+ {
56
+ type: 'select',
57
+ name: 'install',
58
+ message: 'Start dev server?',
59
+ choices: [
60
+ { title: 'yes', value: 'yes' },
61
+ { title: 'no', value: 'no' }
62
+ ]
63
+ }
64
+ ])
65
+
66
+ if (install === 'yes') {
67
+ execSync(`cd ${name || '.'} && composer dev-headless`)
68
+ }
69
+ }
70
+
71
+ async function migrations(name) {
72
+ const { install } = await prompts([
73
+ {
74
+ type: 'select',
75
+ name: 'install',
76
+ message: 'Init phinx migrations?',
77
+ choices: [
78
+ { title: 'yes', value: 'yes' },
79
+ { title: 'no', value: 'no' }
80
+ ]
81
+ }
82
+ ])
83
+
84
+ if (install === 'yes') {
85
+ execSync(`cd ${name || '.'} && composer phinx-init`)
40
86
  }
41
87
  }
42
88
 
@@ -63,6 +109,8 @@ export default async function cms(name, { variant, branch }) {
63
109
  clone(name, { variant, branch })
64
110
  await install(name, branch)
65
111
  await prepare()
112
+ await dev()
113
+ await migrations()
66
114
  return
67
115
  }
68
116
 
@@ -79,6 +127,7 @@ export default async function cms(name, { variant, branch }) {
79
127
  await move('log')
80
128
  await move('public/index.php')
81
129
  await move('src/views')
130
+ await move('storage')
82
131
  await move('temp')
83
132
  await move('tests')
84
133
  await move('.gitignore', { overwrite: true })
@@ -86,7 +135,7 @@ export default async function cms(name, { variant, branch }) {
86
135
  await move('composer.json')
87
136
  await move('composer.lock')
88
137
  await move('docker-compose.yml')
89
- await move('Makefile')
138
+ await move('Makefile') // deprecated
90
139
  await move('phpstan.neon')
91
140
  await move('phpunit.xml')
92
141
  await move('pint.json')