Skip to content

Commit 22b3ca2

Browse files
committed
update source config
1 parent 119f7f2 commit 22b3ca2

File tree

7 files changed

+43
-85
lines changed

7 files changed

+43
-85
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# These are supported funding model platforms
22

33
github: CoCreate-app
4-

.github/workflows/automation.yml

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- master
57
pull_request:
8+
branches:
9+
- master
610
create:
11+
branches:
12+
- master
713

814
jobs:
915
updateKeyword:
@@ -12,18 +18,18 @@ jobs:
1218
- name: Checkout
1319
uses: actions/checkout@v2
1420

15-
# overwrite description and keyworkds
1621
- name: Jaid/action-sync-node-meta
1722
uses: jaid/action-sync-node-meta@v1.4.0
1823
with:
1924
direction: overwrite-github # default is overwrite-file
2025
githubToken: ${{ secrets.GITHUB }}
26+
2127
ci:
2228
runs-on: ubuntu-latest
2329
steps:
2430
- name: Checkout
2531
uses: actions/checkout@v2
26-
# Auto Changog generator
32+
2733
- name: Semantic Release
2834
uses: cycjimmy/semantic-release-action@v2
2935
with:
@@ -36,45 +42,13 @@ jobs:
3642
env:
3743
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3844
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator
39-
40-
41-
4245

43-
cdn:
46+
docs:
4447
runs-on: ubuntu-latest
4548
steps:
4649
- name: Checkout
4750
uses: actions/checkout@v2
48-
49-
- run: yarn install --frozen-lockfile
50-
- run: yarn build
51-
52-
- uses: CoCreate-app/CoCreate-s3@master
53-
with:
54-
aws-key-id: ${{ secrets.AWSACCESSKEYID }}
55-
aws-access-key: ${{ secrets.AWSSECERTACCESSKEY }}
56-
source: './dist/CoCreate-docs.min.js'
57-
58-
5951

6052
- name: update documentation
61-
run: npm run docs
62-
63-
64-
65-
# - name: setup nodejs
66-
# uses: actions/setup-node@v2
67-
# with:
68-
# node-version: 'v14.15.4'
69-
# debuging action
70-
# - name: Setup tmate session
71-
# uses: mxschmitt/action-tmate@v3
72-
# - name: build production version
73-
74-
75-
# - name: upload to s3
76-
# run: npm run s3
77-
# env:
78-
# AWSKEYID: ${{ secrets.AWSKEYID }}
79-
# AWSACCESSKEY: ${{ secrets.AWSACCESSKEY }}
80-
# DIST_FILE_NAME: './dist/CoCreate-styles.min.js'
53+
uses: CoCreate-app/CoCreate-docs@master
54+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# ignore
2+
node_modules

CONTRIBUTING.md

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,24 @@ In the examples below, substitute your Github username for `contributor` in URLs
1111
Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-docs) and check out your copy.
1212

1313
```
14-
git clone https://github.com/contributor/CoCreate-docs.git
14+
git docs https://github.com/contributor/CoCreate-docs.git
1515
cd CoCreate-docs
1616
git remote add upstream https://github.com/CoCreate-app/CoCreate-docs.git
1717
```
1818

1919
## Create a Topic Branch
2020

21-
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
21+
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix on dev branch.
2222

2323
```
24-
git checkout master
25-
git pull upstream master
24+
git checkout dev
25+
git pull upstream dev
2626
git checkout -b my-feature-branch
2727
```
2828

2929
## Write Tests
3030

3131
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).
3332

3433
We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
3534

@@ -41,11 +40,6 @@ Implement your feature or bug fix.
4140

4241
Document any external behavior in the [README](README.md).
4342

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-
4943
## Commit Changes
5044

5145
Make sure git knows your name and email address:
@@ -55,13 +49,24 @@ git config --global user.name "Your Name"
5549
git config --global user.email "contributor@example.com"
5650
```
5751

58-
Writing good commit logs is important. A commit log should describe what changed and why.
52+
We use [semantic-release](https://github.com/semantic-release/semantic-release) as process to generate changelog
53+
and to release. Write meaningful commits according to
54+
[Commit Message Formats](https://github.com/semantic-release/semantic-release#commit-message-format) is important.
5955

6056
```
6157
git add ...
62-
git commit
58+
git commit -am "commit-type(optional topic): a meaningful message"
6359
```
6460

61+
Here is an example of the release type that should be done based on a [semantic-release](https://github.com/semantic-release/semantic-release):
62+
63+
| Commit message | Release type |
64+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
65+
| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
66+
| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
67+
| `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |
68+
69+
6570
## Push
6671

6772
```
@@ -75,36 +80,17 @@ Click the 'Pull Request' button and fill out the form. Pull requests are usually
7580

7681
## Rebase
7782

78-
If you've been working on a change for a while, rebase with upstream/master.
83+
If you've been working on a change for a while, rebase with upstream/dev.
7984

8085
```
8186
git fetch upstream
82-
git rebase upstream/master
87+
git rebase upstream/dev
8388
git push origin my-feature-branch -f
8489
```
8590

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-
10591
## Be Patient
10692

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!
93+
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 in there!
10894

10995
## Thank You
11096

CoCreate.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module.exports = {
1111
path: "./test_files/test.html",
1212
collection: "static_html",
1313
document_id: "5f08bf3da588c11bf8ead4b3",
14+
key: "html",
1415
data:{
15-
name: "html",
1616
description:"test descrition"
1717
}
1818
},
@@ -23,8 +23,6 @@ module.exports = {
2323
collection: "test",
2424
document_id: "6010e012f80ce138be7eed01",
2525
data:{
26-
// collection: "test",
27-
// document_id: "",
2826
domains: ["cocreate.app"],
2927
route: "/docs/boilerplate",
3028
}

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
# CoCreate-docs
2-
Document generator. Easy configuration using data-attributes and highly styleable.
3-
2+
A simple docs component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/docs)
43

54
![GitHub file size in bytes](https://img.shields.io/github/size/CoCreate-app/CoCreate-docs/dist/CoCreate-docs.min.js?label=minified%20size&style=for-the-badge)
6-
![GitHub package.json version](https://img.shields.io/github/package-json/v/CoCreate-app/CoCreate-docs?style=for-the-badge)
5+
![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-docs?style=for-the-badge)
76
![GitHub](https://img.shields.io/github/license/CoCreate-app/CoCreate-docs?style=for-the-badge)
87
![GitHub labels](https://img.shields.io/github/labels/CoCreate-app/CoCreate-docs/help%20wanted?style=for-the-badge)
98

10-
119
![CoCreate](https://cdn.cocreate.app/logo.png)
1210

13-
[CoCreate Docs](https://cocreate.app/documentation/CoCreate-docs)
11+
[CoCreate Docs](https://cocreate.app/docs/docs)
1412

1513

1614
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/Realtime_Admin_CRM_and_CMS/issues) and [pull requests](https://github.com/CoCreate-app/Realtime_Admin_CRM_and_CMS/pulls) or merely upvote or comment on existing issues or pull requests.
@@ -53,3 +51,4 @@ We encourage contribution to our libraries (you might even score some nifty swag
5351

5452
# License
5553
[The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-docs/blob/master/LICENSE)
54+

src/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,17 @@ if (crud) {
6969
* Store html files by config sources
7070
**/
7171
if (sources) {
72-
sources.forEach(({path, collection, document_id, data}) => {
72+
sources.forEach(({path, collection, document_id, key, data}) => {
7373
if (!path) return;
7474

7575
let content = fs.readFileSync(path, 'utf8');
76-
const {name, ...rest} = data;
7776

78-
if (content && name && collection) {
77+
if (content && key && collection) {
78+
if (!data) data = {};
79+
7980
let storeData = {
80-
[name]: content,
81-
...rest
81+
[key]: content,
82+
...data
8283
};
8384
if (!document_id) {
8485
CoCreateCreateDocument({

0 commit comments

Comments
 (0)