@newlogic-digital/cli 0.0.14 → 0.0.16
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
|
@@ -110,7 +110,7 @@ export default function prepare(options) {
|
|
|
110
110
|
const type = typeof controls[control]
|
|
111
111
|
const value = typeof controls[control] === 'object' ? JSON.stringify(controls[control]) : controls[control]
|
|
112
112
|
|
|
113
|
-
let phpType = type
|
|
113
|
+
let phpType = type
|
|
114
114
|
|
|
115
115
|
if (type === 'object' && Array.isArray(controls[control])) {
|
|
116
116
|
phpType = 'array'
|
|
@@ -126,7 +126,7 @@ export default function prepare(options) {
|
|
|
126
126
|
* @title ${getTitle(control)}
|
|
127
127
|
* @value ${value}
|
|
128
128
|
*/
|
|
129
|
-
public ${phpType} $${control}${type === 'string' ? " = '" + value + "'" :
|
|
129
|
+
public ${phpType} $${control}${type === 'string' ? " = '" + value + "'" : ''};
|
|
130
130
|
`)
|
|
131
131
|
|
|
132
132
|
if (type === 'object') {
|
|
@@ -138,15 +138,15 @@ export default function prepare(options) {
|
|
|
138
138
|
})
|
|
139
139
|
|
|
140
140
|
if (annotations.length > 0) {
|
|
141
|
-
annotations = annotations.map(item => item).join(
|
|
141
|
+
annotations = annotations.map(item => item).join('')
|
|
142
142
|
} else {
|
|
143
|
-
annotations =
|
|
143
|
+
annotations = ''
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
if (objects.length > 0) {
|
|
147
|
-
objects = objects.map(item => item).join(
|
|
147
|
+
objects = objects.map(item => item).join('')
|
|
148
148
|
} else {
|
|
149
|
-
objects =
|
|
149
|
+
objects = ''
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
fs.writeFileSync(join(options.path.app.sections, `${name}.php`),
|
|
@@ -228,17 +228,16 @@ export default function prepare(options) {
|
|
|
228
228
|
|
|
229
229
|
sections.forEach((section) => {
|
|
230
230
|
if (section.src) {
|
|
231
|
-
if (typeof sectionsUnsorted[section.src] ===
|
|
231
|
+
if (typeof sectionsUnsorted[section.src] === 'undefined') {
|
|
232
232
|
sectionsUnsorted[section.src] = []
|
|
233
|
-
sectionsUnsorted[section.src].push(section)
|
|
233
|
+
sectionsUnsorted[section.src].push(section)
|
|
234
234
|
} else {
|
|
235
|
-
sectionsUnsorted[section.src].push(section)
|
|
235
|
+
sectionsUnsorted[section.src].push(section)
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
})
|
|
239
239
|
})
|
|
240
240
|
|
|
241
|
-
|
|
242
241
|
Object.keys(sectionsUnsorted).forEach(key => {
|
|
243
242
|
const sortedSection = {}
|
|
244
243
|
|
|
@@ -9,7 +9,7 @@ import prompts from 'prompts'
|
|
|
9
9
|
const tempDir = join(os.tmpdir(), 'newlogic-cms-web')
|
|
10
10
|
|
|
11
11
|
async function move(path, options = {}) {
|
|
12
|
-
await fse.move(join(tempDir, path), resolve(process.cwd(), path), options).catch(err => console.log(`${pc.red(err)} - ${path}`
|
|
12
|
+
await fse.move(join(tempDir, path), resolve(process.cwd(), path), options).catch(err => console.log(`${pc.red(err)} - ${path}`))
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function clone(path, { variant, branch }) {
|
|
@@ -54,7 +54,7 @@ async function prepare() {
|
|
|
54
54
|
])
|
|
55
55
|
|
|
56
56
|
if (install === 'yes') {
|
|
57
|
-
execSync(
|
|
57
|
+
execSync('newlogic cms prepare')
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -87,6 +87,7 @@ export default async function cms(name, { variant, branch }) {
|
|
|
87
87
|
await move('docker-compose.yml')
|
|
88
88
|
await move('phpstan.neon')
|
|
89
89
|
await move('pint.json')
|
|
90
|
+
await fse.move(join(tempDir, '.gitlab-ci.prod.yml'), resolve(process.cwd(), '.gitlab-ci.yml'), { overwrite: true }).catch(err => console.log(`${pc.red(err)} - .gitlab-ci.yml`))
|
|
90
91
|
|
|
91
92
|
fse.removeSync(tempDir)
|
|
92
93
|
|
package/src/commands/init/ui.mjs
CHANGED
|
@@ -1,9 +1,41 @@
|
|
|
1
1
|
import { execSync } from '../../utils.mjs'
|
|
2
|
+
import fse from 'fs-extra'
|
|
2
3
|
import prompts from 'prompts'
|
|
4
|
+
import { join, resolve } from 'path'
|
|
3
5
|
|
|
4
6
|
export default async function ui(name, { branch }) {
|
|
5
7
|
execSync(`git clone -b ${branch} --single-branch --depth 1 git@git.newlogic.cz:newlogic-dev/newlogic-ui.git ${name || '.'}`)
|
|
6
8
|
|
|
9
|
+
const gitPath = name ? join(resolve(process.cwd(), name), '.git') : resolve(process.cwd(), '.git')
|
|
10
|
+
|
|
11
|
+
fse.removeSync(gitPath)
|
|
12
|
+
|
|
13
|
+
const { git } = await prompts([
|
|
14
|
+
{
|
|
15
|
+
type: 'select',
|
|
16
|
+
name: 'git',
|
|
17
|
+
message: 'Init as git repository?',
|
|
18
|
+
choices: [
|
|
19
|
+
{ title: 'yes', value: 'yes' },
|
|
20
|
+
{ title: 'no', value: 'no' }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
if (git === 'yes') {
|
|
26
|
+
execSync(`git init ${name || ''}`)
|
|
27
|
+
|
|
28
|
+
const { remote } = await prompts([
|
|
29
|
+
{
|
|
30
|
+
type: 'text',
|
|
31
|
+
name: 'remote',
|
|
32
|
+
message: 'Set remote for git repository'
|
|
33
|
+
}
|
|
34
|
+
])
|
|
35
|
+
|
|
36
|
+
execSync(`cd ${name || '.'} && git remote add origin ${remote} ${name ? '&& cd ..' : ''}`)
|
|
37
|
+
}
|
|
38
|
+
|
|
7
39
|
const { install } = await prompts([
|
|
8
40
|
{
|
|
9
41
|
type: 'select',
|