Skip to content

Commit 2f4d391

Browse files
authored
Merge pull request #1 from blwatkins/main
Contribute initial template files
2 parents bfdfbb7 + 49af655 commit 2f4d391

16 files changed

+6689
-1
lines changed

.github/dependabot.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm"
9+
directory: "/"
10+
schedule:
11+
interval: monthly
12+
target-branch: "main"
13+
allow:
14+
- dependency-type: "direct"
15+
versioning-strategy: increase
16+
commit-message:
17+
prefix: "dependabot npm update"
18+
include: "scope"
19+
groups:
20+
development-dependencies:
21+
applies-to: version-updates
22+
dependency-type: "development"
23+
update-types:
24+
- "major"
25+
- "minor"
26+
- "patch"
27+
development-dependencies-security:
28+
applies-to: security-updates
29+
dependency-type: "development"
30+
update-types:
31+
- "major"
32+
- "minor"
33+
- "patch"
34+
production-dependencies:
35+
applies-to: version-updates
36+
dependency-type: "production"
37+
update-types:
38+
- "major"
39+
- "minor"
40+
- "patch"
41+
production-dependencies-security:
42+
applies-to: security-updates
43+
dependency-type: "production"
44+
update-types:
45+
- "major"
46+
- "minor"
47+
- "patch"
48+
49+
- package-ecosystem: github-actions
50+
directory: "/"
51+
schedule:
52+
interval: monthly
53+
target-branch: "development-main"
54+
commit-message:
55+
prefix: "dependabot github-action update"
56+
include: "scope"

.github/workflows/codeql.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
7+
name: "CodeQL"
8+
9+
on:
10+
push:
11+
branches:
12+
- "main"
13+
pull_request:
14+
branches:
15+
- "main"
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
# Runner size impacts CodeQL analysis time. To learn more, please see:
21+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
22+
# - https://gh.io/supported-runners-and-hardware-resources
23+
# - https://gh.io/using-larger-runners
24+
# Consider using larger runners for possible analysis time improvements.
25+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
26+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript-typescript' ]
36+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
37+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
38+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v3
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55+
# queries: security-extended,security-and-quality
56+
57+
58+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
59+
# If this step fails, then you should remove it and run the build manually (see below)
60+
- name: Autobuild
61+
uses: github/codeql-action/autobuild@v3
62+
63+
# ℹ️ Command-line programs to run using the OS shell.
64+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65+
66+
# If the Autobuild fails above, remove it and uncomment the following three lines.
67+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68+
69+
# - run: |
70+
# echo "Run, Build Application using script"
71+
# ./location_of_script_within_repo/buildscript.sh
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v3
75+
with:
76+
category: "/language:${{matrix.language}}"

.github/workflows/node-js.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: "Node.js Build"
5+
6+
on:
7+
push:
8+
branches:
9+
- "main"
10+
pull_request:
11+
branches:
12+
- "main"
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
node-version: [ 18.x, 20.x, 22.x ]
22+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: 'npm'
31+
- run: npm ci
32+
- run: npm run lint
33+
- run: npm run build
34+
- run: npm run prod

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.DS_Store
2+
3+
# WebStorm
4+
.idea/
5+
6+
# npm
7+
node_modules/
8+
9+
# Webpack
10+
out/
11+
dist/

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
11
# p5-typescript-template
2-
A template project for using p5.js with TypeScript and Webpack.
2+
3+
A template project for using
4+
[p5.js](https://p5js.org/)
5+
with
6+
[TypeScript](https://www.typescriptlang.org/)
7+
and
8+
[Webpack](https://webpack.js.org/).
9+
10+
# GitHub Workflows
11+
12+
This template contains GitHub workflows designed to update project dependencies monthly.
13+
To learn more about dependabot configurations, visit the
14+
[GitHub Dependabot documentation](https://docs.github.com/en/code-security/dependabot).
15+
16+
# Attributions
17+
18+
The favicon.ico of this template was designed by
19+
[Freepik from Flaticon](https://www.flaticon.com/free-icons/art).
20+
You can find the original icon on
21+
[flaticon.com](https://www.flaticon.com/free-icon/art_1756752?term=art&page=1&position=38&origin=search&related_id=1756752).
22+
23+
# LICENSE
24+
25+
The source code of this project is licensed under the
26+
[GNU Affero General Public Version 3.0 License](https://www.gnu.org/licenses/agpl-3.0.en.html).
27+
The full text of the license is included with this source code.

assets/icon/favicon.ico

15 KB
Binary file not shown.

assets/icon/flaticon-license.pdf

34.9 KB
Binary file not shown.

assets/icon/original-icon.png

36.2 KB
Loading

assets/style/sketch.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (C) 2024 brittni and the polar bear LLC.
3+
*
4+
* This file is a part of brittni and the polar bear's p5.js TypeScript template,
5+
* which is released under the GNU Affero General Public License, Version 3.0.
6+
* You may not use this file except in compliance with the license.
7+
*
8+
* You should have received a copy of the GNU Affero General Public License
9+
* along with this program. See LICENSE or go to
10+
* https://www.gnu.org/licenses/agpl-3.0.en.html for full license details.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15+
* See the GNU Affero General Public License for more details.
16+
*/
17+
18+
html, body {
19+
margin: 0;
20+
padding: 0;
21+
border: none;
22+
}
23+
24+
body {
25+
width: 100vw;
26+
height: 100vh;
27+
}
28+
29+
main {
30+
display: grid;
31+
justify-content: center;
32+
align-items: center;
33+
width: 100%;
34+
height: 100%;
35+
}
36+
37+
canvas {
38+
grid-row: 1;
39+
grid-column: 1;
40+
}

eslint.config.mjs

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright (C) 2024 brittni and the polar bear LLC.
3+
*
4+
* This file is a part of brittni and the polar bear's p5.js TypeScript template,
5+
* which is released under the GNU Affero General Public License, Version 3.0.
6+
* You may not use this file except in compliance with the license.
7+
*
8+
* You should have received a copy of the GNU Affero General Public License
9+
* along with this program. See LICENSE or go to
10+
* https://www.gnu.org/licenses/agpl-3.0.en.html for full license details.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15+
* See the GNU Affero General Public License for more details.
16+
*/
17+
18+
import eslint from '@eslint/js';
19+
20+
import stylistic from '@stylistic/eslint-plugin'
21+
22+
import tsEslint from 'typescript-eslint';
23+
24+
export default tsEslint.config(
25+
eslint.configs.recommended,
26+
stylistic.configs['recommended-flat'],
27+
...tsEslint.configs.recommendedTypeChecked,
28+
...tsEslint.configs.strictTypeChecked,
29+
...tsEslint.configs.stylisticTypeChecked,
30+
{
31+
languageOptions: {
32+
parserOptions: {
33+
projectService: true,
34+
tsconfigRootDir: import.meta.dirname,
35+
},
36+
},
37+
rules: {
38+
/* @stylistic/eslint-plugin */
39+
40+
'@stylistic/brace-style': ['error', '1tbs'],
41+
42+
'@stylistic/no-extra-semi': 'error',
43+
44+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
45+
46+
'@stylistic/function-call-spacing': ['error', 'never'],
47+
48+
'@stylistic/comma-dangle': ['error', 'never'],
49+
50+
'@stylistic/indent': ['error',
51+
4,
52+
{
53+
SwitchCase: 1,
54+
FunctionDeclaration: {
55+
parameters: 'first'
56+
},
57+
FunctionExpression: {
58+
parameters: 'first'
59+
}
60+
}
61+
],
62+
63+
'@stylistic/indent-binary-ops': 'off',
64+
65+
'@stylistic/member-delimiter-style': ['error', {
66+
multiline: {
67+
delimiter: 'semi',
68+
requireLast: true
69+
},
70+
singleline: {
71+
delimiter: 'semi',
72+
requireLast: true
73+
}
74+
}],
75+
76+
'@stylistic/operator-linebreak': ['error', 'after'],
77+
78+
'@stylistic/quotes': ['error',
79+
'single',
80+
{
81+
avoidEscape: true,
82+
allowTemplateLiterals: true
83+
}
84+
],
85+
86+
'@stylistic/semi': ['error', 'always']
87+
}
88+
}
89+
);

0 commit comments

Comments
 (0)