@cocreate/cli 1.28.4 → 1.29.1

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.
Files changed (43) hide show
  1. package/.github/FUNDING.yml +3 -3
  2. package/.github/workflows/automated.yml +55 -55
  3. package/CHANGELOG.md +20 -0
  4. package/CONTRIBUTING.md +96 -96
  5. package/CoCreate.config.js +26 -26
  6. package/LICENSE +21 -21
  7. package/README.md +76 -76
  8. package/docs/index.html +242 -67
  9. package/package.json +1 -1
  10. package/release.config.js +21 -21
  11. package/repositories.js +475 -475
  12. package/src/addMeta.js +74 -74
  13. package/src/coc.js +80 -80
  14. package/src/commands/bump.js +85 -85
  15. package/src/commands/clone.js +2 -2
  16. package/src/commands/fs/automated.js +141 -141
  17. package/src/commands/fs/bump.js +74 -74
  18. package/src/commands/fs/config.js +78 -78
  19. package/src/commands/fs/contribution.js +136 -136
  20. package/src/commands/fs/gitignore.js +40 -40
  21. package/src/commands/fs/icon-extract.js +31 -31
  22. package/src/commands/fs/manual.js +91 -91
  23. package/src/commands/fs/package.js +39 -39
  24. package/src/commands/fs/readme.js +138 -138
  25. package/src/commands/fs/remove.js +28 -28
  26. package/src/commands/fs/replace.js +42 -42
  27. package/src/commands/fs/webpack.js +191 -191
  28. package/src/commands/git/gitConfig.js +70 -70
  29. package/src/commands/gitConfig.js +72 -72
  30. package/src/commands/install.js +24 -24
  31. package/src/commands/link.js +107 -107
  32. package/src/commands/nginx.js +25 -25
  33. package/src/commands/other/add.js +63 -63
  34. package/src/commands/other/config.sh +4 -4
  35. package/src/commands/other/nginxConfigManager.js +137 -137
  36. package/src/commands/other/nodeCertManager.js +147 -147
  37. package/src/commands/other/symlinkPwa.js +38 -38
  38. package/src/commands/other/test.js +43 -43
  39. package/src/commands/other/updateModules.js +50 -50
  40. package/src/commands/symlink.js +113 -111
  41. package/src/execute.js +66 -66
  42. package/src/spawn.js +9 -9
  43. package/webpack.config.js +84 -84
@@ -1,39 +1,39 @@
1
-
2
- let fs = require('fs');
3
- let list = require('../repositories.js');
4
- const path = require("path")
5
-
6
- let CoCreateJsPath = path.resolve('../CoCreateJS');
7
-
8
- let pathList = list.map(o => o.path)
9
- let nameList = pathList.map(fn => path.basename(fn).toLowerCase());
10
-
11
-
12
-
13
- (async() => {
14
-
15
- for (let [index, name] of nameList.entries()) {
16
- await addPackage(pathList[index] + '/package.json', name)
17
- }
18
-
19
-
20
- })()
21
- function addPackage(path, name) {
22
-
23
-
24
- if (!fs.existsSync(path))
25
- return console.error('path doesn\'t exist:', path)
26
- let object = require(name)
27
-
28
- // console.log(object)
29
- if (!object.dependencies)
30
- return console.log(name, 'not updated')
31
- else
32
- Object.assign(object.dependencies, {
33
- "@cocreate/hosting": "^1.0.0",
34
- })
35
-
36
- // process.exit()
37
- fs.writeFileSync(name, JSON.stringify(object, null, 4))
38
- console.log(name)
39
- }
1
+
2
+ let fs = require('fs');
3
+ let list = require('../repositories.js');
4
+ const path = require("path")
5
+
6
+ let CoCreateJsPath = path.resolve('../CoCreateJS');
7
+
8
+ let pathList = list.map(o => o.path)
9
+ let nameList = pathList.map(fn => path.basename(fn).toLowerCase());
10
+
11
+
12
+
13
+ (async() => {
14
+
15
+ for (let [index, name] of nameList.entries()) {
16
+ await addPackage(pathList[index] + '/package.json', name)
17
+ }
18
+
19
+
20
+ })()
21
+ function addPackage(path, name) {
22
+
23
+
24
+ if (!fs.existsSync(path))
25
+ return console.error('path doesn\'t exist:', path)
26
+ let object = require(name)
27
+
28
+ // console.log(object)
29
+ if (!object.dependencies)
30
+ return console.log(name, 'not updated')
31
+ else
32
+ Object.assign(object.dependencies, {
33
+ "@cocreate/hosting": "^1.0.0",
34
+ })
35
+
36
+ // process.exit()
37
+ fs.writeFileSync(name, JSON.stringify(object, null, 4))
38
+ console.log(name)
39
+ }
@@ -1,138 +1,138 @@
1
- let fs = require('fs');
2
- const prettier = require("prettier");
3
- const path = require("path")
4
- const { promisify } = require('util');
5
- let list = require('../repositories.js');
6
-
7
-
8
-
9
- let metaYarnLink = list.map(meta => {
10
- let name = path.basename(meta.path).toLowerCase();
11
- try {
12
- let absolutePath = path.resolve(meta.path);
13
-
14
-
15
- let packagejson = path.resolve(absolutePath, 'package.json');
16
- if (!fs.existsSync(packagejson)) {
17
- console.error('package json not found for', name);
18
- return false;
19
- }
20
- let packageObj = require(packagejson);
21
-
22
- let packageName = name.startsWith('cocreate-') ?
23
- '@cocreate/' + name.substring(9) : packageObj.name;
24
-
25
- return { ...meta, name, packageName, absolutePath, packageObj }
26
- }
27
- catch (err) {
28
- console.error('error: ', name, err.message);
29
- return meta;
30
- }
31
-
32
- });
33
-
34
- (async() => {
35
- for (let meta of metaYarnLink) {
36
- await update(meta)
37
- }
38
- })();
39
-
40
-
41
- function update(param) {
42
- // component name
43
- if (!param) return;
44
- let { packageObj, absolutePath } = param;
45
- let { name, description } = packageObj;
46
- let shortName = name.substring(10);
47
- let fileContent = `# CoCreate-${shortName}
48
- ${description} Take it for a spin in our [playground!](https://cocreate.app/docs/${shortName})
49
-
50
- ![minified](https://img.badgesize.io/https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js?style=flat-square&label=minified&color=orange)
51
- ![gzip](https://img.badgesize.io/https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
52
- ![brotli](https://img.badgesize.io/https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js?compression=brotli&style=flat-square&label=brotli)
53
- ![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-${shortName}?style=flat-square)
54
- ![License](https://img.shields.io/github/license/CoCreate-app/CoCreate-${shortName}?style=flat-square)
55
- ![Hiring](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet)
56
-
57
- ![CoCreate-${shortName}](https://cdn.cocreate.app/docs/CoCreate-${shortName}.gif)
58
-
59
- ## [Docs & Demo](https://cocreate.app/docs/${shortName})
60
-
61
-
62
- For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/${shortName})
63
-
64
- ## CDN
65
- \`\`\`html
66
- <script src="https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js"></script>
67
- \`\`\`
68
- \`\`\`html
69
- <script src="https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.css"></script>
70
- \`\`\`
71
-
72
- ## NPM
73
- \`\`\`shell
74
- $ npm i @cocreate/${shortName}
75
- \`\`\`
76
-
77
- ## yarn
78
- \`\`\`shell
79
- $ yarn install @cocreate/${shortName}
80
- \`\`\`
81
-
82
- # Table of Contents
83
-
84
- - [Table of Contents](#table-of-contents)
85
- - [Announcements](#announcements)
86
- - [Roadmap](#roadmap)
87
- - [How to Contribute](#how-to-contribute)
88
- - [About](#about)
89
- - [License](#license)
90
-
91
- <a name="announcements"></a>
92
- # Announcements
93
-
94
- All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-${shortName}/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-${shortName}/releases). You may also subscribe to email for releases and breaking changes.
95
-
96
- <a name="roadmap"></a>
97
- # Roadmap
98
-
99
- If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-${shortName}/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-${shortName}/pulls). We would love to hear your feedback.
100
-
101
-
102
- <a name="about"></a>
103
- # About
104
-
105
- CoCreate-${shortName} is guided and supported by the CoCreate Developer Experience Team.
106
-
107
- Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries.
108
-
109
- CoCreate-${shortName} is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.
110
-
111
- <a name="contribute"></a>
112
- # How to Contribute
113
-
114
- We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-${shortName}/blob/master/CONTRIBUTING.md) guide for details.
115
-
116
- We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-${shortName}/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-${shortName}/pulls) or merely upvote or comment on existing issues or pull requests.
117
-
118
- We appreciate your continued support, thank you!
119
-
120
-
121
- <a name="license"></a>
122
- # License
123
- [The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-${shortName}/blob/master/LICENSE)
124
-
125
-
126
- `;
127
-
128
- let MdPath = path.resolve(absolutePath, 'README.md')
129
- let formated = prettier.format(fileContent, { semi: false, parser: "markdown" });
130
- if (fs.existsSync(MdPath))
131
- fs.unlinkSync(MdPath)
132
- fs.writeFileSync(MdPath, formated)
133
-
134
-
135
- }
136
-
137
-
138
- console.log('finished')
1
+ let fs = require('fs');
2
+ const prettier = require("prettier");
3
+ const path = require("path")
4
+ const { promisify } = require('util');
5
+ let list = require('../repositories.js');
6
+
7
+
8
+
9
+ let metaYarnLink = list.map(meta => {
10
+ let name = path.basename(meta.path).toLowerCase();
11
+ try {
12
+ let absolutePath = path.resolve(meta.path);
13
+
14
+
15
+ let packagejson = path.resolve(absolutePath, 'package.json');
16
+ if (!fs.existsSync(packagejson)) {
17
+ console.error('package json not found for', name);
18
+ return false;
19
+ }
20
+ let packageObj = require(packagejson);
21
+
22
+ let packageName = name.startsWith('cocreate-') ?
23
+ '@cocreate/' + name.substring(9) : packageObj.name;
24
+
25
+ return { ...meta, name, packageName, absolutePath, packageObj }
26
+ }
27
+ catch (err) {
28
+ console.error('error: ', name, err.message);
29
+ return meta;
30
+ }
31
+
32
+ });
33
+
34
+ (async() => {
35
+ for (let meta of metaYarnLink) {
36
+ await update(meta)
37
+ }
38
+ })();
39
+
40
+
41
+ function update(param) {
42
+ // component name
43
+ if (!param) return;
44
+ let { packageObj, absolutePath } = param;
45
+ let { name, description } = packageObj;
46
+ let shortName = name.substring(10);
47
+ let fileContent = `# CoCreate-${shortName}
48
+ ${description} Take it for a spin in our [playground!](https://cocreate.app/docs/${shortName})
49
+
50
+ ![minified](https://img.badgesize.io/https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js?style=flat-square&label=minified&color=orange)
51
+ ![gzip](https://img.badgesize.io/https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
52
+ ![brotli](https://img.badgesize.io/https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js?compression=brotli&style=flat-square&label=brotli)
53
+ ![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-${shortName}?style=flat-square)
54
+ ![License](https://img.shields.io/github/license/CoCreate-app/CoCreate-${shortName}?style=flat-square)
55
+ ![Hiring](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet)
56
+
57
+ ![CoCreate-${shortName}](https://cdn.cocreate.app/docs/CoCreate-${shortName}.gif)
58
+
59
+ ## [Docs & Demo](https://cocreate.app/docs/${shortName})
60
+
61
+
62
+ For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/${shortName})
63
+
64
+ ## CDN
65
+ \`\`\`html
66
+ <script src="https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.js"></script>
67
+ \`\`\`
68
+ \`\`\`html
69
+ <script src="https://cdn.cocreate.app/${shortName}/latest/CoCreate-${shortName}.min.css"></script>
70
+ \`\`\`
71
+
72
+ ## NPM
73
+ \`\`\`shell
74
+ $ npm i @cocreate/${shortName}
75
+ \`\`\`
76
+
77
+ ## yarn
78
+ \`\`\`shell
79
+ $ yarn install @cocreate/${shortName}
80
+ \`\`\`
81
+
82
+ # Table of Contents
83
+
84
+ - [Table of Contents](#table-of-contents)
85
+ - [Announcements](#announcements)
86
+ - [Roadmap](#roadmap)
87
+ - [How to Contribute](#how-to-contribute)
88
+ - [About](#about)
89
+ - [License](#license)
90
+
91
+ <a name="announcements"></a>
92
+ # Announcements
93
+
94
+ All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-${shortName}/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-${shortName}/releases). You may also subscribe to email for releases and breaking changes.
95
+
96
+ <a name="roadmap"></a>
97
+ # Roadmap
98
+
99
+ If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-${shortName}/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-${shortName}/pulls). We would love to hear your feedback.
100
+
101
+
102
+ <a name="about"></a>
103
+ # About
104
+
105
+ CoCreate-${shortName} is guided and supported by the CoCreate Developer Experience Team.
106
+
107
+ Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries.
108
+
109
+ CoCreate-${shortName} is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.
110
+
111
+ <a name="contribute"></a>
112
+ # How to Contribute
113
+
114
+ We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-${shortName}/blob/master/CONTRIBUTING.md) guide for details.
115
+
116
+ We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-${shortName}/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-${shortName}/pulls) or merely upvote or comment on existing issues or pull requests.
117
+
118
+ We appreciate your continued support, thank you!
119
+
120
+
121
+ <a name="license"></a>
122
+ # License
123
+ [The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-${shortName}/blob/master/LICENSE)
124
+
125
+
126
+ `;
127
+
128
+ let MdPath = path.resolve(absolutePath, 'README.md')
129
+ let formated = prettier.format(fileContent, { semi: false, parser: "markdown" });
130
+ if (fs.existsSync(MdPath))
131
+ fs.unlinkSync(MdPath)
132
+ fs.writeFileSync(MdPath, formated)
133
+
134
+
135
+ }
136
+
137
+
138
+ console.log('finished')
@@ -1,29 +1,29 @@
1
- let glob = require("glob");
2
- let fs = require('fs');
3
-
4
- function globUpdater(er, files) {
5
- if (er)
6
- console.log(files, 'glob resolving issue')
7
- else
8
- files.forEach(filename => update(filename))
9
- }
10
-
11
-
12
- function update(YmlPath) {
13
- if (fs.existsSync(YmlPath))
14
- fs.unlinkSync(YmlPath)
15
- }
16
-
17
-
18
- glob("../CoCreate-components/CoCreate-action/dist", globUpdater)
19
- // glob("../CoCreate-components/*/.github/workflows/automation.yml", globUpdater)
20
- // glob("../CoCreate-apps/*/.github/workflows/automation.yml", globUpdater)
21
- // glob("../CoCreate-plugins/*/.github/workflows/automation.yml", globUpdater)
22
-
23
- // substrin (9) removes CoCreateC leving namme as SS
24
- // glob("../CoCreateCSS/.github/workflows/automation.yml", globUpdater)
25
-
26
- // does not need to add name... will require for name to be removed from destination
27
- // glob("../CoCreateJS/.github/workflows/automation.yml", globUpdater)
28
-
1
+ let glob = require("glob");
2
+ let fs = require('fs');
3
+
4
+ function globUpdater(er, files) {
5
+ if (er)
6
+ console.log(files, 'glob resolving issue')
7
+ else
8
+ files.forEach(filename => update(filename))
9
+ }
10
+
11
+
12
+ function update(YmlPath) {
13
+ if (fs.existsSync(YmlPath))
14
+ fs.unlinkSync(YmlPath)
15
+ }
16
+
17
+
18
+ glob("../CoCreate-components/CoCreate-action/dist", globUpdater)
19
+ // glob("../CoCreate-components/*/.github/workflows/automation.yml", globUpdater)
20
+ // glob("../CoCreate-apps/*/.github/workflows/automation.yml", globUpdater)
21
+ // glob("../CoCreate-plugins/*/.github/workflows/automation.yml", globUpdater)
22
+
23
+ // substrin (9) removes CoCreateC leving namme as SS
24
+ // glob("../CoCreateCSS/.github/workflows/automation.yml", globUpdater)
25
+
26
+ // does not need to add name... will require for name to be removed from destination
27
+ // glob("../CoCreateJS/.github/workflows/automation.yml", globUpdater)
28
+
29
29
  console.log('finished')
@@ -1,43 +1,43 @@
1
- let glob = require("glob");
2
- let fs = require('fs');
3
- const path = require("path")
4
-
5
- function globUpdater(er, files) {
6
- if (er)
7
- console.log(files, 'glob resolving issue')
8
- else
9
- files.forEach(filename => update(filename))
10
- }
11
-
12
-
13
- function update(mdPath) {
14
- // component name
15
- // console.log(mdPath);
16
- let nameDir = mdPath;
17
- do{
18
- nameDir = path.dirname(nameDir);
19
- }while(! path.basename(nameDir).startsWith('CoCreate-'))
20
- let name = path.basename(nameDir).substring(9);
21
- // console.log(name);
22
- // process.exit();
23
- let replaceContent = fs.readFileSync(mdPath).toString()
24
-
25
- console.log(replaceContent, name);
26
- let replaced = replaceContent.replace(/boilerplate/ig, name)
27
-
28
-
29
- if (fs.existsSync(mdPath))
30
- fs.unlinkSync(mdPath)
31
- fs.writeFileSync(mdPath, replaced)
32
-
33
-
34
- }
35
-
36
-
37
- glob("./docs/", globUpdater)
38
- // glob("../CoCreate-docs/docs/*.html", globUpdater)
39
- // glob("../CoCreate-components/*/docs/*.html", globUpdater)
40
- // glob("../CoCreate-apps/*/docs/*.html", globUpdater)
41
- // glob("../CoCreate-plugins/*/docs/*.html", globUpdater)
42
-
1
+ let glob = require("glob");
2
+ let fs = require('fs');
3
+ const path = require("path")
4
+
5
+ function globUpdater(er, files) {
6
+ if (er)
7
+ console.log(files, 'glob resolving issue')
8
+ else
9
+ files.forEach(filename => update(filename))
10
+ }
11
+
12
+
13
+ function update(mdPath) {
14
+ // component name
15
+ // console.log(mdPath);
16
+ let nameDir = mdPath;
17
+ do{
18
+ nameDir = path.dirname(nameDir);
19
+ }while(! path.basename(nameDir).startsWith('CoCreate-'))
20
+ let name = path.basename(nameDir).substring(9);
21
+ // console.log(name);
22
+ // process.exit();
23
+ let replaceContent = fs.readFileSync(mdPath).toString()
24
+
25
+ console.log(replaceContent, name);
26
+ let replaced = replaceContent.replace(/boilerplate/ig, name)
27
+
28
+
29
+ if (fs.existsSync(mdPath))
30
+ fs.unlinkSync(mdPath)
31
+ fs.writeFileSync(mdPath, replaced)
32
+
33
+
34
+ }
35
+
36
+
37
+ glob("./docs/", globUpdater)
38
+ // glob("../CoCreate-docs/docs/*.html", globUpdater)
39
+ // glob("../CoCreate-components/*/docs/*.html", globUpdater)
40
+ // glob("../CoCreate-apps/*/docs/*.html", globUpdater)
41
+ // glob("../CoCreate-plugins/*/docs/*.html", globUpdater)
42
+
43
43
  console.log('finished')