-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): import local punycode package instead of core (#26)
There are two `punycode` packages available: * [The cross-platform npm package](https://github.com/mathiasbynens/punycode.js) * [The node deprecated native library](https://nodejs.org/api/punycode.html) We wrote [`import * as punycode from 'punycode'`](https://github.com/Jigsaw-Code/outline-shadowsocksconfig/blob/v0.2.0/src/shadowsocks_config.ts#L17) (which is compiled to [`var punycode = require("punycode")`](https://github.com/Jigsaw-Code/outline-shadowsocksconfig/blob/v0.2.0/build/shadowsocks_config.js#L28)) to use it. However when the code is running in node or electron, this import `require("punycode")` actually means using the node's deprecated native library. This will cause more issues when electron's `contextIsolation` is turned on. According to the [latest documentation](https://github.com/mathiasbynens/punycode.js#installation), we should use `import * as punycode from 'punycode'/` (which will be compiled to `require("punycode/")`) in order to reference the npm package. Therefore in this PR, I updated this import statement and this is also a prerequisite of Jigsaw-Code/outline-apps#1365.
- Loading branch information
Showing
6 changed files
with
46 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,11 @@ | |
version "8.0.45" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.45.tgz#89fad82439d5624e1b5c6b42f0f5d85136dcdecc" | ||
|
||
"@types/[email protected]": | ||
version "2.1.0" | ||
resolved "https://registry.yarnpkg.com/@types/punycode/-/punycode-2.1.0.tgz#89e4f3d09b3f92e87a80505af19be7e0c31d4e83" | ||
integrity sha512-PG5aLpW6PJOeV2fHRslP4IOMWn+G+Uq8CfnyJ+PDS8ndCbU+soO+fB3NKCKo0p/Jh2Y4aPaiQZsrOXFdzpcA6g== | ||
|
||
ansi-regex@^2.0.0: | ||
version "2.1.1" | ||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" | ||
|