@cocreate/cli 1.27.3 → 1.28.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/CHANGELOG.md +14 -0
- package/CoCreate.config.js +3 -2
- package/package.json +1 -1
- package/repositories.js +0 -4
- package/src/commands/fs/config.js +3 -2
- package/src/commands/other/symlinkPwa.js +39 -0
- package/src/commands/other/updateModules.js +51 -0
- package/src/commands/other/symlinkAssets.js +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.28.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.27.4...v1.28.0) (2023-05-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* symlinkPwa ([54d0136](https://github.com/CoCreate-app/CoCreate-cli/commit/54d01367e1a3f310a1711086f820e09b462bef4c))
|
|
7
|
+
|
|
8
|
+
## [1.27.4](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.27.3...v1.27.4) (2023-05-01)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* update config.js and removed fontawesome ([205cc5f](https://github.com/CoCreate-app/CoCreate-cli/commit/205cc5f0fb9f1c5be903e7ec27baf55776107417))
|
|
14
|
+
|
|
1
15
|
## [1.27.3](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.27.2...v1.27.3) (2023-05-01)
|
|
2
16
|
|
|
3
17
|
|
package/CoCreate.config.js
CHANGED
|
@@ -17,9 +17,10 @@ module.exports = {
|
|
|
17
17
|
"general.cocreate.app"
|
|
18
18
|
],
|
|
19
19
|
"directory": "/docs/cli",
|
|
20
|
-
"
|
|
20
|
+
"parentDirectory": "{{parentDirectory}}",
|
|
21
|
+
"content-type": "{{content-type}}",
|
|
21
22
|
"public": "true",
|
|
22
|
-
"website_id": "
|
|
23
|
+
"website_id": "644d4bff8036fb9d1d1fd69c"
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "Polyrepo management bash CLI tool. Run all git commands and yarn commands on multiple repositories. Also includes a few custom macros for cloning, installing, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
package/repositories.js
CHANGED
|
@@ -322,10 +322,6 @@ module.exports = [
|
|
|
322
322
|
'path': '../../CoCreate-plugins/CoCreate-facebook',
|
|
323
323
|
'repo': 'github.com/CoCreate-app/CoCreate-facebook.git'
|
|
324
324
|
},
|
|
325
|
-
{
|
|
326
|
-
'path': '../../CoCreate-plugins/CoCreate-font-awesome',
|
|
327
|
-
'repo': 'github.com/CoCreate-app/CoCreate-font-awesome.git'
|
|
328
|
-
},
|
|
329
325
|
{
|
|
330
326
|
'path': '../../CoCreate-plugins/CoCreate-google-maps',
|
|
331
327
|
'repo': 'github.com/CoCreate-app/CoCreate-google-maps.git'
|
|
@@ -43,9 +43,10 @@ function update(MdPath) {
|
|
|
43
43
|
"general.cocreate.app"
|
|
44
44
|
],
|
|
45
45
|
"directory": "/docs/${name}",
|
|
46
|
-
"
|
|
46
|
+
"parentDirectory": "{{parentDirectory}}",
|
|
47
|
+
"content-type": "{{content-type}}",
|
|
47
48
|
"public": "true",
|
|
48
|
-
"website_id": "
|
|
49
|
+
"website_id": "644d4bff8036fb9d1d1fd69c"
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
|
|
4
|
+
function symlink(dir, dest, option) {
|
|
5
|
+
if (!fs.existsSync(dir)) {
|
|
6
|
+
return console.log(dir, 'does not exist')
|
|
7
|
+
} else
|
|
8
|
+
dir = path.resolve(dir)
|
|
9
|
+
|
|
10
|
+
if (fs.existsSync(dest))
|
|
11
|
+
fs.rm(dest, { recursive: true, force: true }, function (err) {
|
|
12
|
+
if (err) {
|
|
13
|
+
console.log('failed');
|
|
14
|
+
}
|
|
15
|
+
createSymlink(dir, dest, option)
|
|
16
|
+
});
|
|
17
|
+
else
|
|
18
|
+
createSymlink(dir, dest, option)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function createSymlink(dir, dest, option) {
|
|
22
|
+
dest = path.resolve(dest)
|
|
23
|
+
|
|
24
|
+
fs.symlink(dir, dest, option, (err) => {
|
|
25
|
+
console.log(dir, dest, option)
|
|
26
|
+
if (err)
|
|
27
|
+
console.log(err);
|
|
28
|
+
else {
|
|
29
|
+
console.log("symlink added");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
symlink('./src/assets', '../assets', 'dir')
|
|
37
|
+
symlink('./src/manifest.webmanifest', '../manifest.webmanifest', 'file')
|
|
38
|
+
symlink('./src/sw.js', '../sw.js', 'file')
|
|
39
|
+
symlink('./src/offline.html', '../offline.html', 'file')
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
async function updateModules() {
|
|
2
|
+
|
|
3
|
+
let data = await CoCreate.crud.readDocument({
|
|
4
|
+
collection: ['modules'],
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
if (data && data.document && data.document.length) {
|
|
8
|
+
for (let document of data.document) {
|
|
9
|
+
let isUpdateable = false
|
|
10
|
+
if (document.icon) {
|
|
11
|
+
console.log(document.icon)
|
|
12
|
+
let name = document.icon
|
|
13
|
+
if (name.includes('fa fa-'))
|
|
14
|
+
name = name.substring(16).replace('"></i>', "")
|
|
15
|
+
else
|
|
16
|
+
name = name.substring(17).replace('"></i>', "")
|
|
17
|
+
console.log(name)
|
|
18
|
+
if (name) {
|
|
19
|
+
document.icon = name
|
|
20
|
+
let updateDocument = await CoCreate.crud.updateDocument({
|
|
21
|
+
collection: ['modules'],
|
|
22
|
+
document
|
|
23
|
+
})
|
|
24
|
+
console.log(updateDocument)
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// let keys = ['navbar-menu-primary', 'navbar-menu-secondary', 'main-menu-primary', 'main-menu-secondary', 'settings-menu-primary', 'settings-menu-secondary']
|
|
29
|
+
// for (let key of keys) {
|
|
30
|
+
// if (document[key] && document[key].path) {
|
|
31
|
+
// let parts = document[key].path.split('/')
|
|
32
|
+
// let name = parts.pop()
|
|
33
|
+
// let parentDirectory = parts.pop()
|
|
34
|
+
// if (!name)
|
|
35
|
+
// continue
|
|
36
|
+
// console.log(name, parentDirectory)
|
|
37
|
+
// document[key].name = name
|
|
38
|
+
// document[key].parentDirectory = parentDirectory || ''
|
|
39
|
+
// isUpdateable = true
|
|
40
|
+
// }
|
|
41
|
+
// }
|
|
42
|
+
// if (isUpdateable) {
|
|
43
|
+
// let updateDocument = await CoCreate.crud.updateDocument({
|
|
44
|
+
// collection: ['modules'],
|
|
45
|
+
// document
|
|
46
|
+
// })
|
|
47
|
+
// console.log(updateDocument)
|
|
48
|
+
// }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
|
|
3
|
-
function createSymlink(dir, dest){
|
|
4
|
-
if (!fs.existsSync(dir)) {
|
|
5
|
-
console.log('does not exist')
|
|
6
|
-
return
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
if (fs.existsSync(dest))
|
|
10
|
-
fs.unlinkSync(dest)
|
|
11
|
-
|
|
12
|
-
fs.symlink( dir, dest, 'dir', (err) => {
|
|
13
|
-
if (err)
|
|
14
|
-
console.log(err);
|
|
15
|
-
else {
|
|
16
|
-
console.log("symlink added");
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// createSymlink('./assets', '../../assets')
|
|
24
|
-
createSymlink('./manifest.webmanifest', '../../manifest.webmanifest')
|
|
25
|
-
createSymlink('./sw.js', '../../sw.js')
|
|
26
|
-
createSymlink('./offline.html', '../../offline.html')
|