@startupjs/cli 0.56.0-alpha.4 → 0.56.0-alpha.47
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/README.md +20 -12
- package/commands/build.js +13 -0
- package/commands/index.js +7 -0
- package/commands/pm/init-pm.js +30 -0
- package/commands/pm/pr.js +12 -0
- package/commands/pm/task.js +12 -0
- package/commands/pm/utils.js +8 -0
- package/commands/postinstall.js +17 -0
- package/commands/start-production.js +21 -0
- package/index.js +23 -679
- package/package.json +9 -17
- package/corepack.sh +0 -52
- package/link/index.js +0 -9
- package/link/log.js +0 -33
- package/link/path.js +0 -61
- package/link/postLinkAndroid.js +0 -15
- package/link/postLinkIOS.js +0 -8
- package/link/pushNotificationsLinker/AndroidLinker.js +0 -144
- package/link/pushNotificationsLinker/IosLinker.js +0 -137
- package/link/pushNotificationsLinker/constants.js +0 -114
- package/link/pushNotificationsLinker/index.js +0 -37
- package/link/stylesLinker.js +0 -47
package/link/stylesLinker.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const path = require('./path')
|
|
3
|
-
const { errorn, warnn, logn, infon, debugn } = require('./log')
|
|
4
|
-
|
|
5
|
-
class StylesLinker {
|
|
6
|
-
constructor () {
|
|
7
|
-
this.paths = path.styles
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
link () {
|
|
11
|
-
if (!this.paths) {
|
|
12
|
-
warnn(' Style linking skipped due to missing style files')
|
|
13
|
-
return
|
|
14
|
-
} else {
|
|
15
|
-
logn(' Linking styles')
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
for (const path of this.paths) {
|
|
20
|
-
let content = fs.readFileSync(path, 'utf8')
|
|
21
|
-
if (this._hasColorControlActivated(content)) {
|
|
22
|
-
warnn(` ${path} already linked`)
|
|
23
|
-
continue
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// FIXME: we need to get color from UI ans paste them to link item
|
|
27
|
-
debugn(` Linking ${path}`)
|
|
28
|
-
content = content
|
|
29
|
-
.replace(
|
|
30
|
-
'</style>',
|
|
31
|
-
' <item name="colorControlActivated">#2962FF</item>\n' +
|
|
32
|
-
' </style>'
|
|
33
|
-
)
|
|
34
|
-
fs.writeFileSync(path, content)
|
|
35
|
-
}
|
|
36
|
-
infon(' Styles linked successfully!')
|
|
37
|
-
} catch (e) {
|
|
38
|
-
errorn('Styles was not linked. ' + e.message)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
_hasColorControlActivated (content) {
|
|
43
|
-
return /colorControlActivated/.test(content)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
module.exports = StylesLinker
|