Skip to content

Commit

Permalink
Remove unused or deprecated packages (Shopify#2279)
Browse files Browse the repository at this point in the history
* Remove create-hydrogen-app from the monorepo

* Remove the cli package from the monorepo

* Remove commit-convention since we no longer use this

* Remove hydrogen-ui from the monorepo

* Remove hydrogen-ui reference
  • Loading branch information
jplhomer authored Nov 7, 2022
1 parent 6310974 commit 60c1997
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 1,301 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["./hydrogen-changelog-config.js", {"repo": "shopify/hydrogen"}],
"commit": false,
"fixed": [["@shopify/hydrogen", "create-hydrogen-app"]],
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "v1.x-2022-07",
Expand Down
92 changes: 0 additions & 92 deletions .github/commit-convention.md

This file was deleted.

48 changes: 0 additions & 48 deletions .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ Hydrogen is a Yarn v1 monorepo. It consists of several key packages:
- `examples`: Illustrative proofs of concept demonstrating integrations and special use cases for Hydrogen
- `templates`: Full working implementations of a Hydrogen storefront (including the Demo Store template)
- `packages/hydrogen`: The Hydrogen React framework & SDK
- `packages/create-hydrogen-app`: The CLI used to scaffold new projects
- `packages/cli`: The CLI used to perform tasks in a Hydrogen app
- `packages/playground`: Test cases used for both manual testing and automated end-to-end tests

For more information, check out the following resources:
Expand Down Expand Up @@ -181,52 +179,6 @@ For context, updating the `codegen.yml` file and running the script does the fol
1. Uses the results of that query to generate a new `graphql.schema.json` (which is a local representation of the Storefront API)
1. Generates / updates the new types in `/packages/hydrogen/src/storefront-api-types.ts` based on the `graphql.schema.json`

## Running a local version of Hydrogen in a Hydrogen app

> Caution:
> You must use `yarn` for all commands, due to issues with NPM and dependencies, even if the prompt tells you to use `npm`.
Follow these instructions to create your own Hydrogen app using the local development version of the Hydrogen framework.

Before running any commands, be sure to build the Hydrogen lib with `yarn dev-lib` or `yarn build`.

```bash
cd packages/create-hydrogen-app && yarn link
```

This makes the executable `create-hydrogen` available globally.

Next, choose an option below.

### Option 1: `localdev` package

This option creates a new Hydrogen app similar to `templates/demo-store` directly in the monorepo under `packages/localdev`. This directory is ignored in git, so your changes will not be tracked.

```terminal
create-hydrogen packages/localdev
# when prompted, use `localdev` for the package name
```

Then run your app:

```terminal
yarn workspace localdev dev
```

### Option 2: Standalone package

> Caution:
> This requires you to have a directory structure on your machine like `~/src/github.com/Shopify/*`, and it requires you to create your custom Hydrogen app in a namespace similar to `~/src/github.com/<namespace>/<your hydrogen app here>`.
1. In the directory you want to create your Hydrogen app, run `LOCAL=true create-hydrogen` and answer the prompts.
1. Run `cd <your app>`.
1. Run `yarn` or `npm i`.
1. Optional. Replace default `hydrogen.config.js` with your own storefront credentials.
1. Run `yarn dev` or `npm run dev` to start your dev server.
1. Open the dev server in your browser at http://localhost:3000.

If you make changes to core Hydrogen packages, then you'll need to delete `node_modules`, install dependencies again and start the server as mentioned above.

## Testing

Hydrogen is tested with unit tests for components, hooks and utilities. It is also tested with a suite of end-to-end tests inspired by [Vite's playground tests](https://github.com/vitejs/vite/tree/main/packages/playground).
Expand Down
4 changes: 0 additions & 4 deletions .github/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,3 @@ To do so, follow these steps for each minor version you need to patch:
**After merging the auto-generated changeset PR, my GitHub Action encountered an Error with the message `No commits between X and changeset-release/Y`**

This happens when changesets does not properly clear out all the changesets in the `.changesets` directory of the hydrogen repo. The soluction is to create a new PR with all of the `.changesets` removed. The GitHub Action will re-run when you merge the second PR.

## Things to consider and improve upon

- Oxygen reads the hydrogen `demo-store` template from the `create-hydrogen-app` package in this repo. Until the Oxygen teams updates their workflow, we need to continue to publish this package whenever the `demo-store` template changes.
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
**/dist/**
packages/hydrogen/graphql.schema.json
**/vendor
packages/hydrogen-ui/storefront.schema.json
packages/hydrogen-ui/coverage/**
docs/
**/coverage/
125 changes: 0 additions & 125 deletions packages/cli/CHANGELOG.md

This file was deleted.

30 changes: 0 additions & 30 deletions packages/cli/README.md

This file was deleted.

Loading

0 comments on commit 60c1997

Please sign in to comment.