Skip to content

Commit 81f3a28

Browse files
committed
fix: renamed CoCreate-components to CoCreate-modules
1 parent 5fcbc8c commit 81f3a28

File tree

7 files changed

+63
-95
lines changed

7 files changed

+63
-95
lines changed

src/commands/fs/automated.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137

138138
// Define the directories with wildcards
139139
const directories = [
140-
"../../../../../CoCreate-components/*/",
140+
"../../../../../CoCreate-modules/*/",
141141
"../../../../../CoCreate-apps/*/",
142142
"../../../../../CoCreate-plugins/*/",
143143
"../../../../../CoCreateCSS/",

src/commands/fs/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function createOrUpdateFile(directoryPath, fileName) {
111111

112112
// Define the directories with wildcards
113113
const directories = [
114-
"../../../../../CoCreate-components/*/",
114+
"../../../../../CoCreate-modules/*/",
115115
"../../../../../CoCreate-apps/*/",
116116
"../../../../../CoCreate-plugins/*/",
117117
"../../../../../CoCreateCSS/",

src/commands/fs/gitignore.js

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,32 @@
11
let glob = require("glob");
2-
let fs = require('fs');
3-
const path = require("path")
2+
let fs = require("fs");
3+
const path = require("path");
44

55
function globUpdater(er, files) {
6-
if (er)
7-
console.log(files, 'glob resolving issue')
8-
else
9-
files.forEach(filename => update(filename))
6+
if (er) console.log(files, "glob resolving issue");
7+
else files.forEach((filename) => update(filename));
108
}
119

12-
13-
14-
1510
function update(Path) {
16-
let fileContent = `# ignore
11+
let fileContent = `# ignore
1712
node_modules
1813
dist
1914
.npmrc
2015
2116
`;
22-
if (fs.existsSync(Path))
23-
fs.unlinkSync(Path)
24-
fs.writeFileSync(Path, fileContent)
25-
17+
if (fs.existsSync(Path)) fs.unlinkSync(Path);
18+
fs.writeFileSync(Path, fileContent);
2619
}
2720

28-
29-
30-
// glob("../CoCreate-components/CoCreate-action/.gitignore", globUpdater)
21+
// glob("../CoCreate-modules/CoCreate-action/.gitignore", globUpdater)
3122
// glob("./.gitignore", globUpdater)
3223
// glob("../CoCreate-adminUI/.gitignore", globUpdater)
33-
glob("../CoCreate-components/*/.gitignore", globUpdater)
34-
glob("../CoCreate-apps/*/.gitignore", globUpdater)
35-
glob("../CoCreate-plugins/*/.gitignore", globUpdater)
24+
glob("../CoCreate-modules/*/.gitignore", globUpdater);
25+
glob("../CoCreate-apps/*/.gitignore", globUpdater);
26+
glob("../CoCreate-plugins/*/.gitignore", globUpdater);
3627
// glob("../CoCreate-website/.gitignore", globUpdater)
3728
// glob("../CoCreate-website-template/.gitignore", globUpdater)
38-
glob("../CoCreateCSS/.gitignore", globUpdater)
29+
glob("../CoCreateCSS/.gitignore", globUpdater);
3930
// glob("../CoCreateJS/.gitignore", globUpdater)
4031

41-
console.log('finished')
32+
console.log("finished");

src/commands/fs/manual.js

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
let glob = require("glob");
2-
let fs = require('fs');
3-
const path = require("path")
2+
let fs = require("fs");
3+
const path = require("path");
44

55
function globUpdater(er, files) {
6-
7-
if (er)
8-
console.log(files, 'glob resolving issue')
6+
if (er) console.log(files, "glob resolving issue");
97
else
10-
files.forEach(filename => {
11-
12-
console.log(filename + '/manual.yml', 'glob resolving issue')
13-
update(filename + '/manual.yml')
14-
})
15-
8+
files.forEach((filename) => {
9+
console.log(filename + "/manual.yml", "glob resolving issue");
10+
update(filename + "/manual.yml");
11+
});
1612
}
1713

18-
19-
20-
2114
function update(Path) {
2215
// component name
23-
let name = path.basename(path.resolve(path.dirname(Path), '../..')).substring(9);
16+
let name = path
17+
.basename(path.resolve(path.dirname(Path), "../.."))
18+
.substring(9);
2419
let fileContent = `name: Manual Workflow
2520
on:
2621
workflow_dispatch:
@@ -68,24 +63,19 @@ jobs:
6863
6964
`;
7065

71-
72-
if (fs.existsSync(Path))
73-
fs.unlinkSync(Path)
74-
fs.writeFileSync(Path, fileContent)
75-
66+
if (fs.existsSync(Path)) fs.unlinkSync(Path);
67+
fs.writeFileSync(Path, fileContent);
7668
}
7769

78-
79-
80-
// glob("../CoCreate-components/CoCreate-action/.github/workflows", globUpdater)
81-
glob("../CoCreate-components/*/.github/workflows/", globUpdater)
82-
glob("../CoCreate-apps/*/.github/workflows/", globUpdater)
83-
glob("../CoCreate-plugins/*/.github/workflows/", globUpdater)
70+
// glob("../CoCreate-modules/CoCreate-action/.github/workflows", globUpdater)
71+
glob("../CoCreate-modules/*/.github/workflows/", globUpdater);
72+
glob("../CoCreate-apps/*/.github/workflows/", globUpdater);
73+
glob("../CoCreate-plugins/*/.github/workflows/", globUpdater);
8474

8575
// substrin (9) removes CoCreateC leving namme as SS
8676
// glob("../CoCreateCSS/.github/workflows/", globUpdater)
8777

8878
// does not need to add name... will require for name to be removed from destination
8979
// glob("../CoCreateJS/.github/workflows/", globUpdater)
9080

91-
console.log('finished')
81+
console.log("finished");

src/commands/fs/prettier.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function createOrUpdateFile(directoryPath, fileName) {
7777

7878
// Define the directories with wildcards
7979
const directories = [
80-
"../../../../../CoCreate-components/*/",
80+
"../../../../../CoCreate-modules/*/",
8181
"../../../../../CoCreate-apps/*/",
8282
"../../../../../CoCreate-plugins/*/",
8383
"../../../../../CoCreateCSS/",

src/commands/fs/remove.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
let glob = require("glob");
2-
let fs = require('fs');
2+
let fs = require("fs");
33

44
function globUpdater(er, files) {
5-
if (er)
6-
console.log(files, 'glob resolving issue')
7-
else
8-
files.forEach(filename => update(filename))
5+
if (er) console.log(files, "glob resolving issue");
6+
else files.forEach((filename) => update(filename));
97
}
108

11-
129
function update(YmlPath) {
13-
if (fs.existsSync(YmlPath))
14-
fs.unlinkSync(YmlPath)
10+
if (fs.existsSync(YmlPath)) fs.unlinkSync(YmlPath);
1511
}
1612

17-
18-
glob("../CoCreate-components/CoCreate-action/dist", globUpdater)
19-
// glob("../CoCreate-components/*/.github/workflows/automation.yml", globUpdater)
13+
glob("../CoCreate-modules/CoCreate-action/dist", globUpdater);
14+
// glob("../CoCreate-modules/*/.github/workflows/automation.yml", globUpdater)
2015
// glob("../CoCreate-apps/*/.github/workflows/automation.yml", globUpdater)
2116
// glob("../CoCreate-plugins/*/.github/workflows/automation.yml", globUpdater)
2217

@@ -26,4 +21,4 @@ glob("../CoCreate-components/CoCreate-action/dist", globUpdater)
2621
// does not need to add name... will require for name to be removed from destination
2722
// glob("../CoCreateJS/.github/workflows/automation.yml", globUpdater)
2823

29-
console.log('finished')
24+
console.log("finished");

src/commands/fs/replace.js

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,35 @@
11
let glob = require("glob");
2-
let fs = require('fs');
3-
const path = require("path")
2+
let fs = require("fs");
3+
const path = require("path");
44

55
function globUpdater(er, files) {
6-
if (er)
7-
console.log(files, 'glob resolving issue')
8-
else
9-
files.forEach(filename => update(filename))
6+
if (er) console.log(files, "glob resolving issue");
7+
else files.forEach((filename) => update(filename));
108
}
119

12-
1310
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-
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);
3427
}
3528

36-
37-
glob("./docs/", globUpdater)
29+
glob("./docs/", globUpdater);
3830
// glob("../CoCreate-docs/docs/*.html", globUpdater)
39-
// glob("../CoCreate-components/*/docs/*.html", globUpdater)
31+
// glob("../CoCreate-modules/*/docs/*.html", globUpdater)
4032
// glob("../CoCreate-apps/*/docs/*.html", globUpdater)
4133
// glob("../CoCreate-plugins/*/docs/*.html", globUpdater)
4234

43-
console.log('finished')
35+
console.log("finished");

0 commit comments

Comments
 (0)