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

[HackDays] CLI generate components + sections + metaobjects sync #1155

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
11a1950
Minor refactor to generate route
frandiox Jul 26, 2023
e418436
Add generate:component command
frandiox Jul 26, 2023
f73efa6
Add g:c shortcut for generate:command
frandiox Jul 26, 2023
98bcfc7
add defineSection to hydrogen package
juanpprieto Jul 27, 2023
ba8fc2e
add and render ImageText section in skeleton homepage
juanpprieto Jul 27, 2023
97e188b
add createAdminClient lib to cli
juanpprieto Jul 27, 2023
8c6e2c9
General fixes
frandiox Jul 27, 2023
48023d4
Initial draft for schema watcher
frandiox Jul 27, 2023
2eae074
Compute queries before initial build
frandiox Jul 27, 2023
0db262b
Use generated type
frandiox Jul 27, 2023
895058a
fix image height :(
juanpprieto Jul 27, 2023
4923fb3
update defineSection logic to produce a fragement for the section props
juanpprieto Jul 27, 2023
f731c9c
Generate section command
frandiox Jul 27, 2023
63cfa1f
Mutate Admin with metaobject definitions
frandiox Jul 27, 2023
daa5863
add KitchenSink route and section and fix queries
juanpprieto Jul 28, 2023
6873ff7
generate section from the hydrogen UI regitry
juanpprieto Jul 28, 2023
6045bce
remove two fields from KitchenSink because we past the 40 fields limit
juanpprieto Jul 28, 2023
8cc77da
Upsert default metaobject entry
frandiox Jul 28, 2023
41f0603
Fix diffing for kitchensink
frandiox Jul 28, 2023
4f3f20b
Rename variables
frandiox Jul 28, 2023
6b14056
Logs
frandiox Jul 28, 2023
d48ac7d
Remove unused admin client
frandiox Jul 28, 2023
af9ad82
Move files to CLI
frandiox Jul 28, 2023
4417ade
Improve types
frandiox Jul 28, 2023
34493a8
Generate Sections.tsx automatically
frandiox Jul 28, 2023
d10a66c
Debounce updates
frandiox Jul 28, 2023
39fc28c
Fix Sections generation
frandiox Jul 28, 2023
f376245
Fix upsert
frandiox Jul 28, 2023
d888283
reset _index skeleton route
juanpprieto Jul 28, 2023
87cd4b5
remove sections folder
juanpprieto Jul 28, 2023
a91141d
update types
juanpprieto Jul 28, 2023
d80585a
add hackdays demo route
juanpprieto Jul 28, 2023
304394b
update README and hackdays routew
juanpprieto Jul 28, 2023
46e9939
fix ?.type on Sections and logging
juanpprieto Jul 28, 2023
e507177
update README
juanpprieto Jul 28, 2023
a757fcf
update readme
juanpprieto Jul 28, 2023
a4c3d0c
Prompt for section to generate if none is passed in
juanpprieto Jul 29, 2023
0f46c92
Move defineSection to defineSchema and add a new defineSection with t…
juanpprieto Jul 29, 2023
1b16a4e
update button styling
juanpprieto Jul 29, 2023
5340c7a
h2 generate component now uses remote registry
juanpprieto Jul 29, 2023
82f1506
add url on the comps and sections prompt options
juanpprieto Jul 29, 2023
0e183ca
allow any template in workspac
juanpprieto Jul 29, 2023
37fa28f
demo/video cleanup
juanpprieto Jul 30, 2023
a594e92
demo tweaks
juanpprieto Jul 30, 2023
31dd534
demo
juanpprieto Jul 30, 2023
e01faa9
fixes
juanpprieto Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .graphqlrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ projects:
documents:
- 'templates/**/app/**/*.{graphql,js,ts,jsx,tsx}'
- 'examples/**/app/**/*.{graphql,js,ts,jsx,tsx}'
- 'packages/cli/src/**/graphql/storefront/**/*.ts'
admin:
schema: 'packages/cli/admin.schema.json'
documents: 'packages/cli/src/**/graphql/admin/**/*.ts'
documents:
- 'packages/cli/src/**/graphql/admin/**/*.ts'
business-platform:
schema: 'packages/cli/business-platform.schema.json'
documents: 'packages/cli/src/**/graphql/business-platform/**/*.ts'
53 changes: 27 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"templates/hello-world",
"templates/demo-store",
"templates/skeleton",
"templates/*",
"examples/express",
"packages/remix-oxygen",
"packages/hydrogen",
Expand Down
101 changes: 94 additions & 7 deletions packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,49 @@
},
"args": {}
},
"hydrogen:generate:component": {
"id": "hydrogen:generate:component",
"description": "Generates a commerce component.",
"strict": true,
"pluginName": "@shopify/cli-hydrogen",
"pluginAlias": "@shopify/cli-hydrogen",
"pluginType": "core",
"aliases": [],
"flags": {
"adapter": {
"name": "adapter",
"type": "option",
"description": "Remix adapter used in the route. The default is `@shopify/remix-oxygen`.",
"multiple": false
},
"typescript": {
"name": "typescript",
"type": "boolean",
"description": "Generate TypeScript files",
"allowNo": false
},
"force": {
"name": "force",
"type": "boolean",
"char": "f",
"description": "Overwrite the destination directory and files if they already exist.",
"allowNo": false
},
"path": {
"name": "path",
"type": "option",
"description": "The path to the directory of the Hydrogen storefront. The default is the current directory.",
"multiple": false
}
},
"args": {
"componentName": {
"name": "componentName",
"description": "The component to generate.",
"required": false
}
}
},
"hydrogen:generate:route": {
"id": "hydrogen:generate:route",
"description": "Generates a standard Shopify route.",
Expand Down Expand Up @@ -580,20 +623,21 @@
"args": {
"routeName": {
"name": "routeName",
"description": "The route to generate. One of home,page,cart,products,collections,policies,blogs,account,search,robots,sitemap,all.",
"description": "The route to generate. One of account,blogs,cart,collections,home,page,policies,products,robots,search,sitemap,hackdays,all.",
"required": true,
"options": [
"home",
"page",
"account",
"blogs",
"cart",
"products",
"collections",
"home",
"page",
"policies",
"blogs",
"account",
"search",
"products",
"robots",
"search",
"sitemap",
"hackdays",
"all"
]
}
Expand Down Expand Up @@ -636,6 +680,49 @@
},
"args": {}
},
"hydrogen:generate:section": {
"id": "hydrogen:generate:section",
"description": "Generates a commerce component.",
"strict": true,
"pluginName": "@shopify/cli-hydrogen",
"pluginAlias": "@shopify/cli-hydrogen",
"pluginType": "core",
"aliases": [],
"flags": {
"adapter": {
"name": "adapter",
"type": "option",
"description": "Remix adapter used in the route. The default is `@shopify/remix-oxygen`.",
"multiple": false
},
"typescript": {
"name": "typescript",
"type": "boolean",
"description": "Generate TypeScript files",
"allowNo": false
},
"force": {
"name": "force",
"type": "boolean",
"char": "f",
"description": "Overwrite the destination directory and files if they already exist.",
"allowNo": false
},
"path": {
"name": "path",
"type": "option",
"description": "The path to the directory of the Hydrogen storefront. The default is the current directory.",
"multiple": false
}
},
"args": {
"sectionName": {
"name": "sectionName",
"description": "The section to generate}.",
"required": false
}
}
},
"hydrogen:setup:css": {
"id": "hydrogen:setup:css",
"description": "Setup CSS strategies for your project.",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"peerDependencies": {
"@remix-run/react": "^1.17.1",
"@shopify/hydrogen": "^2023.7.0",
"@shopify/hydrogen-react": "^2023.7.0",
"@shopify/remix-oxygen": "^1.1.1"
},
Expand Down
Loading