Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/kind-plums-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atomicsmash/cli": minor
---

Remove Herd Init command from setup
18 changes: 9 additions & 9 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ smash-cli --help

## Development

To develop this npm package, you will need to do the following after cloning the repo:
To work on this package, navigate to the root of the project and run:

1. `nvm use`
1. `nvm use` - This will set the correct node environment (this is important for permissions for the following step)
2. `npm install`
3. `npm run dev` - To start tracking file changes and will transpile all `.ts` files down into usable `.js` files in dist.

- This will set the correct node environment (this is important for permissions for the following step)

2. `npm link`
Once these commands are done, you're ready to start working on this project. Check the "CHECKLISTS" file for a checklist of tasks for any development work.

- This will create a symlink in your npm global config, effectively pretending that you've installed the package globally.
## Run the package locally

3. `npm run dev`
Navigate to the project/site you would like to work on, then run your selected command using:

- This will transpile all `.ts` files down into usable `.js` files in dist.
`npx <Absolute path to project>/packages/packages/cli <command>`

Once these commands are done, you're ready to start working on this project. Check the "CHECKLISTS" file for a checklist of tasks for any development work.
Instead of a package name from the npm registry, this points directly to a local directory on disk; npx will look inside that folder's package.json for the bin entry and execute it.
17 changes: 2 additions & 15 deletions packages/cli/src/commands/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,33 +108,20 @@ export async function handler() {
"Herd is present on your machine, but the project is missing a herd.yaml file. Please do the initial setup by running herd init.",
);
}
await execute(`herd init`)
.then(() => {
performance.mark("herd init done");
console.log(
`Herd is configured. (${convertMeasureToPrettyString(
performance.measure("herd-or-valet", "Start"),
)})`,
);
})
.catch((error) => {
console.error(error);
throw new Error("Failed to configure the site using Herd.");
});
await execute(`herd link ${projectName} --secure`)
.then(() => {
performance.mark("herd link done");
console.log(
`Herd is linked and secured. (${convertMeasureToPrettyString(
performance.measure("herd link", "herd init done"),
performance.measure("herd link", "Start"),
)})`,
);
})
.catch((error) => {
console.error(error);
throw new Error("Failed to link the site using Herd.");
});
await execute(`herd isolate`)
await execute(`herd isolate --site=${projectName}`)
.then(() => {
console.log(
`Herd is isolated. (${convertMeasureToPrettyString(
Expand Down
Loading