-
Notifications
You must be signed in to change notification settings - Fork 220
[quilt] Build Quilt using sewing-kit-next #1538
Changes from all commits
46a2ae8
d5b5398
d3369ad
dc87d4d
e612ef4
28b3518
588d4ef
5fba41a
84622f8
65ec17e
79eb093
822ade7
db8c6ba
34f0a56
9c9b673
98f8551
6adfff1
37d56a1
400948e
09e6ac8
b9ec759
a90b61a
3800d9b
476bf9a
e91936a
90e4791
7627403
c369a9b
af635bb
512eef3
3446887
2c3068c
b810499
c9b69a0
07876a2
1a6fdfc
cfb151b
d68b3f0
bdbfa7c
52125bd
06d55bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
node_modules | ||
coverage | ||
**/node_modules/* | ||
**/packages/*.js | ||
*.d.ts | ||
**/templates/* | ||
**/dummy/** | ||
templates | ||
gems/**/dummy | ||
packages/*/build | ||
**/*.d.ts | ||
**/*.js | ||
**/*.esnext | ||
**/*.mjs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package.json | ||
node_modules | ||
dist | ||
packages/*/build | ||
coverage | ||
*.svg | ||
templates/*.md | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
"build": true, | ||
"**/*.js": true | ||
}, | ||
"typescript.tsserver.maxTsServerMemory": 8000, | ||
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. Can you share some re-producible steps for the issues you had with VSCode, please? I can try to take a deeper look. 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. Sure thing:
In VS Code you can use the command 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. I was able to repro this on first attempt. I tried a few hacks to see what would happen (eg. move the root 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. It might have something to do with my own local setup then 🤔 @lemonmade @TheMallen is this an issue for you guys as well? 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. I'll try it out after our 1:1 |
||
"editor.formatOnSave": true, | ||
"prettier-stylelint.stylelintIntegration": true, | ||
"prettier-eslint.eslintIntegration": true, | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { | ||
Package, | ||
createComposedProjectPlugin, | ||
createProjectTestPlugin, | ||
createProjectBuildPlugin, | ||
} from '@sewing-kit/plugins'; | ||
import {react} from '@sewing-kit/plugin-react'; | ||
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. Something to keep in mind for the future. It would be nice to have some of these common plugins re-exported from import {
// other stuff
react,
javascript,
typescript,
} from '@sewing-kit/plugins'; instead of import {react} from '@sewing-kit/plugin-react';
import {javascript} from '@sewing-kit/plugin-javascript';
import {typescript} from '@sewing-kit/plugin-typescript'; @lemonmade do you foresee any issues with this? 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. I agree the core plugins are annoying to remember what all the package names are 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. This is what composed plugins are for (e.g., https://github.com/lemonmade/quilt/blob/main/packages/sewing-kit-plugins/src/index.ts#L29), so I don't think it's needed. |
||
import {javascript, updateBabelPreset} from '@sewing-kit/plugin-javascript'; | ||
import {typescript} from '@sewing-kit/plugin-typescript'; | ||
import {buildFlexibleOutputs} from '@sewing-kit/plugin-package-flexible-outputs'; | ||
import {} from '@sewing-kit/plugin-jest'; | ||
|
||
import {addLegacyDecoratorSupport} from './plugins'; | ||
|
||
export function quiltPackage({jestEnv = 'jsdom', useReact = false} = {}) { | ||
return createComposedProjectPlugin<Package>('Quilt.Package', [ | ||
javascript(), | ||
typescript(), | ||
useReact && react(), | ||
buildFlexibleOutputs(), | ||
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.jestTransforms?.hook(transforms => ({ | ||
...transforms, | ||
'\\.(gql|graphql)$': 'jest-transform-graphql', | ||
})); | ||
|
||
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, | ||
}, | ||
), | ||
); | ||
}); | ||
}), | ||
]); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {BabelConfig, updateBabelPlugin} from '@sewing-kit/plugin-javascript'; | ||
|
||
export async function addLegacyDecoratorSupport(config: BabelConfig) { | ||
return updateBabelPlugin( | ||
[ | ||
'@babel/plugin-proposal-decorators', | ||
require.resolve('@babel/plugin-proposal-decorators'), | ||
], | ||
() => ({ | ||
legacy: true, | ||
}), | ||
)( | ||
await updateBabelPlugin( | ||
[ | ||
'@babel/plugin-proposal-class-properties', | ||
require.resolve('@babel/plugin-proposal-class-properties'), | ||
], | ||
{ | ||
loose: true, | ||
}, | ||
)(config), | ||
); | ||
} |
This file was deleted.
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.
The thing to watch out for here is that we sometimes nest
.eslintrc.js
or similar in subdirectories, and we do generally want to include those files.