Skip to content

Commit 60824d0

Browse files
author
Orta Therox
authored
Merge branch 'master' into patch-1
2 parents 36a4e16 + 4dc5f82 commit 60824d0

File tree

31 files changed

+455
-135
lines changed

31 files changed

+455
-135
lines changed

.github/workflows/CI.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on: pull_request
4+
5+
jobs:
6+
ci:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [10.x, 12.x, 14.x]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Use node version ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
21+
- name: Setup Testing Infra
22+
run: |
23+
cd test
24+
npm install
25+
26+
- name: "CommonJS Test"
27+
run: |
28+
cd test/cjs
29+
npm run test
30+
31+
- name: "ES Modules Test"
32+
run: |
33+
cd test/esm-node-native
34+
npm run test
35+
if: ${{ matrix.node-version == '14.x' }}
36+
37+
- name: "Validate ES Modules == CommonJS"
38+
run: |
39+
cd test/validateModuleExportsMatchCommonJS
40+
npm run test
41+
if: ${{ matrix.node-version == '14.x' }}
42+
43+
- name: "Rollup Tree-shaking Test"
44+
run: |
45+
cd test/rollup-modules
46+
npm run test
47+
48+
- name: "Webpack Tree-shaking Test"
49+
run: |
50+
cd test/webpack-modules
51+
npm run test
52+
53+
- name: "Snowpack Tree-shaking Test"
54+
run: |
55+
cd test/snowpack-modules
56+
npm run test
57+
if: ${{ matrix.node-version == '14.x' }}

.github/workflows/publish.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 14
15+
registry-url: https://registry.npmjs.org/
16+
- run: npm i
17+
- run: node test/validateModuleExportsMatchCommonJS/index.js
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.gitattributes
2+
.github
23
bower.json
34
docs
5+
test
6+
.npmrc

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

CopyrightNotice.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/*! *****************************************************************************
2-
Copyright (c) Microsoft Corporation. All rights reserved.
3-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4-
this file except in compliance with the License. You may obtain a copy of the
5-
License at http://www.apache.org/licenses/LICENSE-2.0
6-
7-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10-
MERCHANTABLITY OR NON-INFRINGEMENT.
11-
12-
See the Apache Version 2.0 License for specific language governing permissions
13-
and limitations under the License.
2+
Copyright (c) Microsoft Corporation.
3+
4+
Permission to use, copy, modify, and/or distribute this software for any
5+
purpose with or without fee is hereby granted.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13+
PERFORMANCE OF THIS SOFTWARE.
1414
***************************************************************************** */
1515

LICENSE.txt

Lines changed: 12 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,12 @@
1-
Apache License
2-
3-
Version 2.0, January 2004
4-
5-
http://www.apache.org/licenses/
6-
7-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8-
9-
1. Definitions.
10-
11-
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12-
13-
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14-
15-
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16-
17-
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18-
19-
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20-
21-
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22-
23-
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24-
25-
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26-
27-
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28-
29-
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30-
31-
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32-
33-
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34-
35-
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36-
37-
You must give any other recipients of the Work or Derivative Works a copy of this License; and
38-
39-
You must cause any modified files to carry prominent notices stating that You changed the files; and
40-
41-
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42-
43-
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44-
45-
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46-
47-
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48-
49-
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50-
51-
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52-
53-
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54-
55-
END OF TERMS AND CONDITIONS
1+
Copyright (c) Microsoft Corporation.
2+
3+
Permission to use, copy, modify, and/or distribute this software for any
4+
purpose with or without fee is hereby granted.
5+
6+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
7+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
9+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
10+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
11+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
12+
PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,51 @@ For the latest stable version, run:
3737
## npm
3838

3939
```sh
40-
# TypeScript 2.3.3 or later
40+
# TypeScript 3.9.2 or later
4141
npm install tslib
4242

43+
# TypeScript 3.8.4 or earlier
44+
npm install tslib@^1
45+
4346
# TypeScript 2.3.2 or earlier
4447
npm install [email protected]
4548
```
4649

50+
## yarn
51+
52+
```sh
53+
# TypeScript 3.9.2 or later
54+
yarn add tslib
55+
56+
# TypeScript 3.8.4 or earlier
57+
yarn add tslib@^1
58+
59+
# TypeScript 2.3.2 or earlier
60+
61+
```
62+
4763
## bower
4864

4965
```sh
50-
# TypeScript 2.3.3 or later
66+
# TypeScript 3.9.2 or later
5167
bower install tslib
5268

69+
# TypeScript 3.8.4 or earlier
70+
bower install tslib@^1
71+
5372
# TypeScript 2.3.2 or earlier
5473
bower install [email protected]
5574
```
5675

5776
## JSPM
5877

5978
```sh
60-
# TypeScript 2.3.3 or later
79+
# TypeScript 3.9.2 or later
6180
jspm install tslib
6281

82+
# TypeScript 3.8.4 or earlier
83+
jspm install tslib@^1
84+
6385
# TypeScript 2.3.2 or earlier
6486
jspm install [email protected]
6587
```
@@ -108,7 +130,7 @@ For JSPM users:
108130
"importHelpers": true,
109131
"baseUrl": "./",
110132
"paths": {
111-
"tslib" : ["jspm_packages/npm/tslib@1.9.3/tslib.d.ts"]
133+
"tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
112134
}
113135
}
114136
}
@@ -124,11 +146,9 @@ There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob
124146
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
125147
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
126148
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
127-
* Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)).
128149

129150
# Documentation
130151

131152
* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
132153
* [Programming handbook](http://www.typescriptlang.org/Handbook)
133-
* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
134154
* [Homepage](http://www.typescriptlang.org/)

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"Microsoft Corp."
55
],
66
"homepage": "http://typescriptlang.org/",
7-
"version": "1.9.3",
8-
"license": "Apache-2.0",
7+
"version": "2.0.1",
8+
"license": "0BSD",
99
"description": "Runtime library for TypeScript helper functions",
1010
"keywords": [
1111
"TypeScript",

modules/index.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import tslib from '../tslib.js';
2+
const {
3+
__extends,
4+
__assign,
5+
__rest,
6+
__decorate,
7+
__param,
8+
__metadata,
9+
__awaiter,
10+
__generator,
11+
__exportStar,
12+
__createBinding,
13+
__values,
14+
__read,
15+
__spread,
16+
__spreadArrays,
17+
__await,
18+
__asyncGenerator,
19+
__asyncDelegator,
20+
__asyncValues,
21+
__makeTemplateObject,
22+
__importStar,
23+
__importDefault,
24+
__classPrivateFieldGet,
25+
__classPrivateFieldSet,
26+
} = tslib;
27+
export {
28+
__extends,
29+
__assign,
30+
__rest,
31+
__decorate,
32+
__param,
33+
__metadata,
34+
__awaiter,
35+
__generator,
36+
__exportStar,
37+
__createBinding,
38+
__values,
39+
__read,
40+
__spread,
41+
__spreadArrays,
42+
__await,
43+
__asyncGenerator,
44+
__asyncDelegator,
45+
__asyncValues,
46+
__makeTemplateObject,
47+
__importStar,
48+
__importDefault,
49+
__classPrivateFieldGet,
50+
__classPrivateFieldSet,
51+
};

modules/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

0 commit comments

Comments
 (0)