-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8904 from keymanapp/change/web/common-downcompile…
…-helpers change(web): common downcompile helpers 🧩
- Loading branch information
Showing
50 changed files
with
398 additions
and
177 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
The default import setup for the `tslib` package is unfortunately incompatible with `esbuild` when in ES5 mode. But... | ||
with a little elbow grease, we can fix that with _this_ package by importing its ES5-compatible file and exporting it | ||
as _this_ package's default export for use in anything looking to `"importHelpers"`. | ||
|
||
To utilize this with `esbuild` while enabling the `"importHelpers"` compilation option in your tsconfig.json, you'll want | ||
to set the following in your `esbuild` config: | ||
|
||
```javascript | ||
alias: { | ||
'tslib': '@keymanapp/tslib' | ||
}, | ||
``` | ||
|
||
Note that esbuild 0.15.16 is the minimum required version to utilize the 'alias' feature necessary to replace `tslib` for | ||
`tsc`-generated `import { /* */ } from 'tslib'` statements that result from enabling `"importHelpers"` in a tsconfig. |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
## START STANDARD BUILD SCRIPT INCLUDE | ||
# adjust relative paths as necessary | ||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" | ||
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" | ||
## END STANDARD BUILD SCRIPT INCLUDE | ||
|
||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" | ||
|
||
cd "$THIS_SCRIPT_PATH" | ||
|
||
################################ Main script ################################ | ||
|
||
builder_describe \ | ||
"A ES5 + esbuild compatibility wrapper for the 'tslib' package." \ | ||
clean configure build | ||
|
||
builder_describe_outputs \ | ||
configure "/node_modules" \ | ||
build "/common/web/tslib/build/index.js" | ||
|
||
builder_parse "$@" | ||
|
||
builder_run_action configure verify_npm_setup | ||
builder_run_action clean rm -rf build/ | ||
builder_run_action build tsc --build |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@keymanapp/tslib", | ||
"description": "An ES5 + esbuild-compatible wrapper for the 'tslib' library", | ||
"main": "./build/index.js", | ||
"scripts": { | ||
"build": "gosh ./build.sh build", | ||
"clean": "gosh ./build.sh clean" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.5.2", | ||
"typescript": "^4.9.5" | ||
}, | ||
"devDependencies": { | ||
"@keymanapp/resources-gosh": "*", | ||
"esbuild": "^0.15.16" | ||
}, | ||
"type": "module" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from '../../../../node_modules/tslib/tslib.js'; | ||
|
||
export * as tslib from '../../../../node_modules/tslib/tslib.js'; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"extends": "../../../tsconfig-base.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"module": "es6", | ||
"moduleResolution": "Node", | ||
"inlineSources": true, | ||
"sourceMap": true, | ||
"declaration": true, | ||
"target": "es5", | ||
"tsBuildInfoFile": "./build/tsconfig.tsbuildinfo", | ||
"types": ["node"], | ||
"lib": ["es6"], | ||
"baseUrl": "./src", | ||
"outDir": "./build/", | ||
"rootDir": "./src" | ||
}, | ||
"include": [ | ||
"./src/index.ts" | ||
] | ||
} |
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
Oops, something went wrong.