Skip to content

Commit

Permalink
Update loom to v1 (#2150)
Browse files Browse the repository at this point in the history
* Update loom to v1

Babel gets updated along the way. Build output is borderline identical -
there's a small change to some babel helper functions, but code remains
functionally identical

* Update node CI version to 12.22

We still claim support for 12.14 and up, but loom v1 requires 12.22 so
thats the min version we can test against.

We'll be dropping support for node 12 soon I'm not to worried by this.
  • Loading branch information
BPScott committed Feb 1, 2022
1 parent 8b3eefc commit 1a93291
Show file tree
Hide file tree
Showing 149 changed files with 1,664 additions and 1,533 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['12.14', '14.x', '16.x']
node-version: ['12.22', '14.x', '16.x']
timeout-minutes: 15

steps:
Expand Down
27 changes: 18 additions & 9 deletions config/loom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import {
createComposedProjectPlugin,
createProjectTestPlugin,
} from '@shopify/loom';
import {babel} from '@shopify/loom-plugin-babel';
import {packageBuild} from '@shopify/loom-plugin-package-build';
import {buildLibrary, babel} from '@shopify/loom-plugin-build-library';

// Needed so TS realises what configuration hooks are provided by Jest
import type {} from '@shopify/loom-plugin-jest';

export function quiltPackage({
isIsomorphic = true,
jestEnv = 'jsdom',
jestTestRunner = 'jest-circus',
polyfill = true,
Expand All @@ -16,7 +18,19 @@ export function quiltPackage({
// occur we need to turn some options off
const polyfillOptions = polyfill ? {} : {useBuiltIns: false, corejs: false};

const targets = isIsomorphic
? 'extends @shopify/browserslist-config, node 12.14.0'
: 'node 12.14.0';

return createComposedProjectPlugin<Package>('Quilt.Package', [
buildLibrary({
targets,
commonjs: true,
esmodules: true,
esnext: true,
rootEntrypoints: true,
jestTestEnvironment: jestEnv,
}),
babel({
config: {
presets: [
Expand All @@ -27,21 +41,16 @@ export function quiltPackage({
],
},
}),
packageBuild({
nodeTargets: 'node 12.14.0',
browserTargets: 'extends @shopify/browserslist-config',
}),
createProjectTestPlugin('Quilt.PackageTest', ({hooks}) => {
hooks.configure.hook((hooks) => {
hooks.jestEnvironment?.hook(() => jestEnv);
hooks.jestTestRunner?.hook(() => jestTestRunner);

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

hooks.jestWatchIgnore?.hook((patterns) => [
hooks.jestWatchPathIgnorePatterns?.hook((patterns) => [
...patterns,
'<rootDir>/.*/tests?/.*fixtures',
]);
Expand Down
12 changes: 8 additions & 4 deletions loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import {createWorkspace, createWorkspaceTestPlugin} from '@shopify/loom';
import {
buildLibrary,
buildLibraryWorkspace,
} from '@shopify/loom-plugin-build-library';
import {eslint} from '@shopify/loom-plugin-eslint';
import {jest} from '@shopify/loom-plugin-jest';
import {prettier} from '@shopify/loom-plugin-prettier';
import {workspaceTypeScript} from '@shopify/loom-plugin-typescript';

// Needed so TS realises what configuration hooks are provided by Jest
import type {} from '@shopify/loom-plugin-jest';

export default createWorkspace((workspace) => {
workspace.use(
buildLibraryWorkspace(),
eslint(),
prettier({files: '**/*.{md,json,yaml,yml}'}),
jest(),
workspaceTypeScript(),
runWorkspaceTests(),
);
});
Expand Down
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,14 @@
"@babel/core": "^7.14.6",
"@faker-js/faker": "^5.5.3",
"@shopify/app-bridge": "^2.0.3",
"@shopify/babel-preset": "^24.1.2",
"@shopify/babel-preset": "^24.1.4",
"@shopify/browserslist-config": "^2.2.4",
"@shopify/eslint-plugin": "^40.2.3",
"@shopify/loom": "^0.7.0",
"@shopify/loom-cli": "^0.7.0",
"@shopify/loom-plugin-babel": "^0.3.0",
"@shopify/loom-plugin-eslint": "^0.5.0",
"@shopify/loom-plugin-jest": "^0.6.0",
"@shopify/loom-plugin-package-build": "^0.7.0",
"@shopify/loom-plugin-prettier": "^0.2.0",
"@shopify/loom-plugin-typescript": "^0.8.0",
"@shopify/loom": "^1.0.1",
"@shopify/loom-cli": "^1.0.1",
"@shopify/loom-plugin-build-library": "^1.0.1",
"@shopify/loom-plugin-eslint": "^2.0.0",
"@shopify/loom-plugin-prettier": "^2.0.0",
"@shopify/typescript-configs": "^5.0.0",
"@types/faker": "^5.5.9",
"@types/react": "17.0.13",
Expand All @@ -59,6 +56,7 @@
"babel-loader": "^8.0.6",
"cross-fetch": "^3.0.4",
"element-closest": "^3.0.1",
"eslint": "^7.0.0",
"fs-extra": "^9.1.0",
"full-icu": "^1.3.0",
"get-port": "^5.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/address-consts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 3.0.6 - 2021-09-24

Expand Down
5 changes: 2 additions & 3 deletions packages/address-consts/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/address-mocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 2.0.13 - 2022-01-06

Expand Down
5 changes: 2 additions & 3 deletions packages/address-mocks/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/address/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 3.0.13 - 2022-01-06

Expand Down
5 changes: 2 additions & 3 deletions packages/address/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/admin-graphql-api-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 1.0.5 - 2021-09-24

Expand Down
5 changes: 2 additions & 3 deletions packages/admin-graphql-api-utilities/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/ast-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 1.3.0 - 2022-01-06

Expand Down
9 changes: 4 additions & 5 deletions packages/ast-utilities/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'javascript', root: './src/javascript'});
pkg.entry({name: 'markdown', root: './src/markdown'});
pkg.entry({root: './src/index.ts'});
pkg.entry({name: 'javascript', root: './src/javascript/index.ts'});
pkg.entry({name: 'markdown', root: './src/markdown/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/async/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 3.1.0 - 2021-12-01

Expand Down
7 changes: 3 additions & 4 deletions packages/async/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'babel', root: './src/babel-plugin'});
pkg.entry({root: './src/index.ts'});
pkg.entry({name: 'babel', root: './src/babel-plugin.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/browser/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 2.0.5 - 2021-11-01

Expand Down
5 changes: 2 additions & 3 deletions packages/browser/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/csrf-token-fetcher/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 1.0.4 - 2021-09-24

Expand Down
5 changes: 2 additions & 3 deletions packages/csrf-token-fetcher/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/css-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 2.0.5 - 2021-09-24

Expand Down
5 changes: 2 additions & 3 deletions packages/css-utilities/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/dates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 1.1.0 - 2022-01-28

Expand Down
5 changes: 2 additions & 3 deletions packages/dates/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/decorators/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 2.0.4 - 2021-09-24

Expand Down
5 changes: 2 additions & 3 deletions packages/decorators/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/function-enhancers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 2.0.4 - 2021-09-24

Expand Down
5 changes: 2 additions & 3 deletions packages/function-enhancers/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/graphql-config-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]
- Clean test output. [[#2091](https://github.com/Shopify/quilt/pull/2091)]

## 3.0.6 - 2021-11-22
Expand Down
5 changes: 2 additions & 3 deletions packages/graphql-config-utilities/loom.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {createPackage, Runtime} from '@shopify/loom';
import {createPackage} from '@shopify/loom';

import {quiltPackage} from '../../config/loom';

export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({root: './src/index.ts'});
pkg.use(quiltPackage());
});
1 change: 1 addition & 0 deletions packages/graphql-fixtures/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed

- Reorder exports map to prioritize the `esnext` condition. [[#2148](https://github.com/Shopify/quilt/pull/2148)]
- Update Loom build config. [[#2150](https://github.com/Shopify/quilt/pull/2150)]

## 1.2.1 - 2022-01-26

Expand Down
Loading

0 comments on commit 1a93291

Please sign in to comment.