Skip to content

Commit 232e5e7

Browse files
author
Lea Rosema
committed
chore: initial commit
0 parents  commit 232e5e7

11 files changed

+272
-0
lines changed

Diff for: .gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Thumbs.db
2+
.DS_Store
3+
4+
node_modules
5+
*.log
6+
npm-debug.*
7+
8+
dist

Diff for: .prettierrc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
singleQuote: true

Diff for: .travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- '12'
4+
os: linux
5+
dist: xenial
6+
install:
7+
- npm i

Diff for: CODE_OF_CONDUCT.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* Deliberate use of rejected pronouns and/or dead or rejected names
26+
* The use of sexualized language or imagery and unwelcome sexual attention or
27+
advances
28+
* Trolling, insulting/derogatory comments, and personal or political attacks
29+
* Public or private harassment
30+
* Publishing others' private information, such as a physical or electronic
31+
address, without explicit permission
32+
* Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Our Responsibilities
36+
37+
Project maintainers are responsible for clarifying the standards of acceptable
38+
behavior and are expected to take appropriate and fair corrective action in
39+
response to any instances of unacceptable behavior.
40+
41+
Project maintainers have the right and responsibility to remove, edit, or
42+
reject comments, commits, code, wiki edits, issues, and other contributions
43+
that are not aligned to this Code of Conduct, or to ban temporarily or
44+
permanently any contributor for other behaviors that they deem inappropriate,
45+
threatening, offensive, or harmful.
46+
47+
## Scope
48+
49+
This Code of Conduct applies both within project spaces and in public spaces
50+
when an individual is representing the project or its community. Examples of
51+
representing a project or community include using an official project e-mail
52+
address, posting via an official social media account, or acting as an appointed
53+
representative at an online or offline event. Representation of a project may be
54+
further defined and clarified by project maintainers.
55+
56+
## Enforcement
57+
58+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
59+
reported by contacting the project team at [email protected]. All
60+
complaints will be reviewed and investigated and will result in a response that
61+
is deemed necessary and appropriate to the circumstances. The project team is
62+
obligated to maintain confidentiality with regard to the reporter of an incident.
63+
Further details of specific enforcement policies may be posted separately.
64+
65+
Project maintainers who do not follow or enforce the Code of Conduct in good
66+
faith may face temporary or permanent repercussions as determined by other
67+
members of the project's leadership.
68+
69+
## Attribution
70+
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
72+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
73+
74+
[homepage]: https://www.contributor-covenant.org
75+
76+
For answers to common questions about this code of conduct, see
77+
https://www.contributor-covenant.org/faq

Diff for: CONTRIBUTING.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing.
4+
5+
Currently, this is a one-woman project and there are no strict coding conventions yet.
6+
7+
The only prerequisite is to don't be an asshole and follow the Code of Conduct.
8+
9+
Feel free to fork and help improving the project by creating a pull request.
10+
11+
Don't be shy. Aside to code changes, help improving the documentation,
12+
this contribution guideline or the description of open issues is highly appreciated.
13+
14+
Cheers,
15+
16+
Lea

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Lea Rosema
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.

Diff for: README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# `<shader-art>` plugin interface
2+
3+
You can build your own plugins by implementing this interface:
4+
5+
```js
6+
export interface ShaderArtPlugin {
7+
name: string;
8+
setup(
9+
hostElement: HTMLElement,
10+
gl: WebGLRenderingContext | WebGL2RenderingContext,
11+
program: WebGLProgram,
12+
canvas: HTMLCanvasElement
13+
): void | Promise<void>;
14+
dispose(): void;
15+
}
16+
```
17+
18+
If the setup method returns a promise, the shader-art component will wait until the promise resolves.

Diff for: package-lock.json

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@shader-art/plugin-base",
3+
"version": "0.0.1",
4+
"description": "",
5+
"type": "module",
6+
"repository": "shader-art/plugin-base",
7+
"main": "./dist/plugin-base.js",
8+
"types": "./dist/index.d.ts",
9+
"source": "./src/index.ts",
10+
"unpkg": "./dist/index.esm.js",
11+
"files": ["dist"],
12+
"exports": {
13+
"import": "./dist/index.esm.js",
14+
"require": "./dist/index.cjs"
15+
},
16+
"engines": {
17+
"node": ">=12"
18+
},
19+
"scripts": {
20+
"build": "npm run build:types -s && npm run build:esm -s && npm run build:cjs -s",
21+
"build:types": "tsc -d --emitDeclarationOnly --outDir dist -t esnext -m esnext",
22+
"build:esm": "tsc && mv dist/index.js dist/index.esm.js",
23+
"build:cjs": "tsc -t esnext -m commonjs && mv dist/index.js dist/index.cjs",
24+
"test": "npx @skypack/package-check"
25+
},
26+
"keywords": ["webgl", "glsl", "creative-coding"],
27+
"author": "Lea Rosema",
28+
"license": "MIT",
29+
"devDependencies": {
30+
"typescript": "^4.1.5"
31+
}
32+
}

Diff for: src/index.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export interface ShaderArtPlugin {
2+
name: string;
3+
setup(
4+
hostElement: HTMLElement,
5+
gl: WebGLRenderingContext | WebGL2RenderingContext,
6+
program: WebGLProgram,
7+
canvas: HTMLCanvasElement
8+
): void | Promise<void>;
9+
dispose(): void;
10+
}

Diff for: tsconfig.json

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"compilerOptions": {
3+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
4+
5+
/* Basic Options */
6+
// "incremental": true, /* Enable incremental compilation */
7+
"target": "es2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8+
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9+
// "lib": [], /* Specify library files to be included in the compilation. */
10+
// "declaration": true, /* Generates corresponding '.d.ts' file. */
11+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
12+
// "sourceMap": true, /* Generates corresponding '.map' file. */
13+
// "outFile": "./", /* Concatenate and emit output to single file. */
14+
"outDir": "./dist", /* Redirect output structure to the directory. */
15+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
16+
// "composite": true, /* Enable project compilation */
17+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
18+
// "removeComments": true, /* Do not emit comments to output. */
19+
// "noEmit": true, /* Do not emit outputs. */
20+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
21+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
22+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
23+
24+
/* Strict Type-Checking Options */
25+
"strict": true, /* Enable all strict type-checking options. */
26+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
27+
// "strictNullChecks": true, /* Enable strict null checks. */
28+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
29+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
30+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
31+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
32+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
33+
34+
/* Additional Checks */
35+
// "noUnusedLocals": true, /* Report errors on unused locals. */
36+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
37+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
38+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
39+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
40+
41+
/* Module Resolution Options */
42+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
43+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
44+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
45+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
46+
// "typeRoots": [], /* List of folders to include type definitions from. */
47+
// "types": [], /* Type declaration files to be included in compilation. */
48+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
49+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
50+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
51+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
52+
53+
/* Source Map Options */
54+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
55+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
56+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
57+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
58+
59+
/* Experimental Options */
60+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
61+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
62+
63+
/* Advanced Options */
64+
"skipLibCheck": true, /* Skip type checking of declaration files. */
65+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
66+
},
67+
"include": ["src/*.ts"]
68+
}

0 commit comments

Comments
 (0)