@cocreate/acme 1.0.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.
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: CoCreate-app
@@ -0,0 +1,44 @@
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
+
@@ -0,0 +1,44 @@
1
+ name: Manual Workflow
2
+ on:
3
+ workflow_dispatch:
4
+ inputs:
5
+ invalidations:
6
+ description: |
7
+ If set to 'true', invalidates previous upload.
8
+ default: "true"
9
+ required: true
10
+
11
+ jobs:
12
+ cdn:
13
+ runs-on: ubuntu-latest
14
+ env:
15
+ DRY_RUN: ${{ github.event.inputs.dry_run }}
16
+ GITHUB_TOKEN: "${{ secrets.GITHUB }}"
17
+ NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
18
+
19
+ steps:
20
+ - name: Checkout
21
+ uses: actions/checkout@v3
22
+ - name: setup nodejs
23
+ uses: actions/setup-node@v3
24
+ with:
25
+ node-version: 16
26
+ - name: yarn install
27
+ run: >
28
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
29
+ .npmrc
30
+
31
+ yarn install
32
+ - name: yarn build
33
+ run: yarn build
34
+ - name: upload latest bundle
35
+ uses: CoCreate-app/CoCreate-s3@master
36
+ with:
37
+ aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
38
+ aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
39
+ distributionId: "${{ secrets.DISTRIBUTION_ID }}"
40
+ bucket: testcrudbucket
41
+ source: ./dist
42
+ destination: /acme/latest
43
+ acl: public-read
44
+ invalidations: ${{ github.event.inputs.invalidations }}
package/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # 1.0.0 (2023-12-30)
2
+
3
+
4
+ ### Features
5
+
6
+ * Intial Release ([245a6ca](https://github.com/CoCreate-app/CoCreate-acme/commit/245a6ca55bcdc0d8285f6d0db0b35574991d29c4))
@@ -0,0 +1,111 @@
1
+ # Contributing to CoCreate-acme
2
+
3
+ This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-acme/graphs/contributors).
4
+ You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-acme/pulls),
5
+ [propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-acme/issues).
6
+
7
+ In the examples below, substitute your Github username for `contributor` in URLs.
8
+
9
+ ## Fork the Project
10
+
11
+ Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-acme) and check out your copy.
12
+
13
+ ```
14
+ git clone https://github.com/contributor/CoCreate-acme.git
15
+ cd CoCreate-acme
16
+ git remote add upstream https://github.com/CoCreate-app/CoCreate-acme.git
17
+ ```
18
+
19
+ ## Create a Topic Branch
20
+
21
+ Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
22
+
23
+ ```
24
+ git checkout master
25
+ git pull upstream master
26
+ git checkout -b my-feature-branch
27
+ ```
28
+
29
+ ## Write Tests
30
+
31
+ Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build.
32
+ Add to [spec](spec).
33
+
34
+ We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
35
+
36
+ ## Write Code
37
+
38
+ Implement your feature or bug fix.
39
+
40
+ ## Write Documentation
41
+
42
+ Document any external behavior in the [README](README.md).
43
+
44
+ ## Update Changelog
45
+
46
+ Add a line to [CHANGELOG](CHANGELOG.md) under _Next Release_.
47
+ Make it look like every other line, including your name and link to your Github account.
48
+
49
+ ## Commit Changes
50
+
51
+ Make sure git knows your name and email address:
52
+
53
+ ```
54
+ git config --global user.name "Your Name"
55
+ git config --global user.email "contributor@example.com"
56
+ ```
57
+
58
+ Writing good commit logs is important. A commit log should describe what changed and why.
59
+
60
+ ```
61
+ git add ...
62
+ git commit
63
+ ```
64
+
65
+ ## Push
66
+
67
+ ```
68
+ git push origin my-feature-branch
69
+ ```
70
+
71
+ ## Make a Pull Request
72
+
73
+ Go to [https://github.com/CoCreate-app/CoCreate-acme](https://github.com/CoCreate-app/CoCreate-acme) and select your feature branch.
74
+ Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
75
+
76
+ ## Rebase
77
+
78
+ If you've been working on a change for a while, rebase with upstream/master.
79
+
80
+ ```
81
+ git fetch upstream
82
+ git rebase upstream/master
83
+ git push origin my-feature-branch -f
84
+ ```
85
+
86
+ ## Update CHANGELOG Again
87
+
88
+ Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
89
+
90
+ ```
91
+ * [#123](https://github.com/CoCreate-app/CoCreate-industry/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
92
+ ```
93
+
94
+ Amend your previous commit and force push the changes.
95
+
96
+ ```
97
+ git commit --amend
98
+ git push origin my-feature-branch -f
99
+ ```
100
+
101
+ ## Check on Your Pull Request
102
+
103
+ Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
104
+
105
+ ## Be Patient
106
+
107
+ It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
108
+
109
+ ## Thank You
110
+
111
+ Please do know that we really appreciate and value your time and work. We love you, really.
@@ -0,0 +1,41 @@
1
+ module.exports = {
2
+ "organization_id": "",
3
+ "key": "",
4
+ "host": "",
5
+ "directories": [
6
+ {
7
+ "entry": "./demo",
8
+ "array": "files",
9
+ "object": {
10
+ "name": "{{name}}",
11
+ "src": "{{source}}",
12
+ "host": [
13
+ "*"
14
+ ],
15
+ "directory": "/demo/acme/{{directory}}",
16
+ "path": "{{path}}",
17
+ "pathname": "{{pathname}}",
18
+ "content-type": "{{content-type}}",
19
+ "public": "true"
20
+ }
21
+ }
22
+ ],
23
+ "sources": [
24
+ {
25
+ "array": "files",
26
+ "object": {
27
+ "_id": "61a12db2a8b6b4001a9f5a2e",
28
+ "name": "index.html",
29
+ "path": "/docs/acme",
30
+ "pathname": "/docs/acme/index.html",
31
+ "src": "{{./docs/index.html}}",
32
+ "host": [
33
+ "*"
34
+ ],
35
+ "directory": "acme",
36
+ "content-type": "{{content-type}}",
37
+ "public": "true"
38
+ }
39
+ }
40
+ ]
41
+ };
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 CoCreate LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # CoCreate-acme
2
+
3
+ A convenient chain handler allows user to chain multiple CoCreate components together. When one action is complete next one will start. The sequence goes untill all acme completed. Grounded on Vanilla javascript, easily configured using HTML5 attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/acme)
4
+
5
+ ![minified](https://img.badgesize.io/https://cdn.cocreate.app/acme/latest/CoCreate-acme.min.js?style=flat-square&label=minified&color=orange)
6
+ ![gzip](https://img.badgesize.io/https://cdn.cocreate.app/acme/latest/CoCreate-acme.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow)
7
+ ![brotli](https://img.badgesize.io/https://cdn.cocreate.app/acme/latest/CoCreate-acme.min.js?compression=brotli&style=flat-square&label=brotli)
8
+ ![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-action?style=flat-square)
9
+ ![License](https://img.shields.io/github/license/CoCreate-app/CoCreate-action?style=flat-square)
10
+ ![Hiring](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet)
11
+
12
+ ![CoCreate-acme](https://cdn.cocreate.app/docs/CoCreate-acme.gif)
13
+
14
+ ## [Docs & Demo](https://cocreate.app/docs/acme)
15
+
16
+ For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/acme)
17
+
18
+ ## CDN
19
+
20
+ ```html
21
+ <script src="https://cdn.cocreate.app/acme/latest/CoCreate-acme.min.js"></script>
22
+ ```
23
+
24
+ ```html
25
+ <script src="https://cdn.cocreate.app/acme/latest/CoCreate-acme.min.css"></script>
26
+ ```
27
+
28
+ ## NPM
29
+
30
+ ```shell
31
+ $ npm i @cocreate/acme
32
+ ```
33
+
34
+ ## yarn
35
+
36
+ ```shell
37
+ $ yarn install @cocreate/acme
38
+ ```
39
+
40
+ # Table of Contents
41
+
42
+ - [Table of Contents](#table-of-contents)
43
+ - [Announcements](#announcements)
44
+ - [Roadmap](#roadmap)
45
+ - [How to Contribute](#how-to-contribute)
46
+ - [About](#about)
47
+ - [License](#license)
48
+
49
+ <a name="announcements"></a>
50
+
51
+ # Announcements
52
+
53
+ All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-acme/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-acme/releases). You may also subscribe to email for releases and breaking changes.
54
+
55
+ <a name="roadmap"></a>
56
+
57
+ # Roadmap
58
+
59
+ 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-acme/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-acme/pulls). We would love to hear your feedback.
60
+
61
+ <a name="about"></a>
62
+
63
+ # About
64
+
65
+ CoCreate-acme is guided and supported by the CoCreate Developer Experience Team.
66
+
67
+ Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries.
68
+
69
+ CoCreate-acme is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.
70
+
71
+ <a name="contribute"></a>
72
+
73
+ # How to Contribute
74
+
75
+ We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-acme/blob/master/CONTRIBUTING.md) guide for details.
76
+
77
+ 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-acme/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-acme/pulls) or merely upvote or comment on existing issues or pull requests.
78
+
79
+ We appreciate your continued support, thank you!
80
+
81
+ <a name="license"></a>
82
+
83
+ # License
84
+
85
+ [The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-acme/blob/master/LICENSE)
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>ACME | CoCreateJS</title>
5
+
6
+ <!-- CoCreate Favicon -->
7
+ <link
8
+ rel="icon"
9
+ type="image/png"
10
+ sizes="32x32"
11
+ href="../assets/favicon.ico" />
12
+ </head>
13
+ <body>
14
+ <form>
15
+ <textarea acme="message"></textarea>
16
+ <button actions="ACME, reset">click</button>
17
+ </form>
18
+
19
+ <!-- <div
20
+ array="users"
21
+ array="interviews"
22
+ object
23
+ filter-sort-key="name"
24
+ filter-sort-direction="asc"
25
+ render-selector="[template]">
26
+ <div
27
+ class="background:gainsboro:hover border-bottom:1px_solid_darkgray"
28
+ template
29
+ object="{{object._id}}"
30
+ toggle="selected">
31
+ <p>{{ACME}}</p>
32
+ </div>
33
+ </div> -->
34
+
35
+ <!-- <script src="../src/CoCreate-acme.js"></script> -->
36
+ <script src="./dist/CoCreate.js"></script>
37
+ </body>
38
+ </html>
@@ -0,0 +1,380 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <title>CoCreate-acme Documentation | CoCreateJS</title>
8
+ <link
9
+ rel="icon"
10
+ type="image/png"
11
+ sizes="32x32"
12
+ href="https://cocreate.app/images/favicon.ico" />
13
+ <meta
14
+ name="description"
15
+ content="A convenient chain handler allows user to chain multiple components together. When one acme is complete next one will start untill all acme completed." />
16
+ <meta
17
+ name="keywords"
18
+ content="helper classes, utility classes, css framework, css library, inline style classes" />
19
+ <meta name="robots" content="index,follow" />
20
+ <meta
21
+ property="og:image"
22
+ content="https://cdn.cocreate.app/docs/acme.png" />
23
+
24
+ <!-- CoCreate CSS -->
25
+ <link
26
+ rel="stylesheet"
27
+ href="https://cdn.cocreate.app/latest/CoCreate.min.css"
28
+ type="text/css" />
29
+ <link
30
+ rel="stylesheet"
31
+ href="../index.css"
32
+ array="files"
33
+ object="60888216117c640e7596303f"
34
+ key="src"
35
+ type="text/css"
36
+ save="true" />
37
+ <link rel="manifest" href="/manifest.webmanifest" />
38
+ </head>
39
+
40
+ <body>
41
+ <!-- Navbar -->
42
+ <nav
43
+ class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
44
+ content_id="content"
45
+ scroll="sticky-nav,"
46
+ scroll-up="5"
47
+ scroll-down="5"
48
+ path="../"
49
+ src="../components/navbar.html"></nav>
50
+ <sidenav
51
+ id="menuL"
52
+ class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
53
+ resizable
54
+ resize-selector="[content_id='content']"
55
+ resize-property="margin-left"
56
+ resize-value="width">
57
+ <menu
58
+ array="files"
59
+ object="603717b07de7fb350ae9fec8"
60
+ key="src"></menu>
61
+ <div resize="right"></div>
62
+ </sidenav>
63
+ <main
64
+ class="padding-top:15px padding:15px@lg@xl"
65
+ content_id="content"
66
+ id="cocreate-acme">
67
+ <div
68
+ class="display:flex flex-wrap:wrap justify-content:space-between position:relative margin:10px">
69
+ <div class="display:flex align-items:center">
70
+ <h2>CoCreate-acme</h2>
71
+ </div>
72
+ <div
73
+ class="display:flex align-items:center font-size:20px position:absolute right:0 padding:5px background:white">
74
+ <div
75
+ class="display:flex align-items:center transition:0.3s padding-left:10px"
76
+ share-network="true"
77
+ share-text="A convenient chain handler allows user to chain multiple components together. When one acme is complete next one will start untill all acme completed."
78
+ share-title="CoCreate acme"
79
+ share-height="600"
80
+ share-width="700"
81
+ share-media="https://cdn.cocreate.app/docs/acme.png"
82
+ hover="display:block!important"
83
+ hover-selector=".social-networks">
84
+ <div class="display:none social-networks">
85
+ <a
86
+ class="margin-right:15px"
87
+ share-network="twitter"
88
+ title="Share on twitter"
89
+ ><i
90
+ class="height:20px fill:#505050"
91
+ src="/assets/svg/twitter.svg"></i
92
+ ></a>
93
+ <a
94
+ class="margin-right:15px"
95
+ share-network="facebook"
96
+ title="Share on Facebook"
97
+ ><i
98
+ class="height:20px fill:#505050"
99
+ src="/assets/svg/facebook.svg"></i
100
+ ></a>
101
+ <a
102
+ class="margin-right:15px"
103
+ share-network="instagram"
104
+ title="Share on instagram"
105
+ ><i
106
+ class="height:20px fill:#505050"
107
+ src="/assets/svg/instagram.svg"></i
108
+ ></a>
109
+ </div>
110
+ <a
111
+ class="margin-right:15px"
112
+ share-network="share"
113
+ title="Share on share"
114
+ ><i
115
+ class="height:20px fill:#505050"
116
+ src="/assets/svg/share-alt.svg"></i
117
+ ></a>
118
+ </div>
119
+ <a
120
+ class="margin-right:15px"
121
+ share-network="share"
122
+ title="Share on share"
123
+ ><i
124
+ class="height:20px fill:#505050"
125
+ src="/assets/svg/share-alt.svg"></i
126
+ ></a>
127
+ </div>
128
+ <a
129
+ href="https://github.com/CoCreate-app/CoCreate-acme"
130
+ target="_blank"
131
+ class=""
132
+ ><i
133
+ class="height:20px fill:#505050"
134
+ src="/assets/svg/github.svg"></i
135
+ ></a>
136
+ </div>
137
+
138
+ <h1
139
+ class="max-width:500px margin:20px_10px line-height:1.5 font-size:16px font-weight:100">
140
+ A convenient chain handler allows user to chain multiple
141
+ CoCreate components together. When one acme is complete next one
142
+ will start. The sequence goes untill all acme completed.
143
+ Grounded on Vanilla javascript, easily configured using HTML5
144
+ attributes and/or JavaScript API.
145
+ </h1>
146
+ <div id="acme-section" class="display:flex flex-wrap:wrap">
147
+ <div
148
+ class="flex-grow:1 width:400px width:300px@xs padding:0px_10px margin-top:60px">
149
+ <div
150
+ id="acme-install"
151
+ class="border-bottom:1px_solid_lightgrey"
152
+ scroll
153
+ scroll-intersect="color:dodgerblue"
154
+ scroll-selector="#acme-install-section">
155
+ <span
156
+ class="display:flex align-items:center width:fit-content"
157
+ hover="display:block!important"
158
+ hover-selector="[href='#acme-install']">
159
+ <h2 class="padding:5px_0px">Install</h2>
160
+ <a
161
+ class="margin-left:10px display:none"
162
+ href="#acme-install"
163
+ ><i
164
+ class="height:20px fill:#505050"
165
+ src="/assets/svg/link.svg"></i
166
+ ></a>
167
+ </span>
168
+ </div>
169
+
170
+ <pre><code class="language-bash">npm i @cocreate/acme</code></pre>
171
+ <p class="padding:10px_0px line-height:1.5">
172
+ Or you can use cdn link:
173
+ </p>
174
+ <pre><code class="language-html">&lt;script&gt;https://cdn.cocreate.app/acme/latest/CoCreate-acme.min.js&lt;/script&gt;</code></pre>
175
+
176
+ <div
177
+ id="acme-usage"
178
+ class="margin-top:80px border-bottom:1px_solid_lightgrey"
179
+ scroll
180
+ scroll-intersect="color:dodgerblue"
181
+ scroll-selector="#acme-usage-section">
182
+ <span
183
+ class="display:flex align-items:center width:fit-content"
184
+ hover="display:block!important"
185
+ hover-selector="[href='#acme-usage']">
186
+ <h2 class="padding:5px_0px">Usage</h2>
187
+ <a
188
+ class="margin-left:10px display:none"
189
+ href="#acme-usage"
190
+ ><i
191
+ class="height:20px fill:#505050"
192
+ src="/assets/svg/link.svg"></i
193
+ ></a>
194
+ </span>
195
+ </div>
196
+ <div class="">
197
+ <p class="padding:10px_0px line-height:1.5">
198
+ This is acme usage
199
+ </p>
200
+
201
+ <div class="flex-grow:1 min-width:300px width:100%">
202
+ <pre><code class="language-html">&lt;div&gt;&lt;/div&gt;</code></pre>
203
+ </div>
204
+ <p class="padding:10px_0px line-height:1.5">
205
+ This is acme usage
206
+ </p>
207
+ <p class="padding:10px_0px line-height:1.5">
208
+ This is acme usage
209
+ </p>
210
+ </div>
211
+
212
+ <div
213
+ id="acme-attributes"
214
+ class="margin-top:80px border-bottom:1px_solid_lightgrey"
215
+ scroll
216
+ scroll-intersect="color:dodgerblue"
217
+ scroll-selector="#acme-attributes-section">
218
+ <span
219
+ class="display:flex align-items:center width:fit-content"
220
+ hover="display:block!important"
221
+ hover-selector="[href='#acme-attributes']">
222
+ <h2 class="padding:5px_0px">Attributes</h2>
223
+ <a
224
+ class="margin-left:10px display:none"
225
+ href="#acme-attributes"
226
+ ><i
227
+ class="height:20px fill:#505050"
228
+ src="/assets/svg/link.svg"></i
229
+ ></a>
230
+ </span>
231
+ </div>
232
+
233
+ <ul class="list-style-type:none">
234
+ <li
235
+ class="padding:15px_0px border-bottom:1px_solid_lightgrey">
236
+ <h4>
237
+ <span>acme</span>
238
+ <span class="cocreate-badge success"
239
+ >string</span
240
+ >
241
+ <span class="cocreate-badge warning"
242
+ >optional</span
243
+ >
244
+ </h4>
245
+ <p>acme-attribute</p>
246
+ </li>
247
+ <li
248
+ class="padding:15px_0px border-bottom:1px_solid_lightgrey">
249
+ <h4>
250
+ <span>acme</span>
251
+ <span class="cocreate-badge success"
252
+ >string</span
253
+ >
254
+ <span class="cocreate-badge warning"
255
+ >optional</span
256
+ >
257
+ </h4>
258
+ <p>acme-attribute</p>
259
+ </li>
260
+ </ul>
261
+ </div>
262
+
263
+ <div
264
+ class="flex-grow:1 width:300px padding:0px_10px margin-top:60px border-bottom:1px_solid_lightgrey">
265
+ <!-- SandBox -->
266
+ <div
267
+ id="acme-demo"
268
+ class="border-bottom:1px_solid_lightgrey"
269
+ scroll
270
+ scroll-intersect="color:dodgerblue"
271
+ scroll-selector="#acme-demo-section">
272
+ <span
273
+ class="display:flex align-items:center width:fit-content"
274
+ hover="display:block!important"
275
+ hover-selector="[href='#acme-demo']">
276
+ <h2 class="padding:5px_0px">Demo</h2>
277
+ <a
278
+ class="margin-left:10px display:none"
279
+ href="#acme-demo"
280
+ ><i
281
+ class="height:20px fill:#505050"
282
+ src="/assets/svg/link.svg"></i
283
+ ></a>
284
+ </span>
285
+ </div>
286
+
287
+ <div
288
+ class="position:sticky top:0 padding:15px_0px height:100vh">
289
+ <!-- SandBox -->
290
+ <div
291
+ class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px"
292
+ id="playground">
293
+ <div
294
+ id="demo-code"
295
+ resizable
296
+ class="position:relative height:50%">
297
+ <textarea
298
+ type="code"
299
+ lang="html"
300
+ array="demos"
301
+ object=""
302
+ key="demo"
303
+ save="false"
304
+ id="demo"
305
+ class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
306
+ <div
307
+ resize="bottom"
308
+ class="background:lightgrey"></div>
309
+ </div>
310
+
311
+ <div
312
+ id="demo-preview"
313
+ class="position:relative overflow:auto background-color:white">
314
+ <div class="demopreview padding:20px"></div>
315
+ </div>
316
+
317
+ <div
318
+ class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
319
+ <a
320
+ class="margin-right:10px"
321
+ id="eye"
322
+ show="#eye-slash"
323
+ hide="#eye, #demo-preview"
324
+ toggle="code-height"
325
+ toggle-selector="#demo-code"
326
+ ><i
327
+ class="height:18px fill:#505050"
328
+ src="/assets/svg/eye.svg"></i
329
+ ></a>
330
+ <a
331
+ class="margin-right:10px"
332
+ hidden
333
+ id="eye-slash"
334
+ show="#eye, #demo-preview"
335
+ hide="#eye-slash"
336
+ toggle="code-height"
337
+ toggle-selector="#demo-code"
338
+ ><i
339
+ class="height:20px fill:#505050"
340
+ src="/assets/svg/eye-slash.svg"></i
341
+ ></a>
342
+ <a
343
+ class="margin-right:10px"
344
+ id="code"
345
+ show="#code-slash"
346
+ hide="#code, #demo-code"
347
+ ><i
348
+ class="height:20px fill:#505050"
349
+ src="/assets/svg/code.svg"></i
350
+ ></a>
351
+ <a
352
+ class="margin-right:10px"
353
+ hidden
354
+ id="code-slash"
355
+ show="#code, #demo-code"
356
+ hide="#code-slash"
357
+ ><i
358
+ class="display:flex height:18px fill:#505050"
359
+ src="/assets/svg/code.svg"></i
360
+ ></a>
361
+ <a
362
+ class="margin-right:5px"
363
+ fullscreen
364
+ fullscreen-selector="#playground"></a>
365
+ </div>
366
+ </div>
367
+ <!-- End SandBox -->
368
+ </div>
369
+ </div>
370
+ </div>
371
+ <button
372
+ href="https://github.com/CoCreate-app/CoCreate-acme/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
373
+ target="_blank"
374
+ class="display:flex justify-content:center align-items:center position:fixed bottom:15px right:15px height:50px width:50px border-radius:50% box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
375
+ <i class="height:20px" src="../assets/svg/pencil-alt.svg"></i>
376
+ </button>
377
+ </main>
378
+ <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>
379
+ </body>
380
+ </html>
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@cocreate/acme",
3
+ "version": "1.0.0",
4
+ "description": "An intergration with ACME and CoCreateJS.",
5
+ "keywords": [
6
+ "acme",
7
+ "chain-functions",
8
+ "cocreate",
9
+ "low-code-framework",
10
+ "no-code-framework",
11
+ "cocreatejs",
12
+ "cocreatejs-component",
13
+ "cocreate-framework",
14
+ "no-code",
15
+ "low-code",
16
+ "collaborative-framework",
17
+ "realtime",
18
+ "realtime-framework",
19
+ "collaboration",
20
+ "shared-editing",
21
+ "html5-framework",
22
+ "javascript-framework"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "start": "npx webpack --config webpack.config.js",
29
+ "build": "npx webpack --mode=production --config webpack.config.js",
30
+ "dev": "npx webpack --config webpack.config.js --watch",
31
+ "postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\""
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/CoCreate-app/CoCreate-acme.git"
36
+ },
37
+ "author": "CoCreate LLC",
38
+ "license": "MIT",
39
+ "bugs": {
40
+ "url": "https://github.com/CoCreate-app/CoCreate-acme/issues"
41
+ },
42
+ "homepage": "https://cocreate.app/docs/acme",
43
+ "funding": {
44
+ "type": "GitHub Sponsors ❤",
45
+ "url": "https://github.com/sponsors/CoCreate-app"
46
+ },
47
+ "main": "./src/index.js",
48
+ "dependencies": {
49
+ "acme-client": "^5.0.0"
50
+ }
51
+ }
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ dryRun: false,
3
+ branches: ["master"],
4
+ plugins: [
5
+ "@semantic-release/commit-analyzer",
6
+ "@semantic-release/release-notes-generator",
7
+ [
8
+ "@semantic-release/changelog",
9
+ {
10
+ changelogFile: "CHANGELOG.md",
11
+ },
12
+ ],
13
+ "@semantic-release/npm",
14
+ "@semantic-release/github",
15
+ [
16
+ "@semantic-release/git",
17
+ {
18
+ assets: ["CHANGELOG.md", "package.json"],
19
+ },
20
+ ],
21
+ ],
22
+ };
package/src/index.js ADDED
@@ -0,0 +1,131 @@
1
+ const { Client } = require('acme-client');
2
+ const fs = require('fs');
3
+
4
+ const email = 'mailto:ssl@cocreate.app';
5
+ const keyPath = 'certificates/';
6
+ let client
7
+
8
+ async function init() {
9
+ if (!fs.existsSync(keyPath)) {
10
+ fs.mkdirSync(keyPath, { recursive: true }); // Create the directory if it doesn't exist
11
+ }
12
+
13
+ const accountKeyPath = keyPath + 'account.pem';
14
+
15
+ let accountKey;
16
+ let isNewAccount = false; // Flag to check if the account is new
17
+
18
+ // Check if the account key exists and load it; otherwise, create a new one
19
+ if (!fs.existsSync(accountKeyPath)) {
20
+ accountKey = await Client.forge.createPrivateKey();
21
+ fs.writeFileSync(accountKeyPath, accountKey); // Store the account key
22
+ fs.chmodSync(accountKeyPath, '400')
23
+
24
+ isNewAccount = true; // New account, so will need to register it
25
+ } else {
26
+ // Load the existing account key
27
+ accountKey = fs.readFileSync(accountKeyPath, 'utf8');
28
+ }
29
+
30
+ // Initialize the ACME client with the account key
31
+ client = new Client({
32
+ directoryUrl: Client.directory.letsencrypt.staging,
33
+ accountKey: accountKey
34
+ });
35
+
36
+ // Register the new account if it was just created
37
+ if (isNewAccount) {
38
+ await client.createAccount({
39
+ termsOfServiceAgreed: true,
40
+ contact: [email]
41
+ });
42
+ }
43
+ }
44
+
45
+ async function requestCertificate(host, wildcard = false) {
46
+ /* Place your domain(s) here */
47
+ const domains = wildcard ? [host, `*.${host}`] : [host, `www.${host}`];
48
+
49
+ /* Create certificate request */
50
+ const [key, csr] = await Client.forge.createCsr({
51
+ commonName: domains[0],
52
+ altNames: domains
53
+ });
54
+
55
+ /* Request certificate */
56
+ const cert = await client.auto({
57
+ csr,
58
+ email, // Replace with your email
59
+ termsOfServiceAgreed: true,
60
+ challengeCreateFn: async (authz, challenge, keyAuthorization) => {
61
+ /* Log the URL and content for the HTTP-01 challenge */
62
+ if (challenge.type === 'http-01') {
63
+ const challengeUrl = `http://${authz.identifier.value}/.well-known/acme-challenge/${challenge.token}`;
64
+ const keyAuth = keyAuthorization;
65
+
66
+
67
+ console.log('Please create a file accessible on:');
68
+ console.log(challengeUrl);
69
+ console.log('With the content:');
70
+ console.log(keyAuth);
71
+
72
+ let file = {
73
+ "content-type": "text/plain",
74
+ "directory": "acme-challenge",
75
+ "host": [
76
+ authz.identifier.value
77
+ ],
78
+ "name": challenge.token,
79
+ "organization_id": "652c8d62679eca03e0b116a7",
80
+ "path": "/.well-known/acme-challenge/",
81
+ "pathname": `/.well-known/acme-challenge/${challenge.token}`,
82
+ "public": "true",
83
+ "src": keyAuth
84
+ }
85
+ } else if (challenge.type === 'dns-01') {
86
+ // Calculate the DNS TXT record value
87
+ const dnsRecordName = `_acme-challenge.${authz.identifier.value}`;
88
+ const dnsRecordValue = await client.getChallengeKeyAuthorization(challenge);
89
+
90
+ console.log(`Add this TXT record to your DNS:`);
91
+ console.log(`Name: ${dnsRecordName}`);
92
+ console.log(`Value: ${dnsRecordValue}`);
93
+
94
+ // Here, implement the logic to add the TXT record to your DNS
95
+ // await updateDnsTxtRecord(dnsRecordName, dnsRecordValue); // Hypothetical function to update DNS
96
+ }
97
+
98
+ },
99
+ challengeRemoveFn: async (authz, challenge, keyAuthorization) => {
100
+ /* Clean up challenge response here if necessary */
101
+ console.log(`Challenge removed for token: ${challenge.token}`);
102
+ if (challenge.type === 'http-01') {
103
+ /* Clean up challenge response here if necessary */
104
+ } else if (challenge.type === 'dns-01') {
105
+ // await removeDnsTxtRecord(challenge); // A hypothetical function to clean up DNS
106
+ }
107
+
108
+ }
109
+ });
110
+
111
+ /* Save the certificate and key */
112
+ fs.writeFileSync(keyPath + 'certificate.pem', cert);
113
+ fs.chmodSync(keyPath + 'certificate.pem', '444')
114
+
115
+ fs.writeFileSync(keyPath + 'private-key.pem', key);
116
+ fs.chmodSync(keyPath + 'certificate.pem', '400')
117
+
118
+ console.log('Successfully created certificate!');
119
+ }
120
+
121
+
122
+ init().catch(err => {
123
+ console.error('Error initializing ACME client:', err);
124
+ // TODO: Handle initialization error (possibly retry or exit)
125
+ });
126
+
127
+ module.exports = { requestCertificate }
128
+
129
+ // requestCertificate(host).catch(err => {
130
+ // console.error('Error creating certificate:', err);
131
+ // });