This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
Update to the latest version of skn #1980
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dc53550
Update sewing-kit-next plugins to latest versions
BPScott db19495
Add Prettier plugin
BPScott 2c9036a
Fixup typecheck and tests
BPScott a7c5bda
config tweak
BPScott 5fd0d32
cachebust CI
BPScott 81c8449
Move cachebusting
BPScott 39c904d
resolve typescript to 3.9.9
BPScott 3511b0a
Revert investigations
BPScott 9ab45a2
Update type imports
BPScott f48f7cf
Add changelogs
BPScott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only package that overrides this and sets it to false is |
||
} = {}) { | ||
// 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}) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
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, | ||
}, | ||
), | ||
); | ||
}); | ||
}), | ||
]); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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