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

Commit

Permalink
Update to the latest version of skn (#1980)
Browse files Browse the repository at this point in the history
* Update sewing-kit-next plugins to latest versions
* Add Prettier plugin
* Fixup typecheck and tests
* Update types/typesVersions keys to point straight into the build folder
  • Loading branch information
BPScott committed Aug 3, 2021
1 parent 25d95c9 commit 460a795
Show file tree
Hide file tree
Showing 235 changed files with 1,008 additions and 756 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package.json
node_modules
packages/*/build
coverage
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,
jestTestRunner = 'jest-circus',
polyfill = true,
} = {}) {
// 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}) => {
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
6 changes: 5 additions & 1 deletion packages/address-consts/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 to latest sewiing-kit-next for build. Update `types`/`typeVersions` fields to point directly into the build folder [[#1980](https://github.com/Shopify/quilt/pull/1980)]

## 3.0.2 - 2021-07-15

Expand Down
5 changes: 2 additions & 3 deletions packages/address-consts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"description": "Constants and types relating to `@shopify/address`",
"main": "index.js",
"types": "index.d.ts",
"types": "./build/ts/index.d.ts",
"sideEffects": false,
"publishConfig": {
"access": "public",
Expand All @@ -28,8 +28,7 @@
"!*.tsbuildinfo",
"index.js",
"index.mjs",
"index.esnext",
"index.d.ts"
"index.esnext"
],
"module": "index.mjs",
"esnext": "index.esnext",
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
6 changes: 5 additions & 1 deletion packages/address-mocks/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 to latest sewiing-kit-next for build. Update `types`/`typeVersions` fields to point directly into the build folder [[#1980](https://github.com/Shopify/quilt/pull/1980)]

## 2.0.4 - 2021-07-15

Expand Down
5 changes: 2 additions & 3 deletions packages/address-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"description": "Address mocks for `@shopify/address`",
"main": "index.js",
"types": "index.d.ts",
"types": "./build/ts/index.d.ts",
"publishConfig": {
"access": "public",
"@shopify:registry": "https://registry.npmjs.org"
Expand Down Expand Up @@ -35,8 +35,7 @@
"!*.tsbuildinfo",
"index.js",
"index.mjs",
"index.esnext",
"index.d.ts"
"index.esnext"
],
"module": "index.mjs",
"esnext": "index.esnext",
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
6 changes: 5 additions & 1 deletion packages/address/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 to latest sewiing-kit-next for build. Update `types`/`typeVersions` fields to point directly into the build folder [[#1980](https://github.com/Shopify/quilt/pull/1980)]

## 3.0.4 - 2021-07-15

Expand Down
5 changes: 2 additions & 3 deletions packages/address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"description": "Address utilities for formatting addresses",
"main": "index.js",
"types": "index.d.ts",
"types": "./build/ts/index.d.ts",
"publishConfig": {
"access": "public",
"@shopify:registry": "https://registry.npmjs.org"
Expand Down Expand Up @@ -35,8 +35,7 @@
"!*.tsbuildinfo",
"index.js",
"index.mjs",
"index.esnext",
"index.d.ts"
"index.esnext"
],
"module": "index.mjs",
"esnext": "index.esnext",
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
6 changes: 5 additions & 1 deletion packages/admin-graphql-api-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 to latest sewiing-kit-next for build. Update `types`/`typeVersions` fields to point directly into the build folder [[#1980](https://github.com/Shopify/quilt/pull/1980)]

## 1.0.0 - 2021-05-21

Expand Down
5 changes: 2 additions & 3 deletions packages/admin-graphql-api-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"description": "A set of utilities to use when consuming Shopify’s admin GraphQL API",
"main": "index.js",
"types": "index.d.ts",
"types": "./build/ts/index.d.ts",
"publishConfig": {
"access": "public",
"@shopify:registry": "https://registry.npmjs.org"
Expand All @@ -28,8 +28,7 @@
"!*.tsbuildinfo",
"index.js",
"index.mjs",
"index.esnext",
"index.d.ts"
"index.esnext"
],
"module": "index.mjs",
"esnext": "index.esnext",
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
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 to latest sewiing-kit-next for build. Update `types`/`typeVersions` fields to point directly into the build folder [[#1980](https://github.com/Shopify/quilt/pull/1980)]

## 1.0.3 - 2021-06-29

Expand Down
17 changes: 12 additions & 5 deletions packages/ast-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
"license": "MIT",
"description": "Utilities for working with Abstract Syntax Trees (ASTs)",
"main": "index.js",
"types": "index.d.ts",
"types": "./build/ts/index.d.ts",
"typesVersions": {
"*": {
"javascript": [
"./build/ts/javascript/index.d.ts"
],
"markdown": [
"./build/ts/markdown/index.d.ts"
]
}
},
"sideEffects": false,
"publishConfig": {
"access": "public",
Expand Down Expand Up @@ -37,15 +47,12 @@
"index.js",
"index.mjs",
"index.esnext",
"index.d.ts",
"javascript.js",
"javascript.mjs",
"javascript.esnext",
"javascript.d.ts",
"markdown.js",
"markdown.mjs",
"markdown.esnext",
"markdown.d.ts"
"markdown.esnext"
],
"dependencies": {
"@babel/template": "^7.14.5",
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
6 changes: 5 additions & 1 deletion packages/async/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 to latest sewiing-kit-next for build. Update `types`/`typeVersions` fields to point directly into the build folder [[#1980](https://github.com/Shopify/quilt/pull/1980)]

## 3.0.0 - 2021-05-21

Expand Down
Loading

0 comments on commit 460a795

Please sign in to comment.