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

Update to the latest version of skn #1980

Merged
merged 10 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
with:
path: |
.sewing-kit/
key: ${{ runner.os }}-node${{ matrix.node-version }}-sewing-kit-v1-${{ github.sha }}
key: ${{ runner.os }}-node${{ matrix.node-version }}-sewing-kit-v2-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node${{ matrix.node-version }}-sewing-kit-v1-
${{ runner.os }}-node${{ matrix.node-version }}-sewing-kit-v2-

- name: 📦 Install dependencies
run: yarn --frozen-lockfile
Expand Down
62 changes: 18 additions & 44 deletions config/sewing-kit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,49 @@ import {
Package,
createComposedProjectPlugin,
createProjectTestPlugin,
createProjectBuildPlugin,
} from '@sewing-kit/plugins';
import {react} from '@sewing-kit/plugin-react';
import {javascript, updateBabelPreset} from '@sewing-kit/plugin-javascript';
import {typescript} from '@sewing-kit/plugin-typescript';
} from '@sewing-kit/core';
import {babel} from '@sewing-kit/plugin-babel';
import {packageBuild} from '@sewing-kit/plugin-package-build';
import {} from '@sewing-kit/plugin-jest';

import {addLegacyDecoratorSupport} from './plugin';

export function quiltPackage({
jestEnv = 'jsdom',
useReact = false,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed useReact as there is no harm in enabling it for all packages

jestTestRunner = 'jest-circus',
polyfill = true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only package that overrides this and sets it to false is polyfills because we want that package to uh, provide the polyfills.

} = {}) {
// The babel preset polyfills by default, if we don't want polyfilling to
// occur we need to turn some options off
const polyfillOptions = polyfill ? {} : {useBuiltIns: false, corejs: false};

return createComposedProjectPlugin<Package>('Quilt.Package', [
javascript(),
typescript(),
useReact && react(),
babel({
config: {
presets: [
[
'@shopify/babel-preset',
{typescript: true, react: true, ...polyfillOptions},
],
],
},
}),
packageBuild({
nodeTargets: 'node 12.14.0',
browserTargets: 'extends @shopify/browserslist-config',
}),
createProjectBuildPlugin('Quilt.PackageBuild', ({hooks}) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

babelIgnorePatterns no longer exists, and we don't need to add legacy decorator support because @shopify/babel-preset already enables it correctly

hooks.target.hook(({hooks}) => {
hooks.configure.hook((hooks) => {
hooks.babelIgnorePatterns?.hook((ext) => [
...ext,
'**/test/**/*',
'**/tests/**/*',
]);

hooks.babelConfig?.hook(addLegacyDecoratorSupport);
});
});
}),
createProjectTestPlugin('Quilt.PackageTest', ({hooks}) => {
hooks.configure.hook((hooks) => {
hooks.jestEnvironment?.hook(() => jestEnv);
hooks.jestTestRunner?.hook(() => jestTestRunner);

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

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

hooks.jestWatchIgnore?.hook((patterns) => [
...patterns,
'<rootDir>/.*/tests?/.*fixtures',
]);

hooks.babelConfig?.hook(addLegacyDecoratorSupport);

// Each test imports from react-testing during setup
hooks.babelConfig?.hook(
updateBabelPreset(
['@babel/preset-react', require.resolve('@babel/preset-react')],
{
development: false,
useBuiltIns: true,
},
),
);
});
}),
]);
Expand Down
32 changes: 0 additions & 32 deletions config/sewing-kit/plugin.ts

This file was deleted.

19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@
"@apollo/react-common": "^3.1.3",
"@apollo/react-hooks": "^3.1.3",
"@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",
"@sewing-kit/cli": "^0.6.2",
"@sewing-kit/core": "^0.6.2",
"@sewing-kit/plugin-babel": "^0.1.1",
"@sewing-kit/plugin-eslint": "^0.4.2",
"@sewing-kit/plugin-jest": "^0.5.1",
"@sewing-kit/plugin-package-build": "^0.5.1",
"@sewing-kit/plugin-prettier": "^0.1.2",
"@sewing-kit/plugin-typescript": "^0.6.1",
"@shopify/app-bridge": "^2.0.3",
"@shopify/babel-preset": "^24.0.2",
"@shopify/babel-preset": "^24.1.2",
"@shopify/browserslist-config": "^2.2.4",
"@shopify/eslint-plugin": "^40.2.3",
"@shopify/typescript-configs": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/address-consts/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/address-mocks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/address/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/admin-graphql-api-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/ast-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/async/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/csrf-token-fetcher/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/css-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/dates/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/decorators/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/function-enhancers/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-config-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-fixtures/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-mini-transforms/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-persisted/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-testing/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-tool-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-typed/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-validate-fixtures/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-dom-mocks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-koa-mocks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/koa-liveness-ping/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/koa-metrics/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/koa-performance/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/koa-shopify-graphql-proxy/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/koa-shopify-webhooks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/logger/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/magic-entries-webpack-plugin/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/mime-types/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/network/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/performance/sewing-kit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createPackage, Runtime} from '@sewing-kit/config';
import {createPackage, Runtime} from '@sewing-kit/core';

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

Expand Down
Loading