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: add list command #7408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ Alokai supports two types of stores to accommodate different business needs:
To create a new store, use the `store add` command:

```bash
yarn store add
yarn alokai store add
```

:::tip
run `yarn alokai list` to see all availble commands
:::

The CLI will guide you through configuring your store, including:
- Setting a unique store ID
- Choosing a parent store (or inheriting from base apps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Let's explore how to manage your stores effectively.
The `store add` command guides you through creating a new store and sets up all necessary configurations:

```bash
yarn store add
yarn alokai store add
```

### Store Creation Flow
Expand Down Expand Up @@ -161,7 +161,7 @@ apps/stores/my-brand-us/
The `store move` command helps reorganize your store hierarchy:

```bash
yarn store move
yarn alokai store move
```

### Move Process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The most common way to start development is using the yarn scripts from the root
yarn dev

# Start development for a specific store
yarn store dev --store-id=my-store
yarn alokai store dev --store-id=my-store
# Alternatively, you may use: ./node_modules/.bin/alokai-cli store dev --store-id=my-store
```

Expand Down Expand Up @@ -82,7 +82,7 @@ Alokai uses Caddy as a reverse proxy to handle local domains. The Caddyfile is a
Start all stores with their local domains:

```bash
yarn store dev --all --with-local-domains
yarn alokai store dev --all --with-local-domains
```

:::tip HTTPS
Expand Down Expand Up @@ -117,7 +117,7 @@ yarn test:integration:pw
You can also run tests in Playwright's UI mode for better debugging experience:

```bash
yarn store test --store-id=my-store --ui
yarn alokai store test --store-id=my-store --ui
```

:::warning
Expand Down Expand Up @@ -156,17 +156,17 @@ The `.out` directory contains the composed stores and is in `.gitignore`. If you
1. **Use Store-Specific Development**
When working on a single store, use the `--store-id` flag to improve build times:
```bash
yarn store dev --store-id=my-store
yarn alokai store dev --store-id=my-store
```

2. **Test Inheritance Chain**
When modifying shared code, test all affected stores:
```bash
# See which stores are affected by current changes
yarn store changed
yarn alokai store changed

# Build and test affected stores
yarn store build --store-id=affected-store-id-1,affected-store-id-2
yarn alokai store build --store-id=affected-store-id-1,affected-store-id-2
```

:::tip
Expand All @@ -176,17 +176,17 @@ In the Continuous Integration and Continuous Deployment pipelines, the affected
1. **Debugging Inheritance**
Use the `--verbose` flag to see detailed file resolution:
```bash
yarn store build --store-id=my-store --verbose
yarn alokai store build --store-id=my-store --verbose
```
You can also use the `DEBUG=*` environment variable to get even more logs:
```bash
DEBUG=* yarn store build --store-id=my-store
DEBUG=* yarn alokai store build --store-id=my-store
```

1. **Inspect Store Composition**
Examine how stores are composed in the `.out` directory:
```bash
yarn store build --store-id=my-store --compose-only
yarn alokai store build --store-id=my-store --compose-only
```
This will skip the build and only compose the store into the `.out` directory.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ You can run tests in two modes:
#### Standard Mode
```bash
# Run all tests for a specific store
yarn store test --store-id=fashion-brand
yarn alokai store test --store-id=fashion-brand
```

#### UI Mode (for debugging)
```bash
# Open Playwright UI for interactive debugging
yarn store test --store-id=fashion-brand --ui
yarn alokai store test --store-id=fashion-brand --ui
```

::tip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Ever wondered how Alokai transforms your codebase into a live, running applicati
Ready to deploy your store? It all starts with a single command:

```bash
yarn store deploy
yarn alokai store deploy
```

While this command is typically executed in your [continuous delivery pipeline](/guides/multistore/tooling-and-concepts/deployment/ci-cd), you can also run the deployment locally on your machine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Triggering deployments locally should only be used for development and testing p
One of the great things about Alokai is how simple it makes deployments! The basic deployment command is:

```bash
yarn store deploy --store-id=fashion-brand \
yarn alokai store deploy --store-id=fashion-brand \
--cloud-username=your_username \
--cloud-password=your_password
```
Expand All @@ -204,14 +204,14 @@ export CLI_CLOUD_PASSWORD=your_password

With either approach, you'll only need to specify the store-id:
```bash
yarn store deploy --store-id=fashion-brand
yarn alokai store deploy --store-id=fashion-brand
```
::

That's it! The CLI handles all the complexity of building, packaging, and deploying your store. You can also add `--verbose` flag to see detailed logs:

```bash
yarn store deploy --store-id=fashion-brand \
yarn alokai store deploy --store-id=fashion-brand \
--verbose # Optional: see detailed deployment logs
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The `store deploy` command handles both building and deploying your stores. Ther
steps:
- name: Deploy stores
run: |
yarn store deploy \
yarn alokai store deploy \
--cloud-username ${{ vars.CLOUD_USERNAME }} \
--cloud-password ${{ secrets.CLOUD_PASSWORD }} \
$storeIdsFlag \
Expand All @@ -94,7 +94,7 @@ jobs:
steps:
- name: Deploy store
run: |
yarn store deploy \
yarn alokai store deploy \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The pipeline is the only part I'm not sure about. I assume it's using yarn so it would work the same as the dev env. Please confirm this.

--cloud-username ${{ vars.CLOUD_USERNAME }} \
--cloud-password ${{ secrets.CLOUD_PASSWORD }} \
--store-id ${{ matrix.store_id }} \
Expand All @@ -105,7 +105,7 @@ jobs:

### Understanding Change Detection

The change detection system is a core part of our CI/CD pipeline, implemented in the CLI, with `yarn store changed` command, to ensure consistent behavior across different CI platforms. Here's how it works:
The change detection system is a core part of our CI/CD pipeline, implemented in the CLI, with `yarn alokai store changed` command, to ensure consistent behavior across different CI platforms. Here's how it works:

The change detection system analyzes git differences and determines which stores are affected based on several rules:

Expand Down Expand Up @@ -138,10 +138,10 @@ The change detection system analyzes git differences and determines which stores
- Affected: All stores

5. **Global Dependencies**
Changes to globally configured paths (e.g., shared packages) affect all stores. You can mark global dependencies for the `yarn store changed` command by adding the `--global-dependencies` flag. For example:
Changes to globally configured paths (e.g., shared packages) affect all stores. You can mark global dependencies for the `yarn alokai store changed` command by adding the `--global-dependencies` flag. For example:
```bash
# Mark all packages in the packages directory as global dependencies
yarn store changed --global-dependencies="packages/**"
yarn alokai store changed --global-dependencies="packages/**"
```

6. **File Overrides**
Expand All @@ -159,7 +159,7 @@ The system provides detailed information about why each store was affected:
- `GLOBAL_DEPENDENCIES_CHANGED`: Changes in globally configured paths

::tip
When debugging why a particular store was affected, run the `yarn store changed` command without the `--condensed` flag to see the detailed change report. You can also run the command locally to debug the changes.
When debugging why a particular store was affected, run the `yarn alokai store changed` command without the `--condensed` flag to see the detailed change report. You can also run the command locally to debug the changes.
::

::info Why not use Turbo for change detection?
Expand Down Expand Up @@ -218,7 +218,7 @@ We use a single CLI command:
```yaml
# Do this instead
- name: Detect changes
run: yarn store changed --since $SINCE_SHA --to $TO_SHA
run: yarn alokai store changed --since $SINCE_SHA --to $TO_SHA
```

This approach makes it easy to implement our CI/CD pipeline in any CI system that can run shell commands.
Expand Down
Loading