-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from caipng/dev
Setup project structure and workflow
- Loading branch information
Showing
20 changed files
with
8,777 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint"], | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
ignorePatterns: ["cparser.js", "src/*.js", "src/*.cjs"], | ||
}; |
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,23 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x, 16.x, 18.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
- run: npm install -g grunt-cli | ||
- run: npm ci | ||
- run: grunt build | ||
- run: npm test |
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,7 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage | ||
lib | ||
|
||
# Ignore all HTML files: | ||
**/*.html |
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 @@ | ||
{} |
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,89 @@ | ||
module.exports = (grunt) => { | ||
require("load-grunt-tasks")(grunt); | ||
|
||
grunt.registerTask("build", "build", ["clean", "peg", "copy", "ts", "dist"]); | ||
|
||
grunt.registerTask("dist", "bundle into distribution version", [ | ||
"browserify", | ||
"babel", | ||
"uglify", | ||
]); | ||
|
||
grunt.registerTask("default", "watch & compile", ["build", "watch"]); | ||
|
||
const pkg = grunt.file.readJSON("package.json"); | ||
return grunt.initConfig({ | ||
pkg, | ||
|
||
copy: { | ||
build: { | ||
cwd: "src", | ||
src: ["**/*.js"], | ||
dest: "lib", | ||
expand: true, | ||
}, | ||
}, | ||
|
||
clean: { | ||
build: { | ||
src: ["lib", "dist/cviz.*"], | ||
}, | ||
}, | ||
|
||
browserify: { | ||
dist: { | ||
files: { | ||
"dist/cviz.js": ["lib/index.js"], | ||
}, | ||
}, | ||
}, | ||
|
||
uglify: { | ||
dist: { | ||
files: { | ||
"dist/cviz.es5.min.js": ["dist/cviz.es5.js"], | ||
}, | ||
}, | ||
}, | ||
|
||
babel: { | ||
options: { | ||
sourceMap: true, | ||
presets: ["@babel/preset-env"], | ||
}, | ||
dist: { | ||
files: { | ||
"dist/cviz.es5.js": "dist/cviz.js", | ||
}, | ||
}, | ||
}, | ||
|
||
peg: { | ||
build: { | ||
cwd: "parsers", | ||
src: ["**/*.pegjs"], | ||
dest: "src", | ||
ext: ".js", | ||
expand: true, | ||
}, | ||
}, | ||
|
||
ts: { | ||
default: { | ||
src: ["src/**/*.ts"], | ||
tsconfig: "./tsconfig.json", | ||
}, | ||
}, | ||
|
||
watch: { | ||
peg: { | ||
files: "parser/**/*.pegjs", | ||
tasks: ["newer:peg"], | ||
}, | ||
copy: { | ||
files: ["src/**/*.js"], | ||
tasks: ["newer:copy"], | ||
}, | ||
}, | ||
}); | ||
}; |
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,9 @@ | ||
# c-viz | ||
|
||
A C parser+interpreter+visualizer written in JS that runs in the browser. | ||
|
||
Workflow inspired by https://github.com/felixhao28/JSCPP | ||
|
||
- `grunt` to watch & build | ||
- `npm run build` to build | ||
- `npm run test` to run tests |
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 @@ | ||
1. Setup prepush hooks |
Empty file.
Oops, something went wrong.