Skip to content

Commit

Permalink
new infrastructure, rewrite lexer and parser
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 3, 2019
1 parent 322d1bd commit 73faaf7
Show file tree
Hide file tree
Showing 24 changed files with 915 additions and 1,333 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
script:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sh ./build/travis.sh; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sh ./build/travis-pr.sh; fi'
- "npm run build"
- "npm run test"
node_js:
- "node"
after_success:
- bash <(curl -s https://codecov.io/bash)
- "for d in ./packages/*; do bash <(curl -s https://codecov.io/bash) -F \"$d\"; done"
3 changes: 3 additions & 0 deletions packages/moon/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
16 changes: 9 additions & 7 deletions packages/moon/build/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const rollup = require("rollup");
const buble = require("rollup-plugin-buble");
const eslint = require("rollup-plugin-eslint");
const babel = require("rollup-plugin-babel");
const eslint = require("rollup-plugin-eslint").eslint;
const uglify = require("uglify-js");
const gzipSize = require("gzip-size");
const fs = require("fs");
Expand All @@ -26,15 +26,17 @@ async function build() {
input: path.join(cwd, "/src/index.js"),
plugins: [
eslint(),
buble()
babel()
]
});

let { code } = await bundle.generate(options);
code = fs.readFileSync(path.join(cwd, "/src/wrapper.js")).toString().replace("INSERT", code.split("\n").slice(1, -3).join("\n")).replace("'use strict'", "\"use strict\"");
let { output } = await bundle.generate(options);
output = output[0].code;

const developmentCode = comment + code.replace(ENV_RE, '"development"');
const productionCode = comment + uglify.minify(code.replace(ENV_RE, '"production"')).code;
output = fs.readFileSync(path.join(cwd, "/src/wrapper.js")).toString().replace("INSERT", output.split("\n").slice(1, -3).join("\n")).replace("'use strict'", "\"use strict\"");

const developmentCode = comment + output.replace(ENV_RE, '"development"');
const productionCode = comment + uglify.minify(output.replace(ENV_RE, '"production"')).output;

fs.writeFileSync(path.join(cwd, "/dist/moon.js"), developmentCode);
fs.writeFileSync(path.join(cwd, "/dist/moon.min.js"), productionCode);
Expand Down
1 change: 0 additions & 1 deletion packages/moon/build/travis.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
npm run test
# npm run test-saucelabs
Loading

0 comments on commit 73faaf7

Please sign in to comment.