Skip to content

Commit

Permalink
feat(compiler): introduce compile/transform/bundle diagnostics (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
apapko committed May 7, 2018
1 parent 2a5a5ed commit 950d196
Show file tree
Hide file tree
Showing 118 changed files with 1,830 additions and 2,325 deletions.
Empty file modified packages/lwc-compiler/.npmignore
100644 → 100755
Empty file.
12 changes: 8 additions & 4 deletions packages/lwc-compiler/package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
"version": "0.20.0",
"description": "LWC compiler",
"main": "dist/commonjs/index.js",
"typings": "dist/types/index.d.ts",
"author": "",
"license": "ISC",
"scripts": {
"clean": "rm -rf dist",
"build": "echo 'Building compiler...' && DIR=`pwd` && cd ../../ && tsc -p $DIR/tsconfig.json",
"build:all": "",
"build:umd": "webpack --progress",
"build": "yarn compile && yarn update:version",
"compile": "echo 'Building compiler...' && DIR=`pwd` && cd ../../ && tsc -p $DIR/tsconfig.json",
"update:version": "node ./scripts/update-compiler-version.js",
"test": "DIR=`pwd` && cd ../../ && jest $DIR"
},
"dependencies": {
"@babel/core": "7.0.0-beta.40",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.40",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.40",
"@types/chokidar": "^1.7.5",
"babel-plugin-transform-lwc-class": "0.20.0",
"babel-preset-compat": "0.17.40",
"babel-preset-minify": "0.4.0-alpha.caaefb4c",
Expand All @@ -25,10 +27,12 @@
"postcss": "~6.0.19",
"postcss-plugin-lwc": "0.20.0",
"postcss-selector-parser": "^3.1.1",
"rollup": "~0.56.2",
"rollup": "~0.56.5",
"rollup-plugin-replace": "^2.0.0"
},
"devDependencies": {
"@types/babel-core": "^6.25.3",
"magic-string": "^0.22.4",
"string-replace-webpack-plugin": "0.1.3",
"webpack": "^3.11.0"
}
Expand Down
34 changes: 34 additions & 0 deletions packages/lwc-compiler/scripts/update-compiler-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const path = require("path");
const replace = require("rollup-plugin-replace");
const { rollup } = require("rollup");
const { version } = require("../package.json");

async function updateVersion(version) {
const sourcePath = path.resolve("dist/commonjs/index.js");

const result = await rollup({
input: sourcePath,
plugins: [
replace({
__VERSION__: version
})
]
});

await result.write({
file: sourcePath,
format: "cjs",
sourcemap: false, // keep typescript generated map to stay consistent with the rest of the files.
});

console.log("Compiler version: ", version);
}

if (!version || typeof version !== "string") {
throw new Error(
"Failed to update compiler version. Expected version value as a string, received: " +
version
);
}

updateVersion(version);
Loading

0 comments on commit 950d196

Please sign in to comment.