Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conf: add mjs/cjs exports #299

Merged
merged 1 commit into from
Aug 8, 2020
Merged

conf: add mjs/cjs exports #299

merged 1 commit into from
Aug 8, 2020

Conversation

ealush
Copy link
Owner

@ealush ealush commented Aug 7, 2020

Q A
Bug fix?
New feature?
Breaking change?
Deprecations?
Documentation?
Tests added?
Fixed issues #298

require vs import

Depending on your node version and the module system you support you can use different syntax to include Vest.

Most compatible: commonjs

To be on the safe side and compatible with all node versions, use a require statement.

const vest = require('vest');
const { test, enforce } = vest;

Depending on your node version and used flag, your require statement might default to Vest's minified es5 bundle. If you want to make sure to use the non-minified es6 commonjs bundle, you can require it directly.

const vest = require('vest/vest.cjs.js');
const { test, enforce } = vest;

For supported environments: esm

If you want to explicitly load Vest's esm module, you can import it directly:

import vest, { test } from 'vest/esm/vest.mjs.js';

Node 14

With node 14's support of package entry points, node should be able to detect on its own which import style you use and load the correct bundle.

Both of the following should work:

import vest, { test } from 'vest';
const vest = require('vest');

@ealush ealush force-pushed the 2020-08-06-node_build branch 3 times, most recently from f8dbb6b to 3bb138d Compare August 7, 2020 19:56
@ealush ealush changed the title 2020 08 06 node build Add dedicated node build Aug 7, 2020
@ealush ealush mentioned this pull request Aug 7, 2020
@ealush ealush force-pushed the 2020-08-06-node_build branch 7 times, most recently from 2e22e4d to 408f5cd Compare August 7, 2020 20:39
@ealush ealush marked this pull request as ready for review August 7, 2020 20:48
@ealush ealush force-pushed the 2020-08-06-node_build branch 8 times, most recently from f078398 to 884d676 Compare August 7, 2020 22:21
@ealush ealush changed the title Add dedicated node build conf: add mjs/cjs exports Aug 8, 2020
@ealush ealush merged commit fe5784d into latest Aug 8, 2020
@ealush ealush deleted the 2020-08-06-node_build branch August 8, 2020 19:15
ealush added a commit that referenced this pull request Aug 9, 2020
3017a02 build(deps): bump @babel/core from 7.10.2 to 7.10.3 (dependabot-preview[bot])
a45d52d build(deps): bump eslint-plugin-jest from 23.13.2 to 23.17.1 (dependabot-preview[bot])
f4f608b build(deps): bump @babel/register from 7.10.1 to 7.10.3 (dependabot-preview[bot])
cc5b352 build(deps): bump rollup from 2.17.1 to 2.18.0 (dependabot-preview[bot])
c2c61d0 build(deps): bump eslint from 7.3.0 to 7.3.1 (dependabot-preview[bot])
ba2870c build(deps): bump @babel/cli from 7.10.1 to 7.10.3 (dependabot-preview[bot])
400b154 build(deps): bump @babel/plugin-transform-object-assign (dependabot-preview[bot])
a15d892 build(deps): bump @babel/preset-env from 7.10.2 to 7.10.3 (dependabot-preview[bot])
70f9414 build(deps): bump babel-jest from 26.0.1 to 26.1.0 (dependabot-preview[bot])
6fb6481 build(deps): bump jest-cli from 26.0.1 to 26.1.0 (dependabot-preview[bot])
dccf8c7 build(deps): bump jest from 26.0.1 to 26.1.0 (dependabot-preview[bot])
2d032a7 conf: Update changelog generation (ealush)
d1ce227 minor: add vest.skip.group and vest.only.group (#225) (ealush)
d9aafbc build(deps): bump eslint-plugin-import from 2.21.2 to 2.22.0 (dependabot-preview[bot])
93501ae build(deps): bump rollup from 2.18.0 to 2.18.1 (dependabot-preview[bot])
e52d9b9 build(deps): bump @babel/plugin-proposal-pipeline-operator (dependabot-preview[bot])
f9e7379 build(deps): bump @babel/core from 7.10.3 to 7.10.4 (dependabot-preview[bot])
20e78c1 build(deps): bump @babel/plugin-transform-object-assign (dependabot-preview[bot])
7e90602 build(deps): bump @babel/cli from 7.10.3 to 7.10.4 (dependabot-preview[bot])
826bd41 build(deps): bump @babel/plugin-proposal-optional-chaining (dependabot-preview[bot])
d1963f1 build(deps): bump @babel/register from 7.10.3 to 7.10.4 (dependabot-preview[bot])
ba6ca3d fix: make vest.reset restore initial state (#235) (ealush)
5ee43b5 docs: add groups codesandbox demo (ealush)
e70117b build(deps): bump rollup from 2.18.1 to 2.18.2 (dependabot-preview[bot])
a657058 patch: cache validation result for improved runtime performance (#237) (ealush)
efa240c docs: update examples (ealush)
881adc6 build(deps): bump rollup from 2.18.2 to 2.19.0 (dependabot-preview[bot])
9c63f43 build(deps): bump eslint-plugin-jest from 23.17.1 to 23.18.0 (dependabot-preview[bot])
b218b3e build(deps): bump eslint from 7.3.1 to 7.4.0 (dependabot-preview[bot])
781b246 build(deps): bump rollup from 2.19.0 to 2.20.0 (dependabot-preview[bot])
852e23a build(deps): bump rollup from 2.20.0 to 2.21.0 (dependabot-preview[bot])
96210af Skip cache when resolving done results (#240) (ealush)
6b7ebba conf: transform runtime in test environment (ealush)
919fa37 build(deps): bump @babel/preset-env from 7.10.3 to 7.10.4 (dependabot-preview[bot])
19e592e added: test.memo for memoized tests (#238) (ealush)
1a86ee1 docs: add Vue example (#250) (eyalcohen4)
c2beec9 fix: edge case when calling done after delay (#252) (ealush)
cbd17a9 conf: Added definitions file (#251) (ealush)
fe19ab7 build(deps): bump @babel/core from 7.10.4 to 7.10.5 (dependabot-preview[bot])
88f3cf9 build(deps): bump @babel/register from 7.10.4 to 7.10.5 (dependabot-preview[bot])
7246926 build(deps): bump @babel/plugin-transform-runtime from 7.10.4 to 7.10.5 (dependabot-preview[bot])
eed6456 build(deps): bump @babel/cli from 7.10.4 to 7.10.5 (dependabot-preview[bot])
62966d9 build(deps): bump @babel/plugin-proposal-pipeline-operator (dependabot-preview[bot])
2582c43 types: group and skip types (#258) (ealush)
a386954 docs: update readme (ealush)
a215c43 patch: return enforce from extend api (ealush)
7de8b2c conf: Change branching strategy. Master is now latest. (ealush)
172ae29 build(deps): bump @lets/wait from 1.0.0 to 2.0.2 (dependabot-preview[bot])
b0a4d71 build(deps): bump typescript from 3.9.6 to 3.9.7 (dependabot-preview[bot])
015793f docs: move docs into package directory (ealush)
3f239d7 build(deps): bump date-fns from 2.14.0 to 2.15.0 (dependabot-preview[bot])
e1d330a build(deps): bump rollup from 2.21.0 to 2.22.1 (dependabot-preview[bot])
d1c3f73 build(deps): bump eslint from 7.4.0 to 7.5.0 (dependabot-preview[bot])
74ea245 conf: Use dedicated docs script (ealush)
f7d5d5b conf: update enforce rules generation (ealush)
7526d15 conf: add type declarations for all modules (#265) (ealush)
7978443 build(deps): bump rollup from 2.22.1 to 2.22.2 (dependabot-preview[bot])
bb6cc1d fix: added safeguard to async test inference (#266) (ealush)
2c98206 build(deps): bump rollup from 2.22.2 to 2.23.0 (dependabot-preview[bot])
ff5608f Update README.md (ealush)
fb4292a build(deps): bump eslint-plugin-jest from 23.18.0 to 23.18.2 (dependabot-preview[bot])
e6cccc9 added: returned function name is the name of the suite (ealush)
41bdffd build(deps): bump eslint-plugin-jest from 23.18.2 to 23.19.0 (dependabot-preview[bot])
53894ae conf: Add development build (#273) (ealush)
553c8fe patch: Move exclusion to context (#274) (ealush)
4f24697 patch: Replace global object with closures (#275) (ealush)
37ec210 docs: update README (ealush)
b9f7a97 build(deps): bump eslint-plugin-jest from 23.19.0 to 23.20.0 (dependabot-preview[bot])
614b91f build(deps): bump jest from 26.1.0 to 26.2.1 (dependabot-preview[bot])
0721c9a build(deps): bump @babel/plugin-transform-runtime from 7.10.5 to 7.11.0 (dependabot-preview[bot])
09eb48e build(deps): bump mocha from 8.0.1 to 8.1.0 (dependabot-preview[bot])
8350103 build(deps): bump @babel/plugin-proposal-optional-chaining (dependabot-preview[bot])
59da262 build(deps): bump @babel/preset-env from 7.10.4 to 7.11.0 (dependabot-preview[bot])
7fe0e6a build(deps): bump babel-jest from 26.1.0 to 26.2.1 (dependabot-preview[bot])
69eacb3 build(deps): bump @babel/core from 7.10.5 to 7.11.0 (dependabot-preview[bot])
a3bc606 patch: clean runAsyncTest done callback (ealush)
4d3b583 Update README.md (ealush)
32ea43f Use latest branch (ealush)
51e7aa2 patch: Skip iteration of pending tests (#294) (ealush)
fe5784d conf: add mjs/cjs exports (#299) (ealush)
f9f1d39 added: promisify utility (#261) (adife)
062c40a added: [n4s] add isNaN rule (#300) (ealush)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant