From 57f7dcc9b8e6252b32582b0f1bc37b8dcd44336b Mon Sep 17 00:00:00 2001 From: Ludovico Fischer <43557+ludofischer@users.noreply.github.com> Date: Mon, 5 Oct 2020 22:17:56 +0200 Subject: [PATCH 01/10] Use compatible eslint-config-react-app and eslint-plugin-react-hooks. (#890) This solves the following warning on yarn install: `eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-react-hooks@1.x".` `eslint-config-react-app@5.2.1` has widened its peerDep range to include `eslint-plugin-react-hooks@2`: https://github.com/facebook/create-react-app/blob/d2f813f8897ffcd2f0b0d2da75d0c44924c92f4d/packages/eslint-config-react-app/package.json#L26 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7783355af..dd2393744 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "enquirer": "^2.3.4", "eslint": "^6.1.0", "eslint-config-prettier": "^6.0.0", - "eslint-config-react-app": "^5.0.2", + "eslint-config-react-app": "^5.2.1", "eslint-plugin-flowtype": "^3.13.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-jsx-a11y": "^6.2.3", diff --git a/yarn.lock b/yarn.lock index 7814dee49..0551fb8b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3121,10 +3121,10 @@ eslint-config-prettier@^6.0.0: dependencies: get-stdin "^6.0.0" -eslint-config-react-app@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.0.2.tgz#df40d73a1402986030680c040bbee520db5a32a4" - integrity sha512-VhlESAQM83uULJ9jsvcKxx2Ab0yrmjUt8kDz5DyhTQufqWE0ssAnejlWri5LXv25xoXfdqOyeDPdfJS9dXKagQ== +eslint-config-react-app@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.1.tgz#698bf7aeee27f0cea0139eaef261c7bf7dd623df" + integrity sha512-pGIZ8t0mFLcV+6ZirRgYK6RVqUIKRIi9MmgzUEmrIknsn3AdO0I32asO86dJgloHq+9ZPl8UIg8mYrvgP5u2wQ== dependencies: confusing-browser-globals "^1.0.9" From da53ea8f2e9e0fc6c782154bdde1d5bdf03036d1 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2020 16:26:28 -0400 Subject: [PATCH 02/10] docs: add ludofischer as a contributor (#894) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index a96248a2b..a0063b091 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -952,6 +952,15 @@ "contributions": [ "bug" ] + }, + { + "login": "ludofischer", + "name": "Ludovico Fischer", + "avatar_url": "https://avatars1.githubusercontent.com/u/43557?v=4", + "profile": "http://www.ludofischer.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index f3907c338..0d5265e42 100644 --- a/README.md +++ b/README.md @@ -653,6 +653,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Vladislav Moiseev

💻
Felix Mosheev

🐛 +
Ludovico Fischer

💻 From 8b91c747c2235ed4fbf853a39fb6800cbf70b2b3 Mon Sep 17 00:00:00 2001 From: Altrim Beqiri Date: Mon, 21 Sep 2020 16:11:15 +0200 Subject: [PATCH 03/10] fix: don't replace lodash/fp imports with lodash-es/fp - previously, when importing modules from `lodash/fp`, the imports broke since `babel-plugin-transform-rename-import` renames all `lodash` imports to `lodash-es` for the ESM build - e.g `import mergeAll from 'lodash/fp/mergeAll';` ends up being imported as `import mergeAll from 'lodash-es/fp/mergeAll'` and we got an error since `lodash-es/fp` doesn't exist - with this fix we use a regex instead of bare string for replacement and add a negative lookahead to it so that it doesn't replace `lodash/fp` imports Co-authored-by: Anton Gilgur --- package.json | 1 + src/babelPluginTsdx.ts | 3 ++- test/e2e/fixtures/build-default/src/index.ts | 3 +++ test/e2e/tsdx-build-default.test.ts | 8 ++++++++ yarn.lock | 5 +++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index dd2393744..049a344ef 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "devDependencies": { "@types/eslint": "^6.1.2", "@types/fs-extra": "^9.0.1", + "@types/lodash": "^4.14.161", "@types/node": "^14.11.1", "@types/react": "^16.9.11", "@types/rollup-plugin-json": "^3.0.2", diff --git a/src/babelPluginTsdx.ts b/src/babelPluginTsdx.ts index 525d60934..86999b600 100644 --- a/src/babelPluginTsdx.ts +++ b/src/babelPluginTsdx.ts @@ -10,7 +10,8 @@ export const isTruthy = (obj?: any) => { return obj.constructor !== Object || Object.keys(obj).length > 0; }; -const replacements = [{ original: 'lodash', replacement: 'lodash-es' }]; +// replace lodash with lodash-es, but not lodash/fp +const replacements = [{ original: 'lodash(?!/fp)', replacement: 'lodash-es' }]; export const mergeConfigItems = (type: any, ...configItemsToMerge: any[]) => { const mergedItems: any[] = []; diff --git a/test/e2e/fixtures/build-default/src/index.ts b/test/e2e/fixtures/build-default/src/index.ts index 308bd9487..ca8751686 100644 --- a/test/e2e/fixtures/build-default/src/index.ts +++ b/test/e2e/fixtures/build-default/src/index.ts @@ -6,6 +6,9 @@ import './syntax/jsx-import/JSX-import-JSX'; import './syntax/async'; export { testGenerator } from './syntax/generator'; +export { kebabCase } from 'lodash'; +export { merge, mergeAll } from 'lodash/fp'; + export { foo } from './foo'; export const sum = (a: number, b: number) => { diff --git a/test/e2e/tsdx-build-default.test.ts b/test/e2e/tsdx-build-default.test.ts index f2d4c6618..ac90ad991 100644 --- a/test/e2e/tsdx-build-default.test.ts +++ b/test/e2e/tsdx-build-default.test.ts @@ -67,6 +67,14 @@ describe('tsdx build :: zero-config defaults', () => { expect(matched).toBeFalsy(); }); + it("shouldn't replace lodash/fp", () => { + const output = execWithCache('node ../dist/index.js build'); + expect(output.code).toBe(0); + + const matched = grep(/lodash\/fp/, ['dist/build-default.*.js']); + expect(matched).toBeTruthy(); + }); + it('should clean the dist directory before rebuilding', () => { let output = execWithCache('node ../dist/index.js build'); expect(output.code).toBe(0); diff --git a/yarn.lock b/yarn.lock index 0551fb8b3..d2537640e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1314,6 +1314,11 @@ dependencies: "@types/node" "*" +"@types/lodash@^4.14.161": + version "4.14.161" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.161.tgz#a21ca0777dabc6e4f44f3d07f37b765f54188b18" + integrity sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA== + "@types/minimatch@*", "@types/minimatch@^3.0.3": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" From 9c4ce68bbbd8ae06414b68f33ffcb9ddc27e75d8 Mon Sep 17 00:00:00 2001 From: Altrim Beqiri Date: Fri, 25 Sep 2020 10:14:37 +0200 Subject: [PATCH 04/10] test: ensure lodash-es replacement is done properly - lodash for CJS, lodash-es for ESM - previously, there were no tests for this behavior, so this adds them to ensure the replacement continues to work, even with the new fix with regex lookahead for `lodash/fp` Co-authored-by: Anton Gilgur --- test/e2e/tsdx-build-default.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/e2e/tsdx-build-default.test.ts b/test/e2e/tsdx-build-default.test.ts index ac90ad991..1f88d1ab1 100644 --- a/test/e2e/tsdx-build-default.test.ts +++ b/test/e2e/tsdx-build-default.test.ts @@ -67,6 +67,22 @@ describe('tsdx build :: zero-config defaults', () => { expect(matched).toBeFalsy(); }); + it('should use lodash for the CJS build', () => { + const output = execWithCache('node ../dist/index.js build'); + expect(output.code).toBe(0); + + const matched = grep(/lodash/, ['dist/build-default.cjs.*.js']); + expect(matched).toBeTruthy(); + }); + + it('should use lodash-es for the ESM build', () => { + const output = execWithCache('node ../dist/index.js build'); + expect(output.code).toBe(0); + + const matched = grep(/lodash-es/, ['dist/build-default.esm.js']); + expect(matched).toBeTruthy(); + }); + it("shouldn't replace lodash/fp", () => { const output = execWithCache('node ../dist/index.js build'); expect(output.code).toBe(0); From d292dd992ce9659566c41385ffbf640736717eb3 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2020 17:09:30 -0400 Subject: [PATCH 05/10] docs: add altrim as a contributor (#895) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 11 +++++++++++ README.md | 1 + 2 files changed, 12 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index a0063b091..edb2843a3 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -961,6 +961,17 @@ "contributions": [ "code" ] + }, + { + "login": "altrim", + "name": "Altrim Beqiri", + "avatar_url": "https://avatars0.githubusercontent.com/u/602300?v=4", + "profile": "http://www.altrimbeqiri.com", + "contributions": [ + "bug", + "code", + "test" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 0d5265e42..c2ef43e9c 100644 --- a/README.md +++ b/README.md @@ -654,6 +654,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Vladislav Moiseev

💻
Felix Mosheev

🐛
Ludovico Fischer

💻 +
Altrim Beqiri

🐛 💻 ⚠️ From e3e80d61574888a5c133fbd042a28373a79ad1b9 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Fri, 9 Oct 2020 17:00:18 -0400 Subject: [PATCH 06/10] Create CODE_OF_CONDUCT.md (#899) --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..2f0479305 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at hello@formium.io. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From eaa1c3b590ee7882487a7f250003eb0f5f79a770 Mon Sep 17 00:00:00 2001 From: Tane Morgan <464864+tanem@users.noreply.github.com> Date: Wed, 7 Oct 2020 06:49:30 +1300 Subject: [PATCH 07/10] fix/deps: upgrade rpts2 to fix cache issue - fixes a cache issue with certain builds by upgrading to the most recent version of rollup-plugin-typescript2, v0.27.3, which just had a PR and release for this specific cache issue 2 weeks ago - there were no relevant breaking changes in the upgrade from rpts2 v0.26 to v0.27.0, so this should be a straight bugfix --- package.json | 2 +- yarn.lock | 52 +++++++++++++++++++++++++--------------------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 049a344ef..6d3cb2585 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "rollup": "^1.32.1", "rollup-plugin-sourcemaps": "^0.6.2", "rollup-plugin-terser": "^5.1.2", - "rollup-plugin-typescript2": "^0.26.0", + "rollup-plugin-typescript2": "^0.27.3", "sade": "^1.4.2", "semver": "^7.1.1", "shelljs": "^0.8.3", diff --git a/yarn.lock b/yarn.lock index d2537640e..29a9e1e09 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3559,13 +3559,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-cache-dir@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.2.0.tgz#e7fe44c1abc1299f516146e563108fd1006c1874" - integrity sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== +find-cache-dir@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== dependencies: commondir "^1.0.1" - make-dir "^3.0.0" + make-dir "^3.0.2" pkg-dir "^4.1.0" find-up@^2.0.0, find-up@^2.1.0: @@ -5412,10 +5412,10 @@ magic-string@^0.25.2: dependencies: sourcemap-codec "^1.4.4" -make-dir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.0.tgz#1b5f39f6b9270ed33f9f054c5c0f84304989f801" - integrity sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw== +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" @@ -7105,14 +7105,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.15.1: - version "1.15.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" - integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== - dependencies: - path-parse "^1.0.6" - -resolve@1.x, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.5.0: +resolve@1.17.0, resolve@1.x, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.5.0: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -7217,18 +7210,18 @@ rollup-plugin-terser@^5.1.2: serialize-javascript "^1.7.0" terser "^4.1.0" -rollup-plugin-typescript2@^0.26.0: - version "0.26.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.26.0.tgz#cee2b44d51d9623686656d76dc30a73c4de91672" - integrity sha512-lUK7XZVG77tu8dmv1L/0LZFlavED/5Yo6e4iMMl6fdox/yKdj4IFRRPPJEXNdmEaT1nDQQeCi7b5IwKHffMNeg== +rollup-plugin-typescript2@^0.27.3: + version "0.27.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.3.tgz#cd9455ac026d325b20c5728d2cc54a08a771b68b" + integrity sha512-gmYPIFmALj9D3Ga1ZbTZAKTXq1JKlTQBtj299DXhqYz9cL3g/AQfUvbb2UhH+Nf++cCq941W2Mv7UcrcgLzJJg== dependencies: - find-cache-dir "^3.2.0" + "@rollup/pluginutils" "^3.1.0" + find-cache-dir "^3.3.1" fs-extra "8.1.0" - resolve "1.15.1" - rollup-pluginutils "2.8.2" - tslib "1.10.0" + resolve "1.17.0" + tslib "2.0.1" -rollup-pluginutils@2.8.2, rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1: +rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== @@ -8093,7 +8086,12 @@ ts-jest@^25.3.1: semver "6.x" yargs-parser "18.x" -tslib@1.10.0, tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" + integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== + +tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== From e2f1b76d0fd0b574c1b9764f7150a8eb2ff5b17f Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Mon, 12 Oct 2020 17:11:55 -0400 Subject: [PATCH 08/10] test: add a smoke test that builds _all_ formats - there was never a test that built all, meaning tests left out the somewhat popular UMD build in particular - per my investigation, CJS + UMD, CJS + System, UMD + System started bugging out recently due to an upstream bug, but this wasn't known proactively because there were no tests for it - and I also found that CJS + System actually was bugging out in the previous version, TSDX v0.13.3, but I'm guessing no one reported it back then as it's an unpopular combination of formats - this test fails prior to upgrade of rpts2 to v0.27.3 and succeeds after the upgrade - so this should act as a regression test against this bug as well - created a new e2e build-options test file for this because build-default is meant to have 0 options and test only the defaults - had to give it a differentiated "stage" name as it uses the same build-default fixture and so breaks during test parallelization without that - should also move the regeneratorRuntime `--target node` test here since that's an option and not a default --- test/e2e/tsdx-build-options.test.ts | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 test/e2e/tsdx-build-options.test.ts diff --git a/test/e2e/tsdx-build-options.test.ts b/test/e2e/tsdx-build-options.test.ts new file mode 100644 index 000000000..ded530033 --- /dev/null +++ b/test/e2e/tsdx-build-options.test.ts @@ -0,0 +1,53 @@ +import * as shell from 'shelljs'; + +import * as util from '../utils/fixture'; +import { execWithCache } from '../utils/shell'; + +shell.config.silent = false; + +const testDir = 'e2e'; +const fixtureName = 'build-default'; +// create a second version of build-default's stage for concurrent testing +const stageName = 'stage-build-options'; + +describe('tsdx build :: options', () => { + beforeAll(() => { + util.teardownStage(stageName); + util.setupStageWithFixture(testDir, stageName, fixtureName); + }); + + it('should compile all formats', () => { + const output = execWithCache( + 'node ../dist/index.js build --format cjs,esm,umd,system' + ); + + expect(shell.test('-f', 'dist/index.js')).toBeTruthy(); + expect( + shell.test('-f', 'dist/build-default.cjs.development.js') + ).toBeTruthy(); + expect( + shell.test('-f', 'dist/build-default.cjs.production.min.js') + ).toBeTruthy(); + expect(shell.test('-f', 'dist/build-default.esm.js')).toBeTruthy(); + expect( + shell.test('-f', 'dist/build-default.umd.development.js') + ).toBeTruthy(); + expect( + shell.test('-f', 'dist/build-default.umd.production.min.js') + ).toBeTruthy(); + expect( + shell.test('-f', 'dist/build-default.system.development.js') + ).toBeTruthy(); + expect( + shell.test('-f', 'dist/build-default.system.production.min.js') + ).toBeTruthy(); + + expect(shell.test('-f', 'dist/index.d.ts')).toBeTruthy(); + + expect(output.code).toBe(0); + }); + + afterAll(() => { + util.teardownStage(stageName); + }); +}); From 81c8b2db4c62ef40a25e058fcc55dc8553d18121 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2020 18:11:43 -0400 Subject: [PATCH 09/10] docs: add tanem as a contributor (#902) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index edb2843a3..4278d97e1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -972,6 +972,16 @@ "code", "test" ] + }, + { + "login": "tanem", + "name": "Tane Morgan", + "avatar_url": "https://avatars3.githubusercontent.com/u/464864?v=4", + "profile": "https://github.com/tanem", + "contributions": [ + "bug", + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index c2ef43e9c..d008aa1e6 100644 --- a/README.md +++ b/README.md @@ -655,6 +655,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Felix Mosheev

🐛
Ludovico Fischer

💻
Altrim Beqiri

🐛 💻 ⚠️ +
Tane Morgan

🐛 💻 From 64c50943905c983c98613944d50c20565efe6691 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Tue, 13 Oct 2020 00:47:27 -0400 Subject: [PATCH 10/10] v0.14.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d3cb2585..6b596eb54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tsdx", - "version": "0.14.0", + "version": "0.14.1", "author": "Jared Palmer ", "description": "Zero-config TypeScript package development", "license": "MIT",