Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field type build tool #993

Merged
merged 76 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
54fd194
Mostly unmodified preconstruct
emmatown Apr 4, 2019
1d9abb8
Prettier and flow fixes for this repo
emmatown Apr 4, 2019
6de7181
Update snapshots because of formatting changes
emmatown Apr 4, 2019
873cea8
Fix deps so bolt can link
emmatown Apr 4, 2019
9e63ac1
package.json stuff
emmatown Apr 4, 2019
7eddd38
It's working 🎉
emmatown Apr 5, 2019
849a616
use named export from @keystone-alpha/fields-wysiwyg-tinymce
emmatown Apr 5, 2019
bc39cd8
Do renderChunk transform for esm bundles
emmatown Apr 5, 2019
ccd495f
Use path.join
emmatown Apr 5, 2019
1d1636e
Rip out a bunch of stuff
emmatown Apr 5, 2019
74ab984
Rip out more
emmatown Apr 5, 2019
2338641
Fix tests
emmatown Apr 5, 2019
0dbcbd3
Rip out more things
emmatown Apr 5, 2019
ee05567
test stuff
emmatown Apr 5, 2019
975572d
Fix a bunch of stuff
emmatown Apr 6, 2019
e713473
WIP
emmatown Apr 7, 2019
5b37898
stuff
emmatown Apr 7, 2019
f9c3446
It's working
emmatown Apr 7, 2019
b81727b
Change chunk file names
emmatown Apr 7, 2019
ccea487
Change out dir for build-field-types
emmatown Apr 7, 2019
16b9071
Various little things
emmatown Apr 7, 2019
d93af6c
Dev stuff
emmatown Apr 8, 2019
fc28aa6
Start of require hook stuff
emmatown Apr 9, 2019
b56e358
This thing might work
emmatown Apr 9, 2019
0a09578
I have no idea if this is a good idea but it works
emmatown Apr 10, 2019
1d56b9e
Try new approach
emmatown Apr 15, 2019
f78e786
Try a thing
emmatown Apr 15, 2019
4fa85f5
Remove more stuff
emmatown Apr 15, 2019
199a281
WIP more tests
emmatown Apr 15, 2019
c32b134
Fix tests
emmatown Apr 15, 2019
4ad6bdc
Start moving things around
emmatown Apr 15, 2019
5ca351c
Run an imperfect codemod that's helpful
emmatown Apr 15, 2019
12eb716
Fix a thing
emmatown Apr 15, 2019
96ecdf4
Fix eslint
emmatown Apr 15, 2019
b360a94
CalendarDay is done
emmatown Apr 16, 2019
4afe2f1
Checkbox
emmatown Apr 16, 2019
ba44b8a
Stuff...
emmatown Apr 16, 2019
3e6215a
More field types
emmatown Apr 16, 2019
04a0671
Another field type and do a find and replace on path.join(__dirname, …
emmatown Apr 16, 2019
5a61131
Move some things around
emmatown Apr 16, 2019
c90f4f1
More stuff
emmatown Apr 16, 2019
8289a19
More progress
emmatown Apr 16, 2019
529cf16
Change to export default so the names don't conflict
emmatown Apr 16, 2019
2cc3435
Fix more stuff
emmatown Apr 16, 2019
97534cf
Fix more stuff
emmatown Apr 16, 2019
5f6bfc6
Fix another thing
emmatown Apr 16, 2019
5dd8b59
No more eslint errors 🎉
emmatown Apr 16, 2019
47faa4d
Fix some stuff
emmatown Apr 16, 2019
d40dd29
Fix some stuff
emmatown Apr 16, 2019
7b50930
Merge branch 'master' into field-type-build-tool
emmatown Apr 16, 2019
c4b847c
Change some stuff
emmatown Apr 16, 2019
b5feddd
More stuff
emmatown Apr 16, 2019
66f6d2f
Add missing arch-ui deps to admin-ui
emmatown Apr 16, 2019
46e68e2
Newline
emmatown Apr 16, 2019
8110d6b
Merge branch 'add-arch-deps-to-admin-ui' into field-type-build-tool
emmatown Apr 16, 2019
1194bc8
Update hook from updated version in preconstruct
emmatown Apr 16, 2019
7f93be7
Fix some stuff
emmatown Apr 16, 2019
726c6bf
Fix things in the website
emmatown Apr 16, 2019
f123392
Change a thing in the require hook
emmatown Apr 16, 2019
56bf496
Fix an import
emmatown Apr 16, 2019
e1a8f9a
Merge branch 'master' into field-type-build-tool
emmatown Apr 16, 2019
5d6ae25
Remove an inaccurate comment
emmatown Apr 16, 2019
3d64967
Add netlify.toml
emmatown Apr 16, 2019
09d13f1
Fix netlify.toml
emmatown Apr 16, 2019
98b869e
I don't like this but it works and I've spent too much time on this p…
emmatown Apr 17, 2019
221b5c2
Fix some tests
emmatown Apr 17, 2019
9428968
Change an import to ESM to solve circular dependency problem
emmatown Apr 17, 2019
6662c3f
Remove code mod for CJS -> ESM
emmatown Apr 17, 2019
1989dd2
Maybe fix some tests
emmatown Apr 17, 2019
1c4483c
Fix tests
emmatown Apr 17, 2019
0598926
Update snapshots
emmatown Apr 17, 2019
77f5267
Merge branch 'master' into field-type-build-tool
emmatown Apr 17, 2019
772a414
Add changesets
emmatown Apr 17, 2019
57c2ccc
Update preconstruct and CONTRIBUTING.md
emmatown Apr 17, 2019
06b1e66
Merge branch 'master' into field-type-build-tool
emmatown Apr 17, 2019
fa0b55f
Merge branch 'master' into field-type-build-tool
emmatown Apr 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ x-integration-steps: &integration-steps
name: Bolt - Install packages
command: CYPRESS_CACHE_FOLDER=$CIRCLE_WORKING_DIRECTORY/node_modules/cypress/.cache/ bolt
- save_cache: *save-cache
- run: bolt build
- run:
name: E2E Cypress tests
command: CYPRESS_CACHE_FOLDER=$CIRCLE_WORKING_DIRECTORY/node_modules/cypress/.cache/ bolt ws run cypress:run:ci --only-fs $PROJECT_DIRECTORY
Expand Down Expand Up @@ -78,7 +77,6 @@ jobs:
# causing the other job to fail with a "Missing Cypress" error.
- run: CYPRESS_CACHE_FOLDER=$CIRCLE_WORKING_DIRECTORY/node_modules/cypress/.cache/ bolt
- save_cache: *save-cache
- run: bolt build
# run tests!
- run: yarn lint:eslint --format junit -o reports/junit/js-lint-results.xml
- run: yarn lint:prettier
Expand Down
16 changes: 15 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ module.exports = {
'error',
{
devDependencies: [
'**/__tests__/**/*.js',
'**/*test.js',
'**/tests/**/*.js',
'**/examples/**/*.js',
'**/build/**/*.js',
`packages/fields/types/**/filterTests.js`,
`packages/fields/src/**/filterTests.js`,
],
},
],
'import/no-unresolved': 'error',
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'react/jsx-boolean-value': 'warn',
Expand Down Expand Up @@ -71,5 +73,17 @@ module.exports = {
'no-undef': 'off',
},
},
{
files: ['packages/fields/src/**/*.js'],
rules: {
'import/no-commonjs': 'error',
},
},
{
files: ['packages/build-field-types/__fixtures__/**/*.js'],
rules: {
'import/no-unresolved': 'off',
},
},
],
};
15 changes: 14 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
module.exports = {
presets: [
['@babel/env', { exclude: ['transform-regenerator', 'transform-async-to-generator'] }],
[
'@babel/env',
{
targets: {
node: 10,
browsers: [
'last 2 chrome versions',
'last 2 firefox versions',
'last 2 safari versions',
'last 2 edge versions',
],
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 want to call out this change in case anyone has any concerns. From #214 it seems like we're okay with not supporting IE 11.

The reason I did this isn't really for smaller bundles but that's a nice benefit, I did this is because there's a bug in Babel which means Babel compiled classes can't extend native classes. (babel/babel#9367)

},
},
],
'@babel/react',
'@babel/preset-flow',
],
Expand Down
2 changes: 1 addition & 1 deletion demo-projects/blog/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
CalendarDay,
DateTime,
} = require('@keystone-alpha/fields');
const Wysiwyg = require('@keystone-alpha/fields-wysiwyg-tinymce');
const { Wysiwyg } = require('@keystone-alpha/fields-wysiwyg-tinymce');
const { LocalFileAdapter } = require('@keystone-alpha/file-adapters');
const getYear = require('date-fns/get_year');

Expand Down
4 changes: 2 additions & 2 deletions demo-projects/blog/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const keystone = require('@keystone-alpha/core');
const WysiwygField = require('@keystone-alpha/fields-wysiwyg-tinymce');
const { Wysiwyg } = require('@keystone-alpha/fields-wysiwyg-tinymce');
const next = require('next');

const { port, staticRoute, staticPath } = require('./config');
Expand All @@ -21,7 +21,7 @@ Promise.all([keystone.prepare({ port }), nextApp.prepare()])
await keystoneApp.createItems(initialData);
}

WysiwygField.bindStaticMiddleware(server);
Wysiwyg.bindStaticMiddleware(server);
server.app.use(staticRoute, server.express.static(staticPath));
server.app.use(nextApp.getRequestHandler());
await server.start();
Expand Down