-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* TeaVM related changes. Allows salvation to be compiled to JS instead of having to run a server * Add main class needed for TeaVM * fix indentation * expose functions on window so they're individually callable * Can't use named capturing groups. Seems like it doesn't work when it's transpiled * output a string for the JS to consume * use integers for matching since teavm doesn't support strings * checkstyle fixes * update readme and specify a filename for the js output * remove comments * abstract regex out to its own variable * function renaming * add js test and ci job * don't run the build for java8 * applying comment suggestions * fix ci command * rearrange ci job so java build doesn't need to happen twice * add demo site to be published via GH pages * specify working directory * update readme stating that the js file needs to be manually copied.
- Loading branch information
Showing
29 changed files
with
14,347 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build and Deploy Demo Site | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/[email protected] | ||
- name: Install and Build 🔧 | ||
run: | | ||
npm install | ||
npm run build | ||
deploy: | ||
if: | | ||
!cancelled() && !failure() | ||
needs: build | ||
steps: | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: docs/public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,7 @@ cert.pem | |
*.classpath | ||
*.project | ||
*.settings | ||
|
||
dist | ||
.vscode | ||
docs/public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
dist | ||
logs | ||
deployment | ||
static | ||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
'use strict'; | ||
const { defineConfig } = require('eslint-define-config'); | ||
|
||
module.exports = defineConfig({ | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:jsx-a11y/recommended', | ||
], | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
reportUnusedDisableDirectives: true, | ||
root: true, | ||
rules: { | ||
'array-element-newline': ['error', 'consistent'], | ||
'arrow-body-style': 'error', | ||
'array-bracket-spacing': ['error', 'never'], | ||
'arrow-parens': ['error', 'as-needed'], | ||
'brace-style': ['error', '1tbs'], | ||
'camelcase': 'error', | ||
'comma-dangle': ['error', 'always-multiline'], | ||
'comma-spacing': ['error', { before: false, after: true }], | ||
'comma-style': ['error', 'last'], | ||
'computed-property-spacing': ['error', 'never'], | ||
'consistent-return': 'error', | ||
'curly': ['error', 'multi-line'], | ||
'dot-notation': 'error', | ||
'eol-last': 'error', | ||
'eqeqeq': ['error', 'smart'], | ||
'func-call-spacing': 'error', | ||
'guard-for-in': 'error', | ||
'indent': [ | ||
'error', | ||
2, | ||
{ | ||
SwitchCase: 1, | ||
VariableDeclarator: { | ||
var: 2, | ||
let: 2, | ||
const: 3, | ||
}, | ||
}, | ||
], | ||
'key-spacing': [ | ||
'error', | ||
{ | ||
beforeColon: false, | ||
afterColon: true, | ||
}, | ||
], | ||
'keyword-spacing': 'error', | ||
'max-statements-per-line': 'error', | ||
'no-alert': 'error', | ||
'no-caller': 'error', | ||
'no-else-return': 'error', | ||
'no-empty': [ | ||
'error', | ||
{ | ||
allowEmptyCatch: true, | ||
}, | ||
], | ||
'no-eval': 'error', | ||
'no-extend-native': 'error', | ||
'no-extra-bind': 'error', | ||
'no-floating-decimal': 'error', | ||
'no-implied-eval': 'error', | ||
'no-inner-declarations': ['error', 'both'], | ||
'no-lonely-if': 'error', | ||
'no-loop-func': 'error', | ||
'no-multi-spaces': 'error', | ||
'no-multiple-empty-lines': [ | ||
'error', | ||
{ | ||
max: 2, | ||
}, | ||
], | ||
'no-param-reassign': 'warn', | ||
|
||
'no-return-assign': 'error', | ||
'no-self-compare': 'error', | ||
'no-sequences': 'error', | ||
'no-shadow': ['error', { builtinGlobals: true }], | ||
'no-trailing-spaces': 'error', | ||
'no-undefined': 'error', | ||
'no-unused-expressions': 'error', | ||
'no-unused-vars': ['error', { vars: 'all', args: 'after-used' }], | ||
'no-use-before-define': ['error', 'nofunc'], | ||
'no-useless-call': 'error', | ||
'no-var': 'error', | ||
'no-with': 'error', | ||
'object-curly-spacing': ['error', 'always'], | ||
'object-property-newline': [ | ||
'error', | ||
{ | ||
allowAllPropertiesOnSameLine: true, | ||
}, | ||
], | ||
'object-shorthand': ['error', 'always'], | ||
'prefer-arrow-callback': ['error'], | ||
'quotes': ['error', 'single', { avoidEscape: true }], | ||
'semi': ['error', 'always'], | ||
'semi-spacing': [ | ||
'error', | ||
{ | ||
before: false, | ||
after: true, | ||
}, | ||
], | ||
'space-before-blocks': 'error', | ||
'space-before-function-paren': ['error', { anonymous: 'always', named: 'never' }], | ||
'space-in-parens': 'error', | ||
'space-infix-ops': 'error', | ||
'space-unary-ops': 'error', | ||
'spaced-comment': [ | ||
'warn', | ||
'always', | ||
{ | ||
block: { | ||
markers: ['!'], | ||
exceptions: ['*'], | ||
}, | ||
line: { | ||
markers: ['/'], | ||
}, | ||
}, | ||
], | ||
'wrap-iife': ['error', 'inside'], | ||
'yoda': ['error', 'never'], | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.js', '*.jsx'], | ||
}, | ||
{ | ||
files: [ | ||
'webpack.config.js', | ||
'.eslintrc.js', | ||
], | ||
env: { | ||
node: true, | ||
}, | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Installation | ||
```sh | ||
npm install | ||
``` | ||
|
||
## Development Build | ||
```sh | ||
npm run dev | ||
``` | ||
|
||
## Production Build | ||
```sh | ||
npm run build | ||
``` | ||
|
||
# Note on salvation.min.js | ||
|
||
This comes from [Salvation](https://github.com/shapesecurity/salvation). It is automatically generated at compile time using [TeaVM](https://teavm.org/docs/intro/getting-started.html). And needs to be manually copied to `docs/static/`. | ||
|
||
To update the version of Salvation used in this demo website, follow the instructions provided in the README located at the root of this repo. Copy the generated file to `docs/static/`, then rename it to `salvation.min.js`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
presets: [ | ||
'@babel/preset-env', | ||
['@babel/preset-react', { | ||
runtime: 'automatic', | ||
development: process.env.NODE_ENV === 'development', | ||
}], | ||
], | ||
targets: { | ||
browsers: '> 0.5%, last 10 versions', | ||
}, | ||
plugins: [ | ||
'@babel/plugin-transform-runtime', | ||
[ | ||
'@babel/plugin-transform-react-jsx', | ||
{ | ||
runtime: 'automatic', | ||
importSource: 'preact', | ||
}, | ||
], | ||
], | ||
}; |
Oops, something went wrong.