Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Update sewing-kit, babel, and jest #1948

Merged
merged 8 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions config/sewing-kit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import {} from '@sewing-kit/plugin-jest';

import {addLegacyDecoratorSupport} from './plugin';

export function quiltPackage({jestEnv = 'jsdom', useReact = false} = {}) {
export function quiltPackage({
jestEnv = 'jsdom',
useReact = false,
jestTestRunner = 'jest-circus',
} = {}) {
return createComposedProjectPlugin<Package>('Quilt.Package', [
javascript(),
typescript(),
Expand All @@ -23,8 +27,8 @@ export function quiltPackage({jestEnv = 'jsdom', useReact = false} = {}) {
}),
createProjectBuildPlugin('Quilt.PackageBuild', ({hooks}) => {
hooks.target.hook(({hooks}) => {
hooks.configure.hook(hooks => {
hooks.babelIgnorePatterns?.hook(ext => [
hooks.configure.hook((hooks) => {
hooks.babelIgnorePatterns?.hook((ext) => [
...ext,
'**/test/**/*',
'**/tests/**/*',
Expand All @@ -35,15 +39,22 @@ export function quiltPackage({jestEnv = 'jsdom', useReact = false} = {}) {
});
}),
createProjectTestPlugin('Quilt.PackageTest', ({hooks}) => {
hooks.configure.hook(hooks => {
hooks.configure.hook((hooks) => {
hooks.jestEnvironment?.hook(() => jestEnv);

hooks.jestTransforms?.hook(transforms => ({
hooks.jestTransforms?.hook((transforms) => ({
...transforms,
'\\.(gql|graphql)$': 'jest-transform-graphql',
}));

hooks.jestWatchIgnore?.hook(patterns => [
hooks.jestConfig?.hook((jestConfig) => {
return {
...jestConfig,
testRunner: jestTestRunner,
};
});

hooks.jestWatchIgnore?.hook((patterns) => [
...patterns,
'<rootDir>/.*/tests?/.*fixtures',
]);
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@
"devDependencies": {
"@apollo/react-common": "^3.1.3",
"@apollo/react-hooks": "^3.1.3",
"@babel/core": "^7.11.6",
"@sewing-kit/cli": "^0.4.0",
"@sewing-kit/config": "^0.2.0",
"@sewing-kit/plugin-eslint": "^0.2.0",
"@sewing-kit/plugin-javascript": "^0.4.1",
"@sewing-kit/plugin-jest": "^0.2.1",
"@sewing-kit/plugin-package-build": "^0.2.3",
"@sewing-kit/plugin-react": "^0.2.0",
"@sewing-kit/plugin-typescript": "^0.2.1",
"@sewing-kit/plugins": "^0.2.0",
"@shopify/app-bridge": "^0.7.3",
"@shopify/babel-preset": "^23.6.1",
"@babel/core": "^7.14.6",
"@sewing-kit/cli": "^0.4.2",
"@sewing-kit/config": "^0.2.1",
"@sewing-kit/plugin-eslint": "^0.2.1",
"@sewing-kit/plugin-javascript": "^0.4.2",
"@sewing-kit/plugin-jest": "^0.3.0",
"@sewing-kit/plugin-package-build": "^0.2.4",
"@sewing-kit/plugin-react": "^0.2.1",
"@sewing-kit/plugin-typescript": "^0.3.0",
"@sewing-kit/plugins": "^0.2.1",
"@shopify/app-bridge": "^2.0.3",
"@shopify/babel-preset": "^24.0.2",
"@shopify/browserslist-config": "^2.2.4",
"@shopify/eslint-plugin": "^40.2.3",
"@shopify/typescript-configs": "^4.0.0",
"@shopify/typescript-configs": "^5.0.0",
"@types/enzyme": "^3.10.5",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/faker": "^4.1.5",
Expand Down
6 changes: 5 additions & 1 deletion packages/ast-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Changed

- Update `@babel/template` to `^7.14.5` [#1948](https://github.com/Shopify/quilt/pull/1948)

## 1.0.0 - 2021-05-21

Expand Down
2 changes: 1 addition & 1 deletion packages/ast-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"markdown.d.ts"
],
"dependencies": {
"@babel/template": "^7.6.0",
"@babel/template": "^7.14.5",
"@babel/traverse": ">=7.0.0",
"@babel/types": ">=7.0.0",
"jest-matcher-utils": "^26.6.2",
Expand Down
6 changes: 5 additions & 1 deletion packages/graphql-typescript-definitions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Changed

- Update `@babel/generator` and `@babel/types to`^7.14.5` [#1948](https://github.com/Shopify/quilt/pull/1948)

## 2.0.3 - 2021-06-17

Expand Down
4 changes: 2 additions & 2 deletions packages/graphql-typescript-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"node": ">=12.14.0"
},
"dependencies": {
"@babel/generator": "^7.4.0",
"@babel/types": "^7.4.0",
"@babel/generator": "^7.14.5",
"@babel/types": "^7.14.5",
"@types/babel__generator": "^7.0.2",
"@types/chokidar": "^2.1.3",
"@types/yargs": "15.0.4",
Expand Down
6 changes: 5 additions & 1 deletion packages/magic-entries-webpack-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Changed

- Include `setImmediate` in tests. [#1948](https://github.com/Shopify/quilt/pull/1948)

## 1.2.0 - 2021-06-08

Expand Down
1 change: 1 addition & 0 deletions packages/magic-entries-webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
],
"devDependencies": {
"@types/webpack-virtual-modules": "^0.1.0",
"setimmediate": "^1.0.5",
"webpack-virtual-modules": "^0.4.3"
},
"module": "index.mjs",
Expand Down
4 changes: 2 additions & 2 deletions packages/magic-entries-webpack-plugin/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
pkg.use(quiltPackage({jestEnv: 'node'}));
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'setimmediate';
import webpack, {Compiler, Configuration, Stats} from 'webpack';
import VirtualModulesPlugin from 'webpack-virtual-modules';

Expand Down
6 changes: 5 additions & 1 deletion packages/react-i18n/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Changed

- Update `@babel/core` to `^7.14.6` [#1948](https://github.com/Shopify/quilt/pull/1948)

## 6.0.2 - 2021-06-17

Expand Down
2 changes: 1 addition & 1 deletion packages/react-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"node": ">=12.14.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/core": "^7.14.6",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/types": ">=7.0.0",
"@types/babel__core": "^7.0.4",
Expand Down
6 changes: 5 additions & 1 deletion packages/react-server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Changed

- Include `setImmediate` in tests. [#1948](https://github.com/Shopify/quilt/pull/1948)

## 1.1.0 - 2021-06-08

Expand Down
1 change: 1 addition & 0 deletions packages/react-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"react": "^16.8.1",
"react-dom": "^16.8.1",
"saddle-up": "^0.5.1",
"setimmediate": "^1.0.5",
"webpack": "^4.25.1"
},
"peerDependencies": {
Expand Down
10 changes: 8 additions & 2 deletions packages/react-server/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'webpack-plugin', root: './src/webpack-plugin'});
pkg.use(quiltPackage({useReact: true}));
pkg.use(
quiltPackage({
jestEnv: 'node',
jestTestRunner: 'jest-jasmine2',
useReact: true,
}),
);
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'setimmediate';

import path from 'path';

import webpack, {Compiler} from 'webpack';
Expand Down
4 changes: 4 additions & 0 deletions packages/semaphore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->

### Changed

- Remove use of `setImmediate` in tests. [#1948](https://github.com/Shopify/quilt/pull/1948)

## 2.0.0 - 2021-05-21

### Breaking Change
Expand Down
10 changes: 4 additions & 6 deletions packages/semaphore/src/test/Semaphore.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {Semaphore, Permit} from '..';

const endOfPollPhase = {then: setImmediate};

describe('Semaphore', () => {
describe('acquire()', () => {
it('resolves with a permit when counter is > 0', async () => {
Expand All @@ -22,7 +20,7 @@ describe('Semaphore', () => {
.then(spy)
.catch(() => {});

await endOfPollPhase;
await setTimeout(() => {}, 0);

expect(spy).not.toHaveBeenCalled();
});
Expand All @@ -48,7 +46,7 @@ describe('Semaphore', () => {
.then(spy)
.catch(() => {});

await endOfPollPhase;
await setTimeout(() => {}, 0);

expect(spy).not.toHaveBeenCalled();

Expand All @@ -75,7 +73,7 @@ describe('Semaphore', () => {
.then(spy4)
.catch(() => {});

await endOfPollPhase;
await setTimeout(() => {}, 0);

expect(spy3).not.toHaveBeenCalled();
expect(spy4).not.toHaveBeenCalled();
Expand Down Expand Up @@ -111,7 +109,7 @@ describe('Semaphore', () => {
.then(spy4)
.catch(() => {});

await endOfPollPhase;
await setTimeout(() => {}, 0);

expect(spy3).toHaveBeenCalledWith(expect.any(Permit));
expect(spy4).not.toHaveBeenCalled();
Expand Down
6 changes: 5 additions & 1 deletion packages/sewing-kit-plugin-quilt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Changed

- Update `@sewing-kit/*` packages [#1948](https://github.com/Shopify/quilt/pull/1948)

## 0.2.1 - 2021-06-17

Expand Down
24 changes: 12 additions & 12 deletions packages/sewing-kit-plugin-quilt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@
"@types/webpack-virtual-modules": "^0.1.0"
},
"dependencies": {
"@sewing-kit/plugin-css": "^0.2.0",
"@sewing-kit/plugin-eslint": "^0.2.0",
"@sewing-kit/plugin-graphql": "^0.2.0",
"@sewing-kit/plugin-javascript": "^0.4.0",
"@sewing-kit/plugin-jest": "^0.2.0",
"@sewing-kit/plugin-package-flexible-outputs": "^0.2.0",
"@sewing-kit/plugin-react": "^0.2.0",
"@sewing-kit/plugin-stylelint": "^0.2.0",
"@sewing-kit/plugin-typescript": "^0.2.0",
"@sewing-kit/plugin-web-app-base": "^0.2.0",
"@sewing-kit/plugin-webpack": "^0.2.0",
"@sewing-kit/plugins": "^0.2.0",
"@sewing-kit/plugin-css": "^0.2.1",
"@sewing-kit/plugin-eslint": "^0.2.1",
"@sewing-kit/plugin-graphql": "^0.2.1",
"@sewing-kit/plugin-javascript": "^0.4.2",
"@sewing-kit/plugin-jest": "^0.3.0",
"@sewing-kit/plugin-package-flexible-outputs": "^0.2.2",
"@sewing-kit/plugin-react": "^0.2.1",
"@sewing-kit/plugin-stylelint": "^0.2.1",
"@sewing-kit/plugin-typescript": "^0.3.0",
"@sewing-kit/plugin-web-app-base": "^0.2.2",
"@sewing-kit/plugin-webpack": "^0.2.1",
"@sewing-kit/plugins": "^0.2.1",
"@shopify/webpack-asset-metadata-plugin": "^2.0.3",
"@types/execa": "^0.9.0",
"browserslist": "^4.16.0",
Expand Down
Loading