@cocreate/cli 1.59.0 → 1.62.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.
@@ -1,99 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
-
4
- function findDirectories(startPath, callback, fileName) {
5
- // Resolve relative paths to absolute paths if needed
6
- const resolvedPath =
7
- startPath.startsWith("./") || startPath.startsWith("../")
8
- ? path.resolve(startPath)
9
- : startPath;
10
-
11
- const segments = resolvedPath.split("/"); // Split path by '/'
12
- let currentPath = "/"; // Start from root
13
-
14
- for (let i = 0; i < segments.length; i++) {
15
- const segment = segments[i];
16
- const isWildcard = segment === "*";
17
-
18
- if (isWildcard) {
19
- // Get all directories at this level
20
- const directories = fs
21
- .readdirSync(currentPath)
22
- .filter((file) =>
23
- fs.statSync(path.join(currentPath, file)).isDirectory()
24
- );
25
-
26
- // Process each directory and continue along the path
27
- directories.forEach((dir) => {
28
- findDirectories(
29
- path.join(currentPath, dir, ...segments.slice(i + 1)),
30
- callback,
31
- fileName
32
- );
33
- });
34
- return; // Stop further processing in the loop for wildcard case
35
- } else {
36
- // Continue to the next part of the path
37
- currentPath = path.join(currentPath, segment);
38
-
39
- // If a segment doesn’t exist or isn’t a directory, log an error and stop
40
- if (
41
- !fs.existsSync(currentPath) ||
42
- !fs.statSync(currentPath).isDirectory()
43
- ) {
44
- console.log(`Directory not found: ${currentPath}`);
45
- return;
46
- }
47
- }
48
- }
49
-
50
- // If we reach the end of the path without wildcards, we have a valid directory
51
- callback(currentPath, fileName);
52
- }
53
-
54
- function createOrUpdateFile(directoryPath, fileName) {
55
- const fileContent = `module.exports = {
56
- tabWidth: 4,
57
- semi: true,
58
- trailingComma: "none",
59
- bracketSameLine: true,
60
- useTabs: true,
61
- overrides: [
62
- {
63
- files: ["*.json", "*.yml", "*.yaml"],
64
- options: {
65
- tabWidth: 2,
66
- useTabs: false
67
- },
68
- }
69
- ],
70
- };`;
71
-
72
- const filePath = path.join(directoryPath, fileName);
73
- // Create or update the file
74
- if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
75
- fs.writeFileSync(filePath, fileContent);
76
- }
77
-
78
- // Define the directories with wildcards
79
- const directories = [
80
- "../../../../../CoCreate-modules/*/",
81
- "../../../../../CoCreate-apps/*/",
82
- "../../../../../CoCreate-plugins/*/",
83
- "../../../../../CoCreateCSS/",
84
- "../../../../../CoCreateJS/",
85
- "../../../../../CoCreateWS/",
86
- "../../../../../YellowOracle/",
87
- "../../../../../CoCreate-website/",
88
- "../../../../../CoCreate-admin/",
89
- "../../../../../CoCreate-website-old/",
90
- "../../../../../CoCreate-superadmin/",
91
- ];
92
- const fileName = "prettier.config.js";
93
-
94
- // Execute directory search and create/update file if the directory exists
95
- directories.forEach((directory) => {
96
- findDirectories(directory, createOrUpdateFile, fileName);
97
- });
98
-
99
- console.log("Finished");
@@ -1,138 +0,0 @@
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,24 +0,0 @@
1
- let glob = require("glob");
2
- let fs = require("fs");
3
-
4
- function globUpdater(er, files) {
5
- if (er) console.log(files, "glob resolving issue");
6
- else files.forEach((filename) => update(filename));
7
- }
8
-
9
- function update(YmlPath) {
10
- if (fs.existsSync(YmlPath)) fs.unlinkSync(YmlPath);
11
- }
12
-
13
- glob("../CoCreate-modules/CoCreate-action/dist", globUpdater);
14
- // glob("../CoCreate-modules/*/.github/workflows/automation.yml", globUpdater)
15
- // glob("../CoCreate-apps/*/.github/workflows/automation.yml", globUpdater)
16
- // glob("../CoCreate-plugins/*/.github/workflows/automation.yml", globUpdater)
17
-
18
- // substrin (9) removes CoCreateC leving namme as SS
19
- // glob("../CoCreateCSS/.github/workflows/automation.yml", globUpdater)
20
-
21
- // does not need to add name... will require for name to be removed from destination
22
- // glob("../CoCreateJS/.github/workflows/automation.yml", globUpdater)
23
-
24
- console.log("finished");
@@ -1,35 +0,0 @@
1
- let glob = require("glob");
2
- let fs = require("fs");
3
- const path = require("path");
4
-
5
- function globUpdater(er, files) {
6
- if (er) console.log(files, "glob resolving issue");
7
- else files.forEach((filename) => update(filename));
8
- }
9
-
10
- function update(mdPath) {
11
- // component name
12
- // console.log(mdPath);
13
- let nameDir = mdPath;
14
- do {
15
- nameDir = path.dirname(nameDir);
16
- } while (!path.basename(nameDir).startsWith("CoCreate-"));
17
- let name = path.basename(nameDir).substring(9);
18
- // console.log(name);
19
- // process.exit();
20
- let replaceContent = fs.readFileSync(mdPath).toString();
21
-
22
- console.log(replaceContent, name);
23
- let replaced = replaceContent.replace(/boilerplate/gi, name);
24
-
25
- if (fs.existsSync(mdPath)) fs.unlinkSync(mdPath);
26
- fs.writeFileSync(mdPath, replaced);
27
- }
28
-
29
- glob("./docs/", globUpdater);
30
- // glob("../CoCreate-docs/docs/*.html", globUpdater)
31
- // glob("../CoCreate-modules/*/docs/*.html", globUpdater)
32
- // glob("../CoCreate-apps/*/docs/*.html", globUpdater)
33
- // glob("../CoCreate-plugins/*/docs/*.html", globUpdater)
34
-
35
- console.log("finished");