-
Notifications
You must be signed in to change notification settings - Fork 51
start of ES6 modules: move to rollup #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alicebob
wants to merge
33
commits into
robx:main
Choose a base branch
from
alicebob:reimport
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
02bca34
update travis npm to something more recent
alicebob 5a51d4a
restructure build process to use `rollup`
alicebob a91ebd2
fix lint and remove unused files
alicebob 1a183a3
fix read-only-object errors
alicebob da17a11
update all tests to use `import`s
alicebob 5ab22fd
load stand-alone candle.js file
alicebob 38c2637
fix githash variable in the final .js file
alicebob 2428e8c
travis: build before test
alicebob d3f688a
run prettier
alicebob 1e68e0e
Merge remote-tracking branch 'origin/master' into reimport
alicebob b8d87b4
more clear install target
alicebob 3a5601f
use variable for files we bundle
alicebob e68fe02
move format checks to the Makefile
alicebob 96df19d
add .json files to the format checks, and prettify them
alicebob e15d00c
restore Grunt bundling target
robx 3c68511
skip frozen checks
robx 4d9ea3a
checkLineShape: test whether cell isnull, not is null
robx 8189d2f
kinkonkan: corner excells are "isnull", they don't have coordinates
robx da65ab1
fix sed
robx a893dc5
dependency bump
robx b790892
use grunt concat target
robx f4a992e
change default target
robx 6f61769
move more logic from Gruntfile to Makefile
robx 64b5740
remove some stale package.json fields
robx f296cba
remove index.js
robx de8b52b
Merge branch 'master' into reimport
robx 2d040e8
tawa: don't set error on out-of-board neighbours
robx 8e2a468
remove another frozen check
robx 5f9d9a9
fmt
robx a01fadf
remove npm-install makefile target
robx 88b5026
Revert "remove index.js"
robx 3bd5a16
or maybe try exporting the concat version (this is for pzprnode)
robx 93ba59f
fancy module
alicebob File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| language: node_js | ||
| node_js: 10 | ||
| script: | ||
| - npm run-script build | ||
| - npm test | ||
| - npm run-script check-format | ||
| - make lint build test check-format |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
|
|
||
| module.exports = require('./dist/js/pzpr.js'); | ||
| import pzpr from './dist/js/pzpr.concat.js'; | ||
| export default pzpr; |
This file contains hidden or 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 hidden or 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 @@ | ||
| import { terser } from 'rollup-plugin-terser'; | ||
|
|
||
| // `npm run build` -> `production` is true | ||
| // `npm run dev` -> `production` is false | ||
| const production = !process.env.ROLLUP_WATCH; | ||
|
|
||
| export default { | ||
| input: 'dist/js/pzpr.concat.js', | ||
| output: { | ||
| file: 'dist/js/pzpr.js', | ||
| name: 'pzpr', | ||
| format: 'iife', | ||
| sourcemap: true, | ||
| globals: { | ||
| "pzpr-canvas": "Candle" | ||
| } | ||
| }, | ||
| context: "window", | ||
| plugins: [ | ||
| production && terser() // minify, but only in production | ||
| ] | ||
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,34 +1,35 @@ | ||
| { | ||
| "env": { | ||
| "browser": true, // Allow to use browser defined variable (not console, alert etc.) | ||
| "node": true // Allow to use node defined variable (require, process etc.) | ||
| "browser": true, // Allow to use browser defined variable (not console, alert etc.) | ||
| "node": true // Allow to use node defined variable (require, process etc.) | ||
| }, | ||
| "parserOptions": { | ||
| "ecmaVersion": 5 | ||
| "ecmaVersion": 5, | ||
| "sourceType": "module" | ||
| }, | ||
| "globals": { | ||
| "pzpr": "readonly" | ||
| }, | ||
| "extends": "eslint:recommended", // Implement recommended rules | ||
| "extends": "eslint:recommended", // Implement recommended rules | ||
| "rules": { | ||
| "curly": ["error", "all"], // Error for no curly brancket in loop or conditions | ||
| "no-unused-vars": // Error for unused variables, not detect arguments | ||
| ["error", {"args": "none"}], | ||
| "no-undef": "error", // Error for unused variable (that will become global variable) | ||
| "new-cap": "error", // Error for lowercase first letter or constructor call as function | ||
| "eqeqeq": ["error", "always"], // Error for ==, != to compare | ||
| "no-use-before-define": // Error for using variable before definition | ||
| ["error", {"functions":false, "classes":false}], | ||
| "curly": ["error", "all"], // Error for no curly brancket in loop or conditions | ||
| // Error for unused variables, not detect arguments | ||
| "no-unused-vars": ["error", { "args": "none" }], | ||
| "no-undef": "error", // Error for unused variable (that will become global variable) | ||
| "new-cap": "error", // Error for lowercase first letter or constructor call as function | ||
| "eqeqeq": ["error", "always"], // Error for ==, != to compare | ||
| // Error for using variable before definition | ||
| "no-use-before-define": ["error", { "functions": false, "classes": false }], | ||
| "comma-dangle": ["error", "never"], // Error for trailing comma | ||
| "no-redeclare": "warn", // Warn redefine variable (TODO: make this rule error) | ||
| "no-redeclare": "warn", // Warn redefine variable (TODO: make this rule error) | ||
| //"block-scoped-var": "warn", // Warn var declaration inside block scope | ||
| "no-empty": "off", // Allow empty block statements | ||
| "no-constant-condition": // Allow constant condition in conditions | ||
| ["error", {"checkLoops": false}], | ||
| "no-useless-escape": "off", // Allow unnessesary escape charactors | ||
| "no-extra-boolean-cast": "off", // Allow to use boolean cast for boolean value | ||
| "no-mixed-spaces-and-tabs": "off", // Allow to use spaces and tabs for indent | ||
| "dot-notation": "off", // Allow object access via obj["name"] | ||
| "no-loop-func": "off" // Allow function definition in loop | ||
| "no-empty": "off", // Allow empty block statements | ||
| // Allow constant condition in conditions | ||
| "no-constant-condition": ["error", { "checkLoops": false }], | ||
| "no-useless-escape": "off", // Allow unnessesary escape charactors | ||
| "no-extra-boolean-cast": "off", // Allow to use boolean cast for boolean value | ||
| "no-mixed-spaces-and-tabs": "off", // Allow to use spaces and tabs for indent | ||
| "dot-notation": "off", // Allow object access via obj["name"] | ||
| "no-loop-func": "off" // Allow function definition in loop | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,14 @@ | ||
| var pzpr = { | ||
| version: "<%= git.hash %>" | ||
| }; | ||
| export default pzpr; | ||
|
|
||
| import Candle from "pzpr-canvas"; | ||
| pzpr.Candle = Candle; | ||
|
|
||
| //eslint-disable-next-line no-unused-vars | ||
| var document = this.document || pzpr.Candle.document; | ||
| //eslint-disable-next-line no-unused-vars | ||
| var DOMParser = this.DOMParser || pzpr.Candle.DOMParser; | ||
| //eslint-disable-next-line no-unused-vars | ||
| var XMLSerializer = this.XMLSerializer || pzpr.Candle.XMLSerializer; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.