Skip to content

Commit ad2bcb6

Browse files
authored
Merge pull request #1 from processing/develop
Sync forked repo
2 parents 45a4e54 + f373938 commit ad2bcb6

File tree

310 files changed

+32793
-14961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+32793
-14961
lines changed

.env.example

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ EXAMPLE_USER_PASSWORD=hellop5js
1010
GG_EXAMPLES_USERNAME=generativedesign
1111
GG_EXAMPLES_EMAIL=[email protected]
1212
GG_EXAMPLES_PASS=generativedesign
13-
ML5_EXAMPLES_USERNAME=ml5
14-
ML5_EXAMPLES_EMAIL=[email protected]
15-
ML5_EXAMPLES_PASS=helloml5
1613
GITHUB_ID=<your-github-client-id>
1714
GITHUB_SECRET=<your-github-client-secret>
1815
GOOGLE_ID=<your-google-client-id> (use google+ api)
1916
GOOGLE_SECRET=<your-google-client-secret> (use google+ api)
2017
MAILGUN_DOMAIN=<your-mailgun-domain>
2118
MAILGUN_KEY=<your-mailgun-api-key>
19+
ML5_LIBRARY_USERNAME=ml5
20+
ML5_LIBRARY_EMAIL=[email protected]
21+
ML5_LIBRARY_PASS=helloml5
22+
MOBILE_ENABLED=true
2223
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
2324
PORT=8000
25+
PREVIEW_PORT=8002
26+
EDITOR_URL=http://localhost:8000
27+
PREVIEW_URL=http://localhost:8002
2428
S3_BUCKET=<your-s3-bucket>
2529
S3_BUCKET_URL_BASE=<alt-for-s3-url>
2630
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
31+
TRANSLATIONS_ENABLED=true
2732
UI_ACCESS_TOKEN_ENABLED=false
2833
UPLOAD_LIMIT=250000000
29-
MOBILE_ENABLED=true

.eslintrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "airbnb",
2+
"extends": ["airbnb", "prettier"],
33
"parser": "babel-eslint",
44
"env": {
55
"browser": true,
@@ -16,12 +16,12 @@
1616
"import/no-unresolved": 0,
1717
"import/no-named-as-default": 2,
1818
"comma-dangle": 0, // not sure why airbnb turned this on. gross!
19-
"indent": [2, 2, {"SwitchCase": 1}],
19+
"indent": 0,
2020
"no-console": 0,
2121
"no-alert": 0,
2222
"no-underscore-dangle": 0,
2323
"max-len": [1, 120, 2, {"ignoreComments": true, "ignoreTemplateLiterals": true}],
24-
"quote-props": [1, "consistent-as-needed"],
24+
"quote-props": [1, "as-needed"],
2525
"no-unused-vars": [1, {"vars": "local", "args": "none"}],
2626
"consistent-return": ["error", { "treatUndefinedAsUnspecified": true }],
2727
"no-param-reassign": [2, { "props": false }],
@@ -60,10 +60,13 @@
6060
},
6161
"allowChildren": false
6262
}
63+
],
64+
"prettier/prettier": [
65+
"error"
6366
]
6467
},
6568
"plugins": [
66-
"react", "jsx-a11y", "import"
69+
"react", "jsx-a11y", "import", "prettier"
6770
],
6871
"settings": {
6972
"import/parser": "babel-eslint",

.github/CODE_OF_CONDUCT.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,51 @@
1-
# p5.js Code of Conduct
1+
## [p5.js community statement](http://p5js.org/community/)
2+
3+
p5.js is a community interested in exploring the creation of art and design with technology.
4+
5+
We are a community of, and in solidarity with, people from every gender identity and expression, sexual orientation, race, ethnicity, language, neuro-type, size, disability, class, religion, culture, subculture, political opinion, age, skill level, occupation, and background. We acknowledge that not everyone has the time, financial means, or capacity to actively participate, but we recognize and encourage involvement of all kinds. We facilitate and foster access and empowerment. We are all learners.
6+
7+
We like these hashtags: #noCodeSnobs (because we value community over efficiency), #newKidLove (because we all started somewhere), #unassumeCore (because we don't assume knowledge), and #BlackLivesMatter (because of course).
8+
9+
In practice:
10+
* We are not code snobs. We do not assume knowledge or imply there are things that somebody should know.
11+
* We insist on actively engaging with requests for feedback regardless of their complexity.
12+
* We welcome newcomers and prioritize the education of others. We strive to approach all tasks with the enthusiasm of a newcomer. Because we believe that newcomers are just as valuable in this effort as experts.
13+
* We consistently make the effort to actively recognize and validate multiple types of contributions.
14+
* We are always willing to offer help or guidance.
15+
16+
In times of conflict:
17+
* We listen.
18+
* We clearly communicate while acknowledging other's feelings.
19+
* We admit when we're wrong, apologize, and accept responsibility for our actions.
20+
* We are continuously seeking to improve ourselves and our community.
21+
* We keep our community respectful and open.
22+
* We make everyone feel heard.
23+
* We are mindful and kind in our interactions.
24+
25+
In the future:
26+
* The future is now.
27+
28+
29+
## p5.js Code of Conduct
230

331
* **Be mindful of your language.** Any of the following behavior is unacceptable:
432
* Offensive comments related to gender identity and expression, sexual orientation, race, ethnicity, language, neuro-type, size, ability, class, religion, culture, subculture, political opinion, age, skill level, occupation, or background
533
* Threats of violence
634
* Deliberate intimidation
7-
* Sexually explicit or violent material
35+
* Sexually explicit or violent material that is not contextualized and preceded by a considerate warning
836
* Unwelcome sexual attention
937
* Stalking or following
1038
* Or any other kinds of harassment
1139

1240
Use your best judgement. If it will possibly make others uncomfortable, do not post it.
1341

14-
* **Be respectful.** Disagreement is not an opportunity to attack someone else's thoughts or opinions. Although views may differ, remember to approach every situation with patience and care.
15-
* **Be considerate.** Think about how your contribution will affect others in the community.
42+
* **Be respectful.** Disagreement is not an opportunity to attack someone else's thoughts or opinions. Although views may differ, remember to approach every situation with patience and care.
43+
* **Be considerate.** Think about how your contribution will affect others in the community.
1644
* **Be open minded.** Embrace new people and new ideas. Our community is continually evolving and we welcome positive change.
1745

1846
If you believe someone is violating the code of conduct, we ask that you report it by emailing [[email protected]](mailto:[email protected]). Please include your name and a description of the incident, and we will get back to you ASAP.
1947

20-
Participants asked to stop any harassing behavior are expected to comply immediately. If a participant engages in harassing behavior, the p5.js Team may take any action they deem appropriate, up to and including expulsion from all p5.js spaces and identification of the participant as a harasser to other p5.js members or the general public.
21-
22-
## Also
48+
Sometimes, participants violating the Code of Conduct are unaware that their behavior is harmful, and an open conversation clears things up to move forward. However, if a participant continues with the behavior, the p5.js team may take any action they deem appropriate, up to and including expulsion from all p5.js spaces and identification of the participant as a harasser to other p5.js members or the general public.
2349

24-
* You can read our [community statement](http://p5js.org/community/) on our website.
50+
---
51+
This statement is licensed under a [Creative Commons license](https://creativecommons.org/licenses/by-sa/4.0/). Please feel free to share and remix with attribution.

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Hello! We welcome community contributions to the p5.js Web Editor. Contributing
1818

1919
## Code of Conduct
2020

21-
Please follow the guidelines in the [Code of Conduct](https://github.com/processing/p5.js-web-editor/blob/master/.github/CODE_OF_CONDUCT.md).
21+
Please follow the guidelines in the [Code of Conduct](https://github.com/processing/p5.js-web-editor/blob/develop/.github/CODE_OF_CONDUCT.md).
2222

2323
## How Can I Contribute?
2424
If you're new to open source, [read about how to contribute to open source](https://opensource.guide/how-to-contribute/).
@@ -60,7 +60,7 @@ If you feel like an issue is tagged incorrectly (e.g. it's low priority and you
6060

6161
If you'd like to work on an issue, please comment on it to let the maintainers know, so that they can assign it to you. If someone else has already commented and taken up that issue, please refrain from working on it and submitting a PR without asking the maintainers as it leads to unnecessary duplication of effort.
6262

63-
Then, look at the [development guide](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/development.md) for instructions on how to install the project locally and follow the right development workflow.
63+
Then, look at the [development guide](https://github.com/processing/p5.js-web-editor/blob/develop/developer_docs/development.md) for instructions on how to install the project locally and follow the right development workflow.
6464

6565
### Contribution Guides
6666

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Fixes #issue-number
33
I have verified that this pull request:
44

55
* [ ] has no linting errors (`npm run lint`)
6-
* [ ] is from a uniquely-named feature branch and has been rebased on top of the latest master. (If I was asked to make more changes, I have made sure to rebase onto master then too)
7-
* [ ] is descriptively named and links to an issue number, i.e. `Fixes #123`
6+
* [ ] is from a uniquely-named feature branch and has been rebased on top of the latest `develop` branch. (If I was asked to make more changes, I have made sure to rebase onto `develop` then too)
7+
* [ ] is descriptively named and links to an issue number, i.e. `Fixes #123`

.github/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ newIssueWelcomeComment: >
1010

1111
# Comment to be posted to on PRs from first time contributors in your repository
1212
newPRWelcomeComment: >
13-
🎉 Thanks for opening this pull request! Please check out our [contributing guidelines](https://github.com/processing/p5.js-web-editor/blob/master/.github/CONTRIBUTING.md) if you haven't already.
13+
🎉 Thanks for opening this pull request! Please check out our [contributing guidelines](https://github.com/processing/p5.js-web-editor/blob/develop/.github/CONTRIBUTING.md) if you haven't already.
1414
1515
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
1616

17-
# Comment to be posted to on pull requests merged by a first time user
17+
# Comment to be posted to on pull requests merged by a first time user

.github/workflows/deploy-staging.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy to staging
2+
on:
3+
workflow_run:
4+
workflows: ["Test"]
5+
branches:
6+
- develop
7+
types:
8+
- completed
9+
env:
10+
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
11+
GKE_CLUSTER: p5js-web-editor-cluster
12+
GKE_ZONE: us-east1-c
13+
DEPLOYMENT_NAME: web-editor-node
14+
IMAGE: ${{ secrets.DOCKER_USERNAME }}/p5.js-web-editor-staging
15+
jobs:
16+
push_to_registry:
17+
environment: staging
18+
name: Push Docker image to Docker Hub
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out the repo
22+
uses: actions/checkout@v2
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v1
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
30+
- name: Build and push to Docker Hub
31+
uses: docker/build-push-action@v2
32+
with:
33+
context: .
34+
file: ./Dockerfile
35+
pull: true
36+
push: true
37+
tags: |
38+
${{ env.IMAGE }}:${{ github.sha }}
39+
${{ env.IMAGE }}:latest
40+
target: production
41+
# Setup gcloud CLI
42+
- uses: google-github-actions/[email protected]
43+
with:
44+
service_account_key: ${{ secrets.GKE_SA_KEY }}
45+
project_id: ${{ secrets.GKE_PROJECT }}
46+
47+
# Configure docker to use the gcloud command-line tool as a credential helper
48+
- run: |-
49+
gcloud --quiet auth configure-docker
50+
51+
# Get the GKE credentials so we can deploy to the cluster
52+
- uses: google-github-actions/[email protected]
53+
with:
54+
cluster_name: ${{ env.GKE_CLUSTER }}
55+
location: ${{ env.GKE_ZONE }}
56+
credentials: ${{ secrets.GKE_SA_KEY }}
57+
58+
# Deploy the Docker image to the GKE cluster
59+
- name: Deploy
60+
run: |-
61+
kubectl set image deployment/$DEPLOYMENT_NAME web-editor-app=index.docker.io/$IMAGE:$GITHUB_SHA --namespace=staging
62+
kubectl get services -o wide

.github/workflows/deploy.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy to production
2+
on:
3+
workflow_run:
4+
workflows: ["Test"]
5+
branches:
6+
- release
7+
types:
8+
- completed
9+
env:
10+
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
11+
GKE_CLUSTER: p5js-web-editor-cluster
12+
GKE_ZONE: us-east1-c
13+
DEPLOYMENT_NAME: web-editor-node
14+
IMAGE: ${{ secrets.DOCKER_USERNAME }}/p5.js-web-editor
15+
jobs:
16+
push_to_registry:
17+
environment: production
18+
name: Push Docker image to Docker Hub
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out the repo
22+
uses: actions/checkout@v2
23+
with:
24+
ref: release
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v1
27+
- name: Login to Docker Hub
28+
uses: docker/login-action@v1
29+
with:
30+
username: ${{ secrets.DOCKER_USERNAME }}
31+
password: ${{ secrets.DOCKER_PASSWORD }}
32+
- name: Build and push to Docker Hub
33+
uses: docker/build-push-action@v2
34+
with:
35+
context: .
36+
file: ./Dockerfile
37+
pull: true
38+
push: true
39+
tags: |
40+
${{ env.IMAGE }}:${{ github.sha }}
41+
${{ env.IMAGE }}:latest
42+
target: production
43+
# Setup gcloud CLI
44+
- uses: google-github-actions/[email protected]
45+
with:
46+
service_account_key: ${{ secrets.GKE_SA_KEY }}
47+
project_id: ${{ secrets.GKE_PROJECT }}
48+
49+
# Configure docker to use the gcloud command-line tool as a credential helper
50+
- run: |-
51+
gcloud --quiet auth configure-docker
52+
53+
# Get the GKE credentials so we can deploy to the cluster
54+
- uses: google-github-actions/[email protected]
55+
with:
56+
cluster_name: ${{ env.GKE_CLUSTER }}
57+
location: ${{ env.GKE_ZONE }}
58+
credentials: ${{ secrets.GKE_SA_KEY }}
59+
60+
# Deploy the Docker image to the GKE cluster
61+
- name: Deploy
62+
run: |-
63+
kubectl set image deployment/$DEPLOYMENT_NAME web-editor-app=index.docker.io/$IMAGE:$GITHUB_SHA
64+
kubectl get services -o wide
65+

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Test and lint code base
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Use Node.js
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: '12.x'
15+
- run: npm install
16+
- run: npm run test
17+
- run: npm run lint
18+
19+

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
node_modules/
77
npm-debug.log
88
dump.rdb
9-
public/*
109
static/dist/
1110
static/css/app.min.css
1211
dist/

.prettierrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"htmlWhitespaceSensitivity": "css",
5+
"insertPragma": false,
6+
"jsxBracketSameLine": false,
7+
"jsxSingleQuote": false,
8+
"parser": "babel",
9+
"printWidth": 80,
10+
"proseWrap": "never",
11+
"requirePragma": false,
12+
"semi": true,
13+
"singleQuote": true,
14+
"tabWidth": 2,
15+
"trailingComma": "none",
16+
"useTabs": false,
17+
"quoteProps": "as-needed",
18+
"endOfLine":"auto"
19+
}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ENV APP_HOME=/usr/src/app \
44
RUN mkdir -p $APP_HOME
55
WORKDIR $APP_HOME
66
EXPOSE 8000
7+
EXPOSE 8002
78

89
FROM base as development
910
ENV NODE_ENV development
@@ -15,6 +16,7 @@ COPY ./webpack ./webpack
1516
COPY client ./client
1617
COPY server ./server
1718
COPY translations/locales ./translations/locales
19+
COPY public ./public
1820
CMD ["npm", "start"]
1921

2022
FROM development as build

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Documentation is also available in the following languages:
55

6-
[한국어](https://github.com/processing/p5.js-web-editor/blob/master/translations/ko)
6+
[한국어](https://github.com/processing/p5.js-web-editor/blob/develop/translations/ko)
77

88
## Welcome! 👋👋🏿👋🏽👋🏻👋🏾👋🏼
99

@@ -23,15 +23,15 @@ All contributors to the p5.js Web Editor are expected to follow the [Code of Con
2323

2424
The p5.js Web Editor is a collaborative project created by many individuals, and you are invited to help. All types of involvement are welcome! Please check out the [contribution guide](./.github/CONTRIBUTING.md) for more details.
2525

26-
Developers, check the [developer docs](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/) details about contributing code, bug fixes, and documentation. To start writing code, a great place to start is the [development guide](https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/development.md).
26+
Developers, check the [developer docs](https://github.com/processing/p5.js-web-editor/blob/develop/developer_docs/) details about contributing code, bug fixes, and documentation. To start writing code, a great place to start is the [development guide](https://github.com/processing/p5.js-web-editor/blob/develop/developer_docs/development.md).
2727

2828
## Issues
2929

3030
If you have found a bug in the p5.js Web Editor, you can file it under the ["issues" tab](https://github.com/processing/p5.js-web-editor/issues).
3131

3232
Please post bugs and feature requests in the correct repository:
3333

34-
* p5.js library and p5.dom: [https://github.com/processing/p5.js/issues](https://github.com/processing/p5.js/issues)
34+
* p5.js library: [https://github.com/processing/p5.js/issues](https://github.com/processing/p5.js/issues)
3535
* p5.accessibility: [https://github.com/processing/p5.accessibility/issues](https://github.com/processing/p5.accessibility/issues)
3636
* p5.sound: [https://github.com/processing/p5.js-sound/issues](https://github.com/processing/p5.js-sound/issues)
3737
* p5.js website: [https://github.com/processing/p5.js-website/issues](https://github.com/processing/p5.js-website/issues)
File renamed without changes.

0 commit comments

Comments
 (0)