Skip to content

Commit 64be923

Browse files
committed
feat: Initial Release
This is a configurable headless file uploader that utilizes HTML5 attributes for easy customization. With this module, users can easily upload files to a server without requiring a formal UI or browser interaction. By leveraging HTML5 attributes, it's easy to customize and fine-tune the behavior of the uploader to fit specific needs. This uploader is perfect for developers looking to implement file uploads in a headless environment.
0 parents  commit 64be923

File tree

16 files changed

+1590
-0
lines changed

16 files changed

+1590
-0
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: CoCreate-app

.github/workflows/automated.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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/[email protected]
18+
with:
19+
direction: overwrite-github
20+
githubToken: "${{ secrets.GITHUB }}"
21+
22+
release:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
- name: setup nodejs
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 14
31+
- name: Semantic Release
32+
uses: cycjimmy/semantic-release-action@v3
33+
id: semantic
34+
with:
35+
extra_plugins: |
36+
@semantic-release/changelog
37+
@semantic-release/git
38+
@semantic-release/github
39+
env:
40+
GITHUB_TOKEN: "${{ secrets.GITHUB }}"
41+
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
42+
outputs:
43+
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
44+
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
45+
cdn:
46+
runs-on: ubuntu-latest
47+
needs: release
48+
if: needs.release.outputs.new_release_published == 'true'
49+
env:
50+
VERSION: "${{ needs.release.outputs.new_release_version }}"
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v3
54+
- name: setup nodejs
55+
uses: actions/setup-node@v3
56+
with:
57+
node-version: 16
58+
- name: yarn install
59+
run: >
60+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
61+
.npmrc
62+
63+
yarn install
64+
- name: yarn build
65+
run: yarn build
66+
- name: upload bundle as version
67+
uses: CoCreate-app/CoCreate-s3@master
68+
with:
69+
aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
70+
aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
71+
bucket: testcrudbucket
72+
source: ./dist
73+
destination: "/file/${{env.VERSION}}"
74+
acl: public-read
75+
- name: upload bundle as latest
76+
uses: CoCreate-app/CoCreate-s3@master
77+
with:
78+
aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
79+
aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
80+
bucket: testcrudbucket
81+
source: ./dist
82+
destination: /file/latest
83+
acl: public-read
84+
invalidations: true
85+
docs:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v3
90+
- name: setup nodejs
91+
uses: actions/setup-node@v3
92+
with:
93+
node-version: 16
94+
- name: update documentation
95+
uses: CoCreate-app/CoCreate-docs@master
96+
env:
97+
organization_id: ${{ secrets.COCREATE_ORGANIZATION_ID }}
98+
key: ${{ secrets.COCREATE_KEY }}
99+
host: ${{ secrets.COCREATE_HOST }}
100+

.github/workflows/manual.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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: /file/latest
43+
acl: public-read
44+
invalidations: ${{ github.event.inputs.invalidations }}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ignore
2+
node_modules
3+
dist
4+
package-lock.json
5+
yarn.lock
6+
pnpm-lock.yaml
7+
8+
logs
9+
*.log
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
.pnpm-debug.log*

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Contributing to CoCreate-file
2+
3+
This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-file/graphs/contributors).
4+
You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-file/pulls),
5+
[propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-file/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-file) and check out your copy.
12+
13+
```
14+
git clone https://github.com/contributor/CoCreate-file.git
15+
cd CoCreate-file
16+
git remote add upstream https://github.com/CoCreate-app/CoCreate-file.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 "[email protected]"
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-file](https://github.com/CoCreate-app/CoCreate-file) 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.

CoCreate.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
"config": {
3+
"organization_id": "",
4+
"key": "",
5+
"host": ""
6+
},
7+
"sources": [
8+
{
9+
"collection": "files",
10+
"document": {
11+
"_id": "61a12db2a8b6b4001a9f5a2e",
12+
"name": "index.html",
13+
"path": "/docs/file/index.html",
14+
"src": "{{./docs/index.html}}",
15+
"hosts": [
16+
"*",
17+
"general.cocreate.app"
18+
],
19+
"directory": "/docs/file",
20+
"parentDirectory": "{{parentDirectory}}",
21+
"content-type": "{{content-type}}",
22+
"public": "true",
23+
"website_id": "644d4bff8036fb9d1d1fd69c"
24+
}
25+
}
26+
]
27+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

0 commit comments

Comments
 (0)