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

feat(gatsby-recipes): add recipes gui #24595

Merged
merged 226 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
4fdd86b
feat(gatsby-recipes): Pass data retrieved from the resource to its ch…
johno May 26, 2020
b0bb00c
chore(gatsby-recipes): Swap out Promise.all for a true queue
johno May 28, 2020
3863d73
feat(gatsby-recipes): Implement a render loop for nested resources
johno May 28, 2020
c99504d
Continue spiking out recipes gui
johno May 19, 2020
eecaa9a
Hardcode the project root in a clear place for now
johno May 19, 2020
71baa0e
Join plan steps in order to create entire recipe plan at once + initi…
KyleAMathews May 22, 2020
0b2811b
WIP
KyleAMathews May 28, 2020
3a2e097
feat(gatsby-recipes): Implement a wait for input state when props are…
johno May 28, 2020
1fc3d7c
chore(gatsby-recipes): Use an INVALID_PROP event for schema validation
johno May 28, 2020
13b22f1
feat(gatsby-recipes): Wrap intro and each step with components, add m…
johno May 28, 2020
7fc0c21
chore(gatsby-recipes): Spike out basic gui component for steps
johno May 28, 2020
896ef82
feat(gatsby-recipes): Pass data retrieved from the resource to its ch…
johno May 26, 2020
92fa835
chore(gatsby-recipes): Swap out Promise.all for a true queue
johno May 28, 2020
477e863
feat(gatsby-recipes): Implement a render loop for nested resources
johno May 28, 2020
f2c205f
Continue spiking out recipes gui
johno May 19, 2020
10f89b1
Hardcode the project root in a clear place for now
johno May 19, 2020
36a42cb
Join plan steps in order to create entire recipe plan at once + initi…
KyleAMathews May 22, 2020
34a9fa7
WIP
KyleAMathews May 28, 2020
2e325e7
feat(gatsby-recipes): Implement a wait for input state when props are…
johno May 28, 2020
0007298
chore(gatsby-recipes): Use an INVALID_PROP event for schema validation
johno May 28, 2020
7b95efb
feat(gatsby-recipes): Wrap intro and each step with components, add m…
johno May 28, 2020
640caaf
chore(gatsby-recipes): Spike out basic gui component for steps
johno May 28, 2020
5b66257
Lots of styling changes
KyleAMathews May 29, 2020
70ed3bb
Merge commit 'refs/pull/24590/head' of github.com:gatsbyjs/gatsby int…
KyleAMathews May 29, 2020
5e45b39
Put text & resources in same steps
KyleAMathews May 29, 2020
284c058
Lots more styling tweaks
KyleAMathews May 29, 2020
06251f1
paragraphs had too much margin bottom
KyleAMathews May 29, 2020
7a7c7ba
more style tweaks
KyleAMathews May 29, 2020
ab6d294
feat(gatsby-recipes): Implement a wait for input state when props are…
johno May 28, 2020
3239356
chore(gatsby-recipes): Use MDX v2 canary for access to the JSX AST
johno May 29, 2020
b614dc6
feat(gatsby-recipes): Apply a UUID prop to all resources for input ha…
johno May 29, 2020
c39eb7c
checkin: Begin wiring up event for passing input data to server
johno May 29, 2020
aff2513
fix(gatsby-recipes): Update step wrapping for MDX v2
johno May 29, 2020
ecd0ab9
fix(gatsby-recipes): Get tests passing, add debugging output
johno May 29, 2020
0a39e4a
Get applying working
KyleAMathews May 29, 2020
de3ebce
PROGRESSSSS
KyleAMathews May 29, 2020
0b487e3
feat(gatsby-recipes): Allow for inputs based on uuid to override props
johno May 29, 2020
0ce50b6
Remove sleep
KyleAMathews May 29, 2020
6d36395
style tweaks
KyleAMathews May 30, 2020
7c5f9ce
Add updater to input provider, spike out File form
johno May 29, 2020
439b8bc
feat(gatsby-recipes): Implement basic input functionality
johno May 30, 2020
16880e0
feat(gatsby-recipes): Spike out a contentful space resource, use rend…
johno May 30, 2020
69ce2e9
feat(gatsby-recipes): Spike out contentful provider and basic renderi…
johno May 30, 2020
0edc847
WIP
KyleAMathews May 30, 2020
1877fc8
More design tweaks
KyleAMathews Jun 5, 2020
cd99cd8
Style inline code
KyleAMathews Jun 5, 2020
f1c572b
Update packages/gatsby-recipes/recipes/cypress.mdx
KyleAMathews Jun 10, 2020
a04a8a5
Update packages/gatsby-recipes/recipes/cypress.mdx
KyleAMathews Jun 10, 2020
17ca010
Update packages/gatsby-recipes/recipes/cypress.mdx
KyleAMathews Jun 10, 2020
6ede2fa
feat(gatsby-recipes): fix MDX rendering for exports (#25133)
KyleAMathews Jun 19, 2020
cb11c32
live updating is working more-or-less
KyleAMathews Jun 20, 2020
624bc69
Speedups & cleanups
KyleAMathews Jun 20, 2020
498212c
Rename hook to match signature
KyleAMathews Jun 20, 2020
f950f1a
Rename context
KyleAMathews Jun 20, 2020
0eedd67
Add support for useResourceByKey
KyleAMathews Jun 20, 2020
def3174
fix @babel/template not accepting integers as options
KyleAMathews Jun 21, 2020
bf93d69
Only update resources when it's changed
KyleAMathews Jun 21, 2020
14ab0cc
make child Resource components work
KyleAMathews Jun 21, 2020
a404aac
rename useResourceByKey -> useResource
KyleAMathews Jun 22, 2020
8d1a143
Implement ContentfulEntry resource
KyleAMathews Jun 22, 2020
d2d9220
Add useProvider & ensure only apply resource once
KyleAMathews Jun 23, 2020
44f318d
Address some design feedback
johno Jul 13, 2020
ca94b27
Fix spacing for input forms
johno Jul 13, 2020
ff84edb
Fix spacing and size of step indicator
johno Jul 13, 2020
0ff2530
Flatten nested resources in display
johno Jul 13, 2020
3ba88ff
Use input builtins from gatsby-interface
johno Jul 13, 2020
9f84fc9
Add special file diff
johno Jul 16, 2020
c494f06
Merge branch 'inputs-support' into recipes-gui-admin
KyleAMathews Jul 16, 2020
e425064
Get things running again
KyleAMathews Jul 16, 2020
d05e3bc
Reload recipe session on changes
KyleAMathews Jul 17, 2020
797b1b0
Update tests
KyleAMathews Jul 17, 2020
6c25ece
Only emit updates when the state has actually changed
KyleAMathews Jul 17, 2020
67ee864
Fix building recipe component
KyleAMathews Jul 20, 2020
a238337
merge master
KyleAMathews Jul 20, 2020
842a451
update resolutions/dependencies
KyleAMathews Jul 20, 2020
fba886d
fix fetch dependency
KyleAMathews Jul 20, 2020
98c0690
moer fixes
KyleAMathews Jul 20, 2020
d4ecc94
Upgrade to Ink v3 & start migrating cli to showing all steps
KyleAMathews Jul 21, 2020
22ed01d
Properly handle nested resources when rendering the plan (#25930)
johno Jul 21, 2020
2c257af
feat(gatsby-recipes): Refactor CLI UI for new one-shot show plan (#25…
KyleAMathews Jul 23, 2020
c3cc70d
move back to v2 for deploying for compatability with the regular CLI
KyleAMathews Jul 24, 2020
78a3409
Also do a compatability layer for <Box>
KyleAMathews Jul 24, 2020
8bf1675
test
KyleAMathews Jul 24, 2020
9e77c66
Add missing dependency
KyleAMathews Jul 24, 2020
a23931d
sad
KyleAMathews Jul 24, 2020
38a30ec
Add rollup to bundle the cli app so we can use Ink v3
KyleAMathews Jul 24, 2020
619cdf6
Move packages packed by rollup to be dev dependencies as user won't n…
KyleAMathews Jul 24, 2020
2b201e1
Remove console.logs
KyleAMathews Jul 24, 2020
e8fd60d
Remove logs
KyleAMathews Jul 24, 2020
56d587e
feat(gatsby-recipes): copy edits for some recipes (#26009)
shannonbux Jul 25, 2020
9d078a5
Merge branch 'recipes-gui-admin' of github.com:gatsbyjs/gatsby into r…
KyleAMathews Jul 25, 2020
93b00e2
Fix rendering li > p
KyleAMathews Jul 28, 2020
28d54c5
Fix formatting of emotion recipe
KyleAMathews Jul 28, 2020
c15ff1b
Improve recipe
KyleAMathews Jul 28, 2020
3a8c3ff
Name of key changed
KyleAMathews Jul 28, 2020
0dbdda5
Match keyed resources correctly in the install step + cleanups
KyleAMathews Jul 28, 2020
aefd541
Fix linting errors
KyleAMathews Jul 28, 2020
124aa9a
fix margin
KyleAMathews Jul 28, 2020
5c3b082
Surround inlineCode with back ticks so it looks like markdown
KyleAMathews Jul 28, 2020
0e0918f
vendor ink-link as it's not upgraded to v3 yet
KyleAMathews Jul 28, 2020
f0673fc
feat(gatsby-recipes) (#26085)
shannonbux Jul 28, 2020
86f33f1
Merge branch 'recipes-gui-admin' of github.com:gatsbyjs/gatsby into r…
KyleAMathews Jul 28, 2020
c48c75b
prettier file
KyleAMathews Jul 29, 2020
b7fa32d
Fix linting errors
KyleAMathews Jul 29, 2020
af4a208
feat(gatsby-recipes): fix recipes copy 2 (#26115)
shannonbux Jul 29, 2020
b4da0c8
feat(gatsby-source-shopify): Add shopifyShop query (#25763)
PaulieScanlon Jul 20, 2020
72be86f
Start moving gatsby-telemetry to typescript (#25812)
jamo Jul 20, 2020
9da7624
Add Changelog entry for merged PR #24306
blainekasten Jul 20, 2020
93edf7e
chore(gatsby-telemetry): Migrate is-truthy to TypeScript (#25884)
blainekasten Jul 20, 2020
0adde08
Detect vercel again after rebranding in gatsby-telemetry (#25883)
jamo Jul 20, 2020
b077f99
chore(gatsby-telemetry): Migrate flush to TypeScript (#25886)
blainekasten Jul 20, 2020
5876391
feat(gatsby-source-shopify): set link from product variant to product…
jzabala Jul 20, 2020
50b78a4
fix: update www (#25874)
renovate[bot] Jul 20, 2020
3a88f91
docs(gatsby-internals): update page -> node dependency tracking (#25606)
pieh Jul 21, 2020
d780128
remove surplus `and` from performance comma list (#25891)
mikeymurph77 Jul 21, 2020
2d58747
fixed typo (#25896)
dawood6 Jul 21, 2020
c7bad74
fix(gatsby): Support symlinks in static directories (#25894)
jabrks Jul 21, 2020
b2175ce
Added the link to 'MDX' (#25905)
Jul 21, 2020
45a35f9
Update localization-i18n.md (#25902)
kaknut Jul 21, 2020
4056fb1
added a cookieflags option (#25907)
thijsvandiessen Jul 21, 2020
52cc9f1
fix(readme): gatsby-source-shopify: unify variable names (#25882)
muescha Jul 21, 2020
13ed8bd
chore(showcase): Add MongoDB Developer Hub (#25892)
jestapinski Jul 21, 2020
16e62ae
Add file names to code blocks (#25879)
muescha Jul 21, 2020
c944469
enhancement(docs): dictionary.txt -> CodePen -> fix brand name (#25875)
muescha Jul 21, 2020
85b7058
feat(gatsby-admin): list all pages of site (#25744)
mxstbr Jul 21, 2020
a5a206f
feat(gatsby-admin): plugin search (#25903)
mxstbr Jul 21, 2020
fc0086c
fix: Restore CLI port in use prompt feature (#25863)
polarathene Jul 21, 2020
a723b76
Fix/follow up 25863 (#25915)
blainekasten Jul 21, 2020
423310b
chore(release): Publish
blainekasten Jul 21, 2020
6f1128b
Capture repositoryId from heroku (#25910)
jamo Jul 21, 2020
924c3f1
fixed typo (#25912)
dawood6 Jul 21, 2020
6fea976
Update README.md (#25901)
kaknut Jul 21, 2020
e50c793
Add __BASE_PATH__ definition to storybook config (#25643)
nabeelvalley Jul 21, 2020
0e73ec5
fix(gatsby): don't place virtual modules in node_modules directory (#…
pieh Jul 21, 2020
aeba824
chore(doc):Add guide to Deploy Gatsby to DigitalOcean droplet. (#24652)
mistryvatsal Jul 21, 2020
84d0dad
Update migrating-from-v1-to-v2.md (#25832)
r1 Jul 21, 2020
d482be3
fix dictionary for digitalocean guide (#25936)
Jul 21, 2020
d3ef12d
fix(docs): show where `getNodesByType` comes from (#25344)
kurttomlinson Jul 22, 2020
600e53e
chore(docs): Changes to "Setting Up Your Local Dev Environment" doc (…
LekoArts Jul 22, 2020
346c1ab
chore(gatsby): add log to gatsby develop if Admin is enabled (#25943)
mxstbr Jul 22, 2020
a571efa
feat(gatsby): Defer node mutation during querying (#25479)
ascorbic Jul 22, 2020
a62fffd
chore(release): Publish
ascorbic Jul 22, 2020
8ac84a6
fix(docs): Fix broken mdx (#25946)
ascorbic Jul 22, 2020
a010c34
chore(gatsby-admin): build in postbuild of gatsby instead of prepubli…
mxstbr Jul 22, 2020
2703561
perf(gatsby-source-contentful): speed up resolving of huge spaces (#2…
axe312ger Jul 22, 2020
3b033fe
docs: use hello-world starter in quick start guide instead of default…
jsumnersmith Jul 23, 2020
8121b03
chore(docs): Fix RFC typo (#25970)
LekoArts Jul 23, 2020
5fe94e1
chore(gatsby-admin): cleanup stale artifacts pre build (#25972)
mxstbr Jul 23, 2020
ad2544d
Handle webpack in state machine (#25815)
ascorbic Jul 23, 2020
f844b99
chore(release): Publish
ascorbic Jul 23, 2020
d964d96
fix(gatsby-admin): show error messages in the interface (#25944)
mxstbr Jul 23, 2020
34d0ac4
docs(gatsby-admin): more detailed architecture explanation (#25941)
mxstbr Jul 23, 2020
c414566
fix(gatsby): call predicate for the root ancestor in findRootNodeAnce…
vladar Jul 23, 2020
35c6ba5
fix(gatsby-admin): small design tweaks (#25971)
mxstbr Jul 23, 2020
979667e
feat(gatsby): Add internal types export (#25921)
ascorbic Jul 23, 2020
9015b01
feat(plugin-manifest): support SVG favicon (#25276)
moonmeister Jul 23, 2020
9e02199
maintenance(www) remove unused dependencies (#25463)
tesseralis Jul 23, 2020
f454acd
Update contributor-swag.md (#25980)
Laci-Texter Jul 23, 2020
a4fd928
feat(gatsby-source-filesystem): improve wrong url rejection message (…
TylerBarnes Jul 23, 2020
ba823bb
Also detect VERCEL_BUILDER should Vercel one day use it as per the do…
jamo Jul 24, 2020
784577f
fix(babel-preset-gatsby): enable transformer-regenerator (#25983)
wardpeet Jul 24, 2020
6262a62
fix(docs): bash to shell (#25958)
muescha Jul 24, 2020
e44e835
chore: add tests to static-query filepaths (#25978)
wardpeet Jul 24, 2020
1e29d1c
chore(release): Publish
wardpeet Jul 24, 2020
401270e
highlighted plugins (#25998)
Jul 24, 2020
6071c6b
Revert "perf(gatsby-plugin-mdx): drop another babel step during sourc…
Jul 24, 2020
2f7aafd
fix: Enable CLI integration tests (#25997)
ascorbic Jul 24, 2020
4ccde93
[docs][glossary] add new entry for client-side rendering (#25984)
Jul 24, 2020
8b27d7d
fix: do not augment plugin-options (#26006)
wardpeet Jul 24, 2020
283d670
fix(gatsby-recipes) Fix docs for name in NPMPackage
KyleAMathews Jul 26, 2020
af5d664
fix: update www (#26043)
renovate[bot] Jul 27, 2020
1d53f3b
Added extra markup (#26030)
Jul 27, 2020
a0a7a4d
chore(showcase): Add leanier.com site (#26016)
anubhavmeet Jul 27, 2020
1a20b7d
Add support for cache refresh via GraphiQL (#25960)
herecydev Jul 27, 2020
d5a9d02
www: Remove sw (#26054)
sidharthachatterjee Jul 27, 2020
3232021
Docs: Add a warning about static queries (#25929)
herecydev Jul 28, 2020
4de5e83
feat(gatsby): Add top-level error handling to state machine (#25995)
ascorbic Jul 28, 2020
7e0640c
chore: Update stale yarn.lock (#26068)
ascorbic Jul 28, 2020
8c9423a
tests(gatsby): Add unit tests for develop state machine (#26051)
ascorbic Jul 28, 2020
c310981
chore(showcase): Add johnkavanagh.co.uk (#25747)
johnkavanagh Jul 28, 2020
b3b19eb
chore(showcase): Minor changes Showcase Tatjana Volbeke Portfolio (#2…
jlsvaicius Jul 28, 2020
6677766
fix(gatsby): Defer node mutation in more APIs (#26067)
ascorbic Jul 28, 2020
a6dac1d
chore(release): Publish
ascorbic Jul 28, 2020
cec809f
chore(showcase): add Julien Karst website (#25682)
JulienKode Jul 28, 2020
51170c5
chore(showcase): BRIKL & TRUE STORY in showcase (#25631)
MeixnerTobias Jul 28, 2020
2f2009e
chore(blog): Add i18n theme blog post (#26065)
LekoArts Jul 28, 2020
c7067b9
chore(showcase): add Château de Morey 🏰 (#25683)
JulienKode Jul 28, 2020
5422f2f
chore(showcase): meetup.com (#25792)
Jul 28, 2020
8a33005
chore(gatsby): fix typegen for publishing (#26078)
pieh Jul 29, 2020
385f901
fix(gatsby): Delete babel and terser cache dirs (#26053)
sidharthachatterjee Jul 29, 2020
57d3753
fix(gatsby): Load static query results from its own Db (#26077)
sidharthachatterjee Jul 29, 2020
552d28f
chore(release): Publish
sidharthachatterjee Jul 29, 2020
47ba295
fix(gatsby-image): add required check for one of fluid or fixed (#25371)
ehrencrona Jul 29, 2020
1b0f7a9
fix(gatsby): Load resources in ProdPageRenderer (#26092)
sidharthachatterjee Jul 29, 2020
4203ec0
chore(release): Publish
sidharthachatterjee Jul 29, 2020
7cdc55c
Update gatsby in www
sidharthachatterjee Jul 29, 2020
32bea4b
Add plugincreator to API (#26101)
Jul 29, 2020
93e19e8
chore(showcase): Add Devnet (#25952)
Marin-Matosevic Jul 29, 2020
8bd8ec4
Add pluagin source for page (#26104)
Jul 29, 2020
5b97777
fix(gatsby-source-contentful): support height parameter for srcset (#…
mrseanbaines Jul 29, 2020
2991fa8
chore(docs): Add author Colby Fayock (#26109)
colbyfayock Jul 29, 2020
fc9cb62
Merge remote-tracking branch 'origin/master' into recipes-gui-admin
KyleAMathews Jul 29, 2020
da10393
Use commonmark option to better handle list parsing
johno Jul 30, 2020
9646026
revert fixpack changes to root package.json
KyleAMathews Jul 30, 2020
b113192
Merge master for package updates
johno Jul 30, 2020
b7a34df
Squashed commit of the following:
KyleAMathews Jul 30, 2020
f767924
Actually fix lint error
KyleAMathews Jul 30, 2020
82298a8
Merge branch 'master' into recipes-gui-admin
KyleAMathews Jul 30, 2020
7ef894d
Fix test
KyleAMathews Jul 30, 2020
793a369
more fixing tests
KyleAMathews Jul 30, 2020
74d83b7
Only log when DEBUG=true
KyleAMathews Jul 30, 2020
d693307
Remove --quiet to see errors
KyleAMathews Jul 31, 2020
de079c5
Add rollup
KyleAMathews Jul 31, 2020
80c5950
resolve conflicts
KyleAMathews Jul 31, 2020
75b78b3
remove testing code
KyleAMathews Jul 31, 2020
92b0a88
Make yarn.lock file valid
KyleAMathews Jul 31, 2020
cb3bd7e
WORK PLEASE
KyleAMathews Jul 31, 2020
dc5083d
Add yoga-layout-prebuilt as explicit dependency to make rollup + yarn…
KyleAMathews Aug 1, 2020
482eb39
Add node-fetch as dependency
KyleAMathews Aug 1, 2020
714488f
Update packages/gatsby-recipes/src/graphql-server/server.js
johno Aug 3, 2020
49575d9
Use string matching for NPMPackage versions
johno Aug 3, 2020
8830215
Merge branch 'master' into recipes-gui-admin
KyleAMathews Aug 3, 2020
1b8ebea
Add missing string matcher
johno Aug 3, 2020
4227c45
Fix lint error
johno Aug 3, 2020
33a5d25
Merge remote-tracking branch 'origin/master' into recipes-gui-admin
KyleAMathews Aug 3, 2020
abc85d2
Add missing normalize.css dep
johno Aug 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
"yarn": "^1.17.3",
"node": ">=10.13.0"
},
"resolutions": {
"property-information": "5.5.0"
},
"eslintIgnore": [
"interfaces",
"**/__tests__/fixtures/"
Expand Down
49 changes: 33 additions & 16 deletions packages/gatsby-recipes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"description": "Core functionality for Gatsby Recipes",
"version": "0.1.31",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"main": "dist/index.js",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
},
Expand All @@ -15,21 +14,27 @@
"@babel/standalone": "^7.9.6",
"@babel/template": "^7.8.6",
"@babel/types": "^7.9.6",
"@emotion/core": "^10.0.14",
"@emotion/styled": "^10.0.14",
"@hapi/hoek": "8.x.x",
"@hapi/joi": "^15.1.1",
"@mdx-js/mdx": "^1.6.1",
"@mdx-js/react": "^1.6.1",
"@mdx-js/runtime": "^1.6.1",
"@mdx-js/mdx": "^2.0.0-next.1",
"@mdx-js/react": "^2.0.0-next.1",
"@mdx-js/runtime": "^2.0.0-next.1",
"acorn": "^7.2.0",
"acorn-jsx": "^5.2.0",
"ansi-html": "^0.0.7",
"contentful-management": "^5.26.3",
"cors": "^2.8.5",
"debug": "^4.1.1",
"detect-port": "^1.3.0",
"execa": "^4.0.1",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"formik": "^2.0.8",
"fs-extra": "^8.1.0",
"gatsby-core-utils": "^1.3.3",
"gatsby-interface": "^0.0.166",
"gatsby-telemetry": "^1.3.9",
"glob": "^7.1.6",
"graphql": "^14.6.0",
Expand All @@ -52,10 +57,15 @@
"lodash": "^4.17.15",
"mkdirp": "^0.5.1",
"node-fetch": "^2.6.0",
"p-queue": "^6.4.0",
"pkg-dir": "^4.2.0",
"prettier": "^2.0.5",
"prop-types": "^15.6.1",
"property-information": "5.5.0",
"react-circular-progressbar": "^2.0.0",
"react-icons": "^3.0.1",
"react-reconciler": "^0.25.1",
"remark-mdx": "^1.6.1",
"remark-mdx": "^2.0.0-next.1",
"remark-parse": "^6.0.3",
"remark-stringify": "^8.0.0",
"semver": "^7.3.2",
Expand All @@ -67,7 +77,8 @@
"unist-util-visit": "^2.0.2",
"urql": "^1.9.7",
"ws": "^7.3.0",
"xstate": "^4.9.1"
"xstate": "^4.9.1",
"yup": "^0.27.0"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
Expand All @@ -77,33 +88,39 @@
"tmp-promise": "^2.1.0"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-recipes#readme",
"jest": {
"testPathIgnorePatterns": [
"/.cache/",
"dist"
],
"testEnvironment": "node"
},
"keywords": [
"gatsby",
"gatsby-recipes",
"mdx"
],
"license": "MIT",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby.git",
"directory": "packages/gatsby-recipes"
},
"resolutions": {
"graphql": "^14.6.0"
},
"jest": {
"testPathIgnorePatterns": [
"/.cache/",
"dist"
],
"testEnvironment": "node"
"@mdx-js/mdx": "^2.0.0-next.1",
"@mdx-js/react": "^2.0.0-next.1",
"@mdx-js/runtime": "^2.0.0-next.1",
"graphql": "^14.6.0",
"property-information": "5.5.0",
"remark-mdx": "^2.0.0-next.1"
},
"scripts": {
"build": "babel src --out-dir dist --ignore \"**/__tests__\" --extensions \".ts,.js,.tsx\"",
"build:watch": "npm run build -- --watch",
"prepare": "npm run build",
"watch": "npm run build:watch",
"test": "jest",
"test:watch": "jest --watch"
"test:watch": "jest --watch",
"watch": "npm run build:watch"
}
}
14 changes: 5 additions & 9 deletions packages/gatsby-recipes/recipes/cypress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ First, we'll want to install Cypress and additional dependencies.

---

Add dependencies to your package.json and we also installed a useful package `gatsby-cypress`. `gatsby-cypress` exposes additional Cypress functionality which makes Gatsby and Cypress work together just a bit more nicely. We'll show that later with our first test, but hold tight for just a bit because first we need to scaffold out some boilerplate files for Cypress.
KyleAMathews marked this conversation as resolved.
Show resolved Hide resolved

<NPMPackage name="cypress" dependencyType="development" />
<NPMPackage name="gatsby-cypress" dependencyType="development" />
<NPMPackage name="start-server-and-test" dependencyType="development" />

---

Well look at that — we've added dependencies to your package.json and we also installed a useful package `gatsby-cypress`. `gatsby-cypress` exposes additional Cypress functionality which makes Gatsby and Cypress work together just a bit more nicely. We'll show that later with our first test, but hold tight for just a bit because first we need to scaffold out some boilerplate files for Cypress.

---
Cool cool! So we created a local `cypress` folder with two sub-folders, `support` and `plugins`. We've also automatically included all the nice `gatsby-cypress` utilities, which we can now use in our first test.
KyleAMathews marked this conversation as resolved.
Show resolved Hide resolved

<File
path="cypress/plugins/index.js"
Expand All @@ -26,9 +26,7 @@ Well look at that — we've added dependencies to your package.json and we also

---

Cool cool! So we created a local `cypress` folder with two sub-folders, `support` and `plugins`. We've also automatically included all the nice `gatsby-cypress` utilities, which we can now use in our first test.

---
Our first test! You'll notice it's failing. This is intentional -- we'd like you to run the test and fix it.
KyleAMathews marked this conversation as resolved.
Show resolved Hide resolved

<File
path="cypress/integration/home-page/home-page.js"
Expand All @@ -37,9 +35,7 @@ Cool cool! So we created a local `cypress` folder with two sub-folders, `support

---

Our first test! You'll notice it's failing. This is intentional -- we'd like you to run the test and fix it. This raises a question -- how do you run a Cypress test? Easy peasy.

---
This raises a question -- how do you run a Cypress test? Easy peasy.

<NPMScript
name="develop"
Expand Down
46 changes: 13 additions & 33 deletions packages/gatsby-recipes/src/apply-plan.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
const resources = require(`./resources`)
const SITE_ROOT = process.cwd()
const ctx = { root: SITE_ROOT }

const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
const render = require(`./renderer`)

module.exports = async (context, cb) => {
const stepAsMdx = context.steps.join(`\n`)

try {
// XXX: Too many arguments to the render function
Copy link
Contributor

Choose a reason for hiding this comment

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

Arg count seems to match. Obsolete comment?

const result = await render(stepAsMdx, cb, context.inputs, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can return the promise immediately. The function is async which will do the try/catch stuff automatically, as well.

console.log({ result })
return result
} catch (e) {
console.log(e)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the log super relevant or can it be dropped here? Relying on a different handler.

throw e
}
}

const applyPlan = async stepPlan => {
let appliedResources = []
// We apply each resource serially for now — we can parallelize in the
// future for SPEED
await asyncForEach(stepPlan, async resourcePlan => {
const resource = resources[resourcePlan.resourceName]

try {
const changedResources = await resource.create(
ctx,
resourcePlan.resourceDefinitions
)

appliedResources = appliedResources.concat(changedResources)

return
} catch (e) {
throw e
}
})

return appliedResources
}

module.exports = applyPlan
26 changes: 23 additions & 3 deletions packages/gatsby-recipes/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ const components = {
Directory: () => null,
GatsbyShadowFile: () => null,
NPMScript: () => null,
RecipeIntroduction: () => null,
RecipeStep: () => null,
}

let logStream
Expand Down Expand Up @@ -354,12 +356,25 @@ module.exports = async ({ recipe, graphqlPort, projectRoot }) => {
}
`)
// eslint-disable-next-line
const [__, sendEvent] = useMutation(`
mutation($event: String!) {
sendEvent(event: $event)
const [__, _sendEvent] = useMutation(`
mutation($event: String!, $input: String) {
sendEvent(event: $event, input: $input)
}
`)

const sendEvent = ({ event, input }) => {
log(`sending event`, { event, input })
if (input) {
log(`sending event`, input)
_sendEvent({
event,
input: JSON.stringify(input),
})
} else {
_sendEvent({ event })
}
}

subscriptionClient.connectionCallback = async () => {
if (!showRecipesList) {
log(`createOperation`)
Expand Down Expand Up @@ -419,6 +434,11 @@ module.exports = async ({ recipe, graphqlPort, projectRoot }) => {
</Text>
)
}

if (state.value === `waitingForInput`) {
return <Text>Input some stuff!</Text>
}

/*
* TODOs
* Listen to "y" to continue (in addition to enter)
Expand Down
10 changes: 3 additions & 7 deletions packages/gatsby-recipes/src/create-plan.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
const render = require(`./renderer`)

// TODO: Properly handle context in the renderer
// const SITE_ROOT = process.cwd()
// const ctx = { root: SITE_ROOT }

module.exports = async context => {
const stepAsMdx = context.steps[context.currentStep]
module.exports = async (context, cb) => {
const stepAsMdx = context.steps.join(`\n`)

try {
const result = await render(stepAsMdx)
const result = await render(stepAsMdx, cb, context.inputs)
return result
} catch (e) {
throw e
Comment on lines 6 to 10
Copy link
Contributor

Choose a reason for hiding this comment

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

The syntactical async keyword will do the same.

Suggested change
try {
const result = await render(stepAsMdx)
const result = await render(stepAsMdx, cb, context.inputs)
return result
} catch (e) {
throw e
return render(stepAsMdx, cb, context.inputs)

Expand Down
11 changes: 9 additions & 2 deletions packages/gatsby-recipes/src/graphql-server/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require(`dotenv`).config()

const express = require(`express`)
const graphqlHTTP = require(`express-graphql`)
const {
Expand All @@ -23,6 +25,7 @@ const pubsub = new PubSub()
const PORT = process.argv[2] || 4000

const emitOperation = state => {
console.log(`!!! emitting operation`)
console.log(state)
pubsub.publish(`operation`, {
state: JSON.stringify(state),
Expand Down Expand Up @@ -107,10 +110,14 @@ const rootMutationType = new GraphQLObjectType({
type: GraphQLString,
args: {
event: { type: GraphQLString },
input: { type: GraphQLString },
},
resolve: (_, args) => {
console.log(`event received`, args)
service.send(args.event)
console.log(`!!! event received`, args)
service.send({
type: args.event,
data: args.input && JSON.parse(args.input),
})
},
},
}
Expand Down