Skip to content

Commit

Permalink
ZK-5441: Provide a better way to override za11y module
Browse files Browse the repository at this point in the history
  • Loading branch information
jumperchen committed Aug 23, 2023
1 parent 02f74d7 commit 187ab0e
Show file tree
Hide file tree
Showing 7 changed files with 445 additions and 399 deletions.
2 changes: 1 addition & 1 deletion eslint-plugin-zk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"eslint": "^8.45.0",
"jest": "^28.1.3",
"ts-jest": "^28.0.7",
"typescript": "^4.7.4"
"typescript": "^4.9.5"
},
"dependencies": {
"@typescript-eslint/utils": "^5.30.7",
Expand Down
25 changes: 25 additions & 0 deletions extends.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* extends.js
Purpose:
Description:
History:
1:02 PM 2023/8/21, Created by jumperchen
Copyright (C) 2023 Potix Corporation. All Rights Reserved.
*/
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};

// refer tslib#__extends
export default function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
d.prototype._$super = b.prototype; // Potix: Jumper Chen adds to support `$supers(foo.Bar, 'bind_')`
}
794 changes: 400 additions & 394 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@
"moment-timezone": "^0.5.34",
"postcss": "^8.4.5",
"ts-loader": "^9.3.0",
"typedoc": "^0.23.18",
"typescript": "^4.7.3",
"tslib": "^2.6.2",
"typedoc": "^0.23.21",
"typescript": "^4.9.5",
"vinyl-map": "^1.0.2",
"webpack": "5.66.0",
"webpack": "^5.88.2",
"webpack-cli": "4.9.1",
"webpack-stream": "^7.0.0",
"zkless-engine": "^1.1.10"
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"noImplicitAny": false,
"noImplicitOverride": true,
"noUnusedLocals": true,
"noEmitHelpers": true,
"useUnknownInCatchVariables": false,
"skipLibCheck": true,
"typeRoots": [
Expand Down
14 changes: 13 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
//@ts-check
const path = require('path');
const webpack = require('webpack');
const tslib = require('tslib');
// const CircularDependencyPlugin = require('circular-dependency-plugin');

/** @type { import('webpack').Configuration } */
module.exports = {
resolve: {
extensions: ['.ts', '.js', '.json'],
alias: {
'tslib$': 'tslib/tslib.es6.js',
},
},

module: {
Expand All @@ -29,11 +33,19 @@ module.exports = {
'jquery': 'jq', // for jquery.transit.js
'moment': 'zk.mm', // for moment.js
},

plugins: [
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/
}),
new webpack.ProvidePlugin((function () {
let options = {};
for (let key in tslib) {
options[key] = ['tslib', key];
}
return Object.assign(options, {
'__extends': [path.join(__dirname, 'extends.js'), 'default'] // fix ZK-5441
});
})())
// new CircularDependencyPlugin({
// failOnError: true
// })
Expand Down
1 change: 1 addition & 0 deletions zkdoc/release-note
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ZK 10.0.0
ZK-5503: Allow users to set multiple icons and tooltips on the same LabelImageElement
ZK-5213: Improve accessibility by add tooltips on icons
ZK-5469: Make cloudMode true by default for ZK Stateless
ZK-5441: Provide a better way to override za11y module

* Bugs
ZK-5089: AfterSizeEvent doesn't return a correct size of a Window component
Expand Down

0 comments on commit 187ab0e

Please sign in to comment.