Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions js/gulp/package-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ const createMainPackageJson = (target, format) => (orig) => ({
browser: `${mainExport}.es5.min.js`,
[`browser:es2015`]: `${mainExport}.es2015.min.js`,
[`@std/esm`]: { esm: `mjs` },
// Temporary workaround until https://github.com/Microsoft/tslib/pull/44 is merged
scripts: {
postinstall: `npm i shx && npm run tslib_mjs && npm run tslib_pkg && npm r shx`,
tslib_mjs: `shx cp $(node -e \"console.log(require.resolve('tslib/tslib.es6.js'))\") $(node -e \"var r=require,p=r('path');console.log(p.join(p.dirname(r.resolve('tslib')),'tslib.mjs'))\")`,
tslib_pkg: `node -e \"var r=require,p=r('path'),f=r('fs'),k=p.join(p.dirname(r.resolve('tslib')),'package.json'),x=JSON.parse(f.readFileSync(k));x.main='tslib';f.writeFileSync(k,JSON.stringify(x))\"`
}
});

const createTypeScriptPackageJson = (target, format) => (orig) => ({
Expand Down
8 changes: 4 additions & 4 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"lint": "npm-run-all -p lint:*",
"lint:src": "tslint --fix --project -p tsconfig.json -c tslint.json \"src/**/*.ts\"",
"lint:test": "tslint --fix --project -p test/tsconfig.json -c tslint.json \"test/**/*.ts\"",
"prepublishOnly": "echo \"Error: do 'npm run release' instead of 'npm publish'\" && exit 1"
"prepublishOnly": "echo \"Error: do 'npm run release' instead of 'npm publish'\" && exit 1",
"postinstall": "shx cp node_modules/tslib/tslib.es6.js node_modules/tslib/tslib.mjs"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -54,7 +55,8 @@
},
"dependencies": {
"flatbuffers": "trxcllnt/flatbuffers-esm",
"text-encoding": "0.6.4"
"text-encoding-utf-8": "^1.0.2",
"tslib": "^1.8.0"
},
"devDependencies": {
"@std/esm": "0.13.0",
Expand Down Expand Up @@ -90,10 +92,8 @@
"rxjs": "5.5.2",
"shx": "0.2.2",
"source-map-loader": "0.2.3",
"text-encoding-utf-8": "1.0.1",
"trash": "4.1.0",
"ts-jest": "21.2.1",
"tslib": "1.8.0",
"tslint": "5.8.0",
"typescript": "2.6.1",
"uglifyjs-webpack-plugin": "1.0.1",
Expand Down