postinstall task for fixing sweetalert typings

This commit is contained in:
Kyle Spearrin 2019-01-25 15:05:22 -05:00
parent b5726393f3
commit e6cec93f2c
3 changed files with 42 additions and 28 deletions

View File

@ -5,6 +5,7 @@ const package = require('./package.json');
const fs = require('fs'); const fs = require('fs');
const paths = { const paths = {
node_modules: './node_modules/',
src: './src/', src: './src/',
build: './build/', build: './build/',
cssDir: './src/css/', cssDir: './src/css/',
@ -29,8 +30,17 @@ function version(cb) {
cb(); cb();
} }
// ref: https://github.com/t4t5/sweetalert/issues/890
function fixSweetAlert(cb) {
fs.writeFileSync(paths.node_modules + 'sweetalert/typings/sweetalert.d.ts',
'import swal, { SweetAlert } from "./core";export default swal;export as namespace swal;');
cb();
}
exports.clean = clean; exports.clean = clean;
exports.webfonts = gulp.series(clean, webfonts); exports.webfonts = gulp.series(clean, webfonts);
exports.prebuild = gulp.series(clean, webfonts); exports.prebuild = gulp.series(clean, webfonts);
exports.version = version; exports.version = version;
exports.postdist = version; exports.postdist = version;
exports.fixSweetAlert = fixSweetAlert;
exports.postinstall = fixSweetAlert;

56
package-lock.json generated
View File

@ -3361,15 +3361,30 @@
"webpack-sources": "^1.1.0" "webpack-sources": "^1.1.0"
}, },
"dependencies": { "dependencies": {
"loader-utils": { "big.js": {
"version": "1.1.0", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true, "dev": true,
"requires": { "requires": {
"big.js": "^3.1.3", "minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz",
"integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^2.0.0", "emojis-list": "^2.0.0",
"json5": "^0.5.0" "json5": "^1.0.1"
} }
} }
} }
@ -4052,14 +4067,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -4074,20 +4087,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -4204,8 +4214,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -4217,7 +4226,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -4232,7 +4240,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -4344,8 +4351,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -4357,7 +4363,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -4479,7 +4484,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -10133,9 +10137,9 @@
} }
}, },
"sweetalert": { "sweetalert": {
"version": "2.1.0", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/sweetalert/-/sweetalert-2.1.0.tgz", "resolved": "https://registry.npmjs.org/sweetalert/-/sweetalert-2.1.2.tgz",
"integrity": "sha512-9YKj0SvjKyBfRWco50UOsIbXVeifYbxzT9Qda7EsqC01eafHGCSG0IR7g942ufjzt7lnwO8ZZBwr6emXv2fQrg==", "integrity": "sha512-iWx7X4anRBNDa/a+AdTmvAzQtkN1+s4j/JJRWlHpYE8Qimkohs8/XnFcWeYHH2lMA8LRCa5tj2d244If3S/hzA==",
"requires": { "requires": {
"es6-object-assign": "^1.1.0", "es6-object-assign": "^1.1.0",
"promise-polyfill": "^6.0.2" "promise-polyfill": "^6.0.2"

View File

@ -5,7 +5,7 @@
"sub:init": "git submodule update --init --recursive", "sub:init": "git submodule update --init --recursive",
"sub:update": "git submodule update --remote", "sub:update": "git submodule update --remote",
"sub:pull": "git submodule foreach git pull", "sub:pull": "git submodule foreach git pull",
"postinstall": "npm run sub:init", "postinstall": "npm run sub:init && gulp postinstall",
"build": "gulp prebuild && webpack", "build": "gulp prebuild && webpack",
"build:watch": "gulp prebuild && webpack-dev-server", "build:watch": "gulp prebuild && webpack-dev-server",
"build:prod": "gulp prebuild && cross-env NODE_ENV=production webpack", "build:prod": "gulp prebuild && cross-env NODE_ENV=production webpack",
@ -85,7 +85,7 @@
"popper.js": "1.14.4", "popper.js": "1.14.4",
"qrious": "4.0.2", "qrious": "4.0.2",
"rxjs": "6.3.3", "rxjs": "6.3.3",
"sweetalert": "2.1.0", "sweetalert": "2.1.2",
"web-animations-js": "2.3.1", "web-animations-js": "2.3.1",
"webcrypto-shim": "0.1.4", "webcrypto-shim": "0.1.4",
"whatwg-fetch": "3.0.0", "whatwg-fetch": "3.0.0",