@cocreate/cli 1.37.0 → 1.39.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,82 +1,70 @@
1
- name: Automated
2
- "on":
3
- push:
4
- branches:
5
- - master
6
- jobs:
7
- about:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - name: Checkout
11
- uses: actions/checkout@v3
12
- - name: setup nodejs
13
- uses: actions/setup-node@v3
14
- with:
15
- node-version: 16
16
- - name: Jaid/action-sync-node-meta
17
- uses: jaid/action-sync-node-meta@v1.4.0
18
- with:
19
- direction: overwrite-github
20
- githubToken: "${{ secrets.GITHUB }}"
21
- release:
22
- runs-on: ubuntu-latest
23
- steps:
24
- - name: Checkout
25
- uses: actions/checkout@v3
26
- - name: setup nodejs
27
- uses: actions/setup-node@v3
28
- with:
29
- node-version: 14
30
- - name: Semantic Release
31
- uses: cycjimmy/semantic-release-action@v3
32
- id: semantic
33
- with:
34
- extra_plugins: |
35
- @semantic-release/changelog
36
- @semantic-release/git
37
- @semantic-release/github
38
- env:
39
- GITHUB_TOKEN: "${{ secrets.GITHUB }}"
40
- NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
41
- outputs:
42
- new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
43
- new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
44
- upload:
45
- runs-on: ubuntu-latest
46
-
47
- steps:
48
- - name: Checkout
49
- uses: actions/checkout@v3
50
-
51
- - name: Setup Node.js
52
- uses: actions/setup-node@v3
53
- with:
54
- node-version: 16
55
-
56
- - name: Get Environment Variables
57
- run: |
58
- echo "organization_id=${{ secrets.COCREATE_ORGANIZATION_ID }}" >> $GITHUB_ENV
59
- echo "key=${{ secrets.COCREATE_KEY }}" >> $GITHUB_ENV
60
- echo "host=${{ secrets.COCREATE_HOST }}" >> $GITHUB_ENV
61
-
62
- - name: Install @cocreate/cli
63
- run: npm install -g @cocreate/cli
64
-
65
- - name: CoCreate CLI Upload
66
- run: coc upload
67
-
68
- # docs:
69
- # runs-on: ubuntu-latest
70
- # steps:
71
- # - name: Checkout
72
- # uses: actions/checkout@v3
73
- # - name: setup nodejs
74
- # uses: actions/setup-node@v3
75
- # with:
76
- # node-version: 16
77
- # - name: update documentation
78
- # uses: CoCreate-app/CoCreate-docs@master
79
- # env:
80
- # organization_id: ${{ secrets.COCREATE_ORGANIZATION_ID }}
81
- # key: ${{ secrets.COCREATE_KEY }}
82
- # host: ${{ secrets.COCREATE_HOST }}
1
+ name: Automated Workflow
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ jobs:
7
+ about:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Checkout
11
+ uses: actions/checkout@v3
12
+ - name: Setup Node.js
13
+ uses: actions/setup-node@v3
14
+ with:
15
+ node-version: 16
16
+ - name: Jaid/action-sync-node-meta
17
+ uses: jaid/action-sync-node-meta@v1.4.0
18
+ with:
19
+ direction: overwrite-github
20
+ githubToken: "${{ secrets.GITHUB }}"
21
+ release:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v3
26
+ - name: Setup Node.js
27
+ uses: actions/setup-node@v3
28
+ with:
29
+ node-version: 14
30
+ - name: Semantic Release
31
+ uses: cycjimmy/semantic-release-action@v3
32
+ id: semantic
33
+ with:
34
+ extra_plugins: |
35
+ @semantic-release/changelog
36
+ @semantic-release/git
37
+ @semantic-release/github
38
+ env:
39
+ GITHUB_TOKEN: "${{ secrets.GITHUB }}"
40
+ NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
41
+ outputs:
42
+ new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
43
+ new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
44
+ upload:
45
+ runs-on: ubuntu-latest
46
+ needs: release
47
+ if: needs.release.outputs.new_release_published == 'true'
48
+ env:
49
+ VERSION: "${{ needs.release.outputs.new_release_version }}"
50
+ steps:
51
+ - name: Checkout
52
+ uses: actions/checkout@v3
53
+ - name: Setup Node.js
54
+ uses: actions/setup-node@v3
55
+ with:
56
+ node-version: 16
57
+ - name: Set npm registry auth
58
+ run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
59
+ - name: Install dependencies
60
+ run: yarn install
61
+ - name: Build
62
+ run: yarn build
63
+ - name: Set Environment Variables
64
+ run: |
65
+ echo "organization_id=${{ secrets.COCREATE_ORGANIZATION_ID }}" >> $GITHUB_ENV
66
+ echo "key=${{ secrets.COCREATE_KEY }}" >> $GITHUB_ENV
67
+ echo "host=${{ secrets.COCREATE_HOST }}" >> $GITHUB_ENV
68
+ - name: CoCreate Upload
69
+ run: coc upload
70
+
package/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ # [1.39.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.38.0...v1.39.0) (2023-08-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * Update cocreate dependencies for the latest features and bug fixes ([6019645](https://github.com/CoCreate-app/CoCreate-cli/commit/6019645ffdb5914a2aa3415e337b8792d48960e0))
7
+
8
+ # [1.38.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.37.0...v1.38.0) (2023-08-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * /dist/CoCreate.js updated to https://CoCreate.app/dist/CoCreate.js ([54d696f](https://github.com/CoCreate-app/CoCreate-cli/commit/54d696fee5fb5b6a40145f4d029e3bebdfa27244))
14
+ * if -- remove from arg ([c6afdc0](https://github.com/CoCreate-app/CoCreate-cli/commit/c6afdc034e92950e7431b3eed51a67ffa8252267))
15
+ * replace cdn with /dist ([11fb652](https://github.com/CoCreate-app/CoCreate-cli/commit/11fb652063021b429e951bd6cea0ba6e6f287964))
16
+ * update automated syntax ([de581dd](https://github.com/CoCreate-app/CoCreate-cli/commit/de581dd6fc7119249a4f0286b66b8a820429c809))
17
+ * update file uploader ([8abf683](https://github.com/CoCreate-app/CoCreate-cli/commit/8abf683a261977e28ec497d0e4de1c6603ade116))
18
+
19
+
20
+ ### Features
21
+
22
+ * add loaders/replace-unicode.js ([9b226ed](https://github.com/CoCreate-app/CoCreate-cli/commit/9b226edb42f48b301116ade0dce924c15ffcfcda))
23
+ * create a spawn for letsencrypt and extract the txt value that needs to be added in the dns ([5b505cd](https://github.com/CoCreate-app/CoCreate-cli/commit/5b505cd29ac917c7297725d30640c1fa48cfffc5))
24
+ * option support to define a custom configPath ([64a5363](https://github.com/CoCreate-app/CoCreate-cli/commit/64a53630e0d26843ac0e951a89f496da72e344a9))
25
+
1
26
  # [1.37.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.36.0...v1.37.0) (2023-08-17)
2
27
 
3
28
 
package/docs/index.html CHANGED
@@ -272,6 +272,6 @@
272
272
  </div>
273
273
  </main>
274
274
  <script src="/apikey.js"></script>
275
- <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>
275
+ <script src="https://CoCreate.app/dist/CoCreate.js"></script>
276
276
  </body>
277
277
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cli",
3
- "version": "1.37.0",
3
+ "version": "1.39.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",
@@ -33,8 +33,6 @@
33
33
  "manual": "nodejs src/commands/fs/manual.js",
34
34
  "package": "nodejs src/commands/fs/package.js",
35
35
  "readme": "nodejs src/commands/fs/readme.js",
36
- "remove": "nodejs src/commands/remove.js",
37
- "replace": "nodejs src/commands/replace.js",
38
36
  "webpack": "nodejs src/commands/fs/webpack.js",
39
37
  "permissions": "chmod +rwx /home/ubuntu/.nvm/versions/node/v19.8.1/bin/coc"
40
38
  },
@@ -57,8 +55,8 @@
57
55
  "coc": "src/coc.js"
58
56
  },
59
57
  "dependencies": {
60
- "@cocreate/config": "^1.2.0",
61
- "@cocreate/file": "^1.4.0",
58
+ "@cocreate/config": "^1.4.0",
59
+ "@cocreate/file": "^1.5.3",
62
60
  "glob": "^7.1.7",
63
61
  "prettier": "^2.3.2"
64
62
  }
@@ -4,7 +4,10 @@ module.exports = async function (repos, args) {
4
4
  let object = {}
5
5
  for (let arg of args) {
6
6
  arg = arg.split('=')
7
- object[arg[0].substring(2)] = { value: arg[1] }
7
+ if (arg[0].startsWith('--'))
8
+ arg[0] = arg[0].substring(2)
9
+
10
+ object[arg[0]] = { value: arg[1] }
8
11
  }
9
12
 
10
13
  await config(object)
@@ -4,24 +4,18 @@ const path = require("path")
4
4
 
5
5
  function globUpdater(er, files) {
6
6
 
7
- if (er)
8
- console.log(files, 'glob resolving issue')
9
- else
10
- files.forEach(filename => {
11
-
12
- console.log(filename + '/automated.yml', 'glob resolving issue')
13
- update(filename + '/automated.yml')
14
- })
15
-
7
+ if (er)
8
+ console.log(files, 'glob resolving issue')
9
+ else
10
+ files.forEach(filename => {
11
+ update(filename + '/automated.yml')
12
+ })
13
+ console.log('Completed')
16
14
  }
17
15
 
18
-
19
-
20
-
21
16
  function update(YmlPath) {
22
- let name = path.basename(path.resolve(path.dirname(YmlPath), '../..')).substring(9);
23
- let fileContent = `name: Automated Workflow
24
- 'on':
17
+ let fileContent = `name: Automated Workflow
18
+ on:
25
19
  push:
26
20
  branches:
27
21
  - master
@@ -31,7 +25,7 @@ jobs:
31
25
  steps:
32
26
  - name: Checkout
33
27
  uses: actions/checkout@v3
34
- - name: setup nodejs
28
+ - name: Setup Node.js
35
29
  uses: actions/setup-node@v3
36
30
  with:
37
31
  node-version: 16
@@ -39,103 +33,73 @@ jobs:
39
33
  uses: jaid/action-sync-node-meta@v1.4.0
40
34
  with:
41
35
  direction: overwrite-github
42
- githubToken: '\${{ secrets.GITHUB }}'
36
+ githubToken: "\${{ secrets.GITHUB }}"
43
37
  release:
44
38
  runs-on: ubuntu-latest
45
39
  steps:
46
40
  - name: Checkout
47
41
  uses: actions/checkout@v3
48
- - name: setup nodejs
42
+ - name: Setup Node.js
49
43
  uses: actions/setup-node@v3
50
44
  with:
51
- node-version: 16
45
+ node-version: 14
52
46
  - name: Semantic Release
53
47
  uses: cycjimmy/semantic-release-action@v3
54
48
  id: semantic
55
49
  with:
56
50
  extra_plugins: |
57
51
  @semantic-release/changelog
58
- @semantic-release/npm
59
52
  @semantic-release/git
60
53
  @semantic-release/github
61
54
  env:
62
- GITHUB_TOKEN: '\${{ secrets.GITHUB_TOKEN }}'
63
- NPM_TOKEN: '\${{ secrets.NPM_TOKEN }}'
55
+ GITHUB_TOKEN: "\${{ secrets.GITHUB }}"
56
+ NPM_TOKEN: "\${{ secrets.NPM_TOKEN }}"
64
57
  outputs:
65
- new_release_published: '\${{ steps.semantic.outputs.new_release_published }}'
66
- new_release_version: '\${{ steps.semantic.outputs.new_release_version }}'
67
- cdn:
58
+ new_release_published: "\${{ steps.semantic.outputs.new_release_published }}"
59
+ new_release_version: "\${{ steps.semantic.outputs.new_release_version }}"
60
+ upload:
68
61
  runs-on: ubuntu-latest
69
62
  needs: release
70
63
  if: needs.release.outputs.new_release_published == 'true'
71
64
  env:
72
- VERSION: '\${{ needs.release.outputs.new_release_version }}'
65
+ VERSION: "\${{ needs.release.outputs.new_release_version }}"
73
66
  steps:
74
67
  - name: Checkout
75
68
  uses: actions/checkout@v3
76
- - name: setup nodejs
69
+ - name: Setup Node.js
77
70
  uses: actions/setup-node@v3
78
71
  with:
79
72
  node-version: 16
80
- - name: yarn install
81
- run: >
82
- echo "//registry.npmjs.org/:_authToken=\${{ secrets.NPM_TOKEN }}" >
83
- .npmrc
84
-
85
- yarn install
86
- - name: yarn build
73
+ - name: Set npm registry auth
74
+ run: echo "//registry.npmjs.org/:_authToken=\${{ secrets.NPM_TOKEN }}" > ~/.npmrc
75
+ - name: Install dependencies
76
+ run: yarn install
77
+ - name: Build
87
78
  run: yarn build
88
- - name: upload bundle as version
89
- uses: CoCreate-app/CoCreate-s3@master
90
- with:
91
- aws-key-id: '\${{ secrets.AWSACCESSKEYID }}'
92
- aws-access-key: '\${{ secrets.AWSSECERTACCESSKEY }}'
93
- bucket: testcrudbucket
94
- source: ./dist
95
- destination: '/${name}/\${{env.VERSION}}'
96
- acl: public-read
97
- - name: upload bundle as latest
98
- uses: CoCreate-app/CoCreate-s3@master
99
- with:
100
- aws-key-id: '\${{ secrets.AWSACCESSKEYID }}'
101
- aws-access-key: '\${{ secrets.AWSSECERTACCESSKEY }}'
102
- bucket: testcrudbucket
103
- source: ./dist
104
- destination: /${name}/latest
105
- acl: public-read
106
- invalidations: true
107
- docs:
108
- runs-on: ubuntu-latest
109
- steps:
110
- - name: Checkout
111
- uses: actions/checkout@v3
112
- - name: setup nodejs
113
- uses: actions/setup-node@v3
114
- with:
115
- node-version: 16
116
-
117
- - name: update documentation
118
- uses: CoCreate-app/CoCreate-docs@master
79
+ - name: Set Environment Variables
80
+ run: |
81
+ echo "organization_id=\${{ secrets.COCREATE_ORGANIZATION_ID }}" >> $GITHUB_ENV
82
+ echo "key=\${{ secrets.COCREATE_KEY }}" >> $GITHUB_ENV
83
+ echo "host=\${{ secrets.COCREATE_HOST }}" >> $GITHUB_ENV
84
+ - name: CoCreate Upload
85
+ run: coc upload
119
86
 
120
87
  `;
121
- // process.exit()
122
- if (fs.existsSync(YmlPath))
123
- fs.unlinkSync(YmlPath)
124
- fs.writeFileSync(YmlPath, fileContent)
88
+ // process.exit()
89
+ if (fs.existsSync(YmlPath))
90
+ fs.unlinkSync(YmlPath)
91
+ fs.writeFileSync(YmlPath, fileContent)
125
92
 
126
93
  }
127
94
 
128
95
 
129
96
 
130
- // glob("../CoCreate-components/CoCreate-action/.github/workflows", globUpdater)
131
- glob("../CoCreate-components/*/.github/workflows/", globUpdater)
132
- glob("../CoCreate-apps/*/.github/workflows/", globUpdater)
133
- glob("../CoCreate-plugins/*/.github/workflows/", globUpdater)
134
-
135
- // substrin (9) removes CoCreateC leving namme as SS
136
- // glob("../CoCreateCSS/.github/workflows/", globUpdater)
137
-
138
- // does not need to add name... will require for name to be removed from destination
139
- // glob("../CoCreateJS/.github/workflows/", globUpdater)
97
+ // glob("/home/cocreate/CoCreate/CoCreate-components/CoCreate-actions/.github/workflows", globUpdater)
98
+ glob("/home/cocreate/CoCreate/CoCreate-components/*/.github/workflows/", globUpdater)
99
+ glob("/home/cocreate/CoCreate/CoCreate-apps/*/.github/workflows/", globUpdater)
100
+ glob("/home/cocreate/CoCreate/CoCreate-plugins/*/.github/workflows/", globUpdater)
140
101
 
141
- console.log('finished')
102
+ glob("/home/cocreate/CoCreate/CoCreate-admin/.github/workflows/", globUpdater)
103
+ glob("/home/cocreate/CoCreate/CoCreateCSS/.github/workflows/", globUpdater)
104
+ glob("/home/cocreate/CoCreate/CoCreateJS/.github/workflows/", globUpdater)
105
+ glob("/home/cocreate/CoCreate/CoCreate-wesite/.github/workflows/", globUpdater)
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env node
2
+
1
3
  const { spawn } = require('child_process');
2
4
 
3
5
  function runCertbot() {
@@ -9,24 +11,35 @@ function runCertbot() {
9
11
  '-d', '*.cocreate.zone',
10
12
  '-d', 'cocreate.zone',
11
13
  '--agree-tos',
12
- '-m', 'admin@cocreate.app',
14
+ '-m', 'admin@cocreate.zone',
13
15
  '--preferred-challenges', 'dns-01',
14
16
  '--server', 'https://acme-v02.api.letsencrypt.org/directory'
15
17
  ]);
16
18
 
17
- let promptsCount = 0;
19
+ // let promptsCount = 0;
18
20
 
19
21
  certbotProcess.stdout.on('data', (data) => {
20
22
  const output = data.toString();
21
- if (output.includes('Enter your response here')) {
22
- promptsCount++;
23
- if (promptsCount === 1) {
24
- certbotProcess.stdin.write('Your first response\n');
25
- } else if (promptsCount === 2) {
26
- certbotProcess.stdin.write('Your second response\n');
27
- } else if (promptsCount === 3) {
28
- certbotProcess.stdin.write('Your third response\n');
23
+ if (output.includes('Please deploy a DNS TXT record under the name:')) {
24
+ const namePattern = /Please deploy a DNS TXT record under the name:\s+([\w\.-]+)\./;
25
+ const valuePattern = /with the following value:\s+([\w\d]+)\s+/;
26
+
27
+ const nameMatch = output.match(namePattern);
28
+ const valueMatch = output.match(valuePattern);
29
+
30
+ if (nameMatch && valueMatch) {
31
+ const name = nameMatch[1];
32
+ const value = valueMatch[1];
33
+
34
+ console.log("Name:", name);
35
+ console.log("Value:", value);
36
+ } else {
37
+ console.log("Name or value not found in the text.");
29
38
  }
39
+ // TODO: send name and value to client and wait for clients response before continuing
40
+ certbotProcess.stdin.write('\n');
41
+ } else if (output.includes('Press Enter to Continue')) {
42
+ certbotProcess.stdin.write('\n');
30
43
  }
31
44
  });
32
45
 
@@ -1,5 +1,42 @@
1
1
  const file = require('@cocreate/file')
2
+ const path = require('path');
3
+ const fs = require('fs');
2
4
 
3
5
  module.exports = async function upload(repos, args) {
4
- await file()
6
+ let CoCreateConfig
7
+ if (!args.length) {
8
+ let configFile = path.resolve(process.cwd(), 'CoCreate.config.js');
9
+ if (!CoCreateConfig && fs.existsSync(configFile)) {
10
+ CoCreateConfig = require(configFile);
11
+ } else {
12
+ console.log('CoCreate.config.js could not be found.')
13
+ process.exit()
14
+ }
15
+
16
+ await file(CoCreateConfig)
17
+
18
+ } else {
19
+ for (let arg of args) {
20
+ try {
21
+ CoCreateConfig = JSON.parse(arg)
22
+ } catch (error) { }
23
+
24
+
25
+ if (!CoCreateConfig) {
26
+ try {
27
+ let configPath = path.resolve(process.cwd(), arg)
28
+ if (fs.existsSync(configPath)) {
29
+ CoCreateConfig = require(configPath);
30
+ if (CoCreateConfig)
31
+ await file(CoCreateConfig, configPath)
32
+
33
+ } else {
34
+ console.log(arg + ' could not be found.')
35
+ process.exit()
36
+ }
37
+
38
+ } catch (error) { }
39
+ }
40
+ }
41
+ }
5
42
  }
@@ -0,0 +1,3 @@
1
+ module.exports = function (source) {
2
+ return source.replace(/\$'/g, '\\u0024\'');
3
+ };