Skip to content

Commit

Permalink
feat: center image (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeo authored Nov 6, 2024
1 parent 4c1295f commit a67231e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ghjk/lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "0",
"platform": "x86_64-linux",
"platform": "aarch64-darwin",
"moduleEntries": {
"ports": {
"version": "0",
Expand Down
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ ghjk offers a unified abstraction to manage package managers (e.g. cargo, pnpm,

ghjk was designed to be an intermediate alternative between [Earthly](https://github.com/earthly/earthly)/[Dagger](https://github.com/dagger/dagger) (lighter and more flexible) and complex building tools like [Bazel](https://github.com/bazelbuild/bazel/)/[Nix-based devenv](https://github.com/cachix/devenv) (simpler and more extensible). This makes it especially convenient for mono-repos and long-lived projects. See [Metatype](https://github.com/metatypedev/metatype) and its [ghjkfile](https://github.com/metatypedev/metatype/blob/main/ghjk.ts) for a real world example.

![](./ghjk.drawio.svg)
<p align="center">
<img src="./ghjk.drawio.svg" alt="ghjk" />
</p>

## Features

Expand All @@ -36,19 +38,18 @@ curl -fsSL https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/install.sh
In your project, create a configuration file called `ghjk.ts` that look something like:

```ts
// NOTE: All the calls in your `ghjk.ts` file are ultimately modifying the 'sophon' proxy
// NOTE: All the calls in your `ghjk.ts` file are ultimately modifying the 'sophon' proxy
// object exported here.
// WARN: always import `hack.ts` file first
export { sophon } from "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/hack.ts";
import {
install, task,
} from "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/hack.ts";
import node from "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/node.ts";
install,
task,
} from "https://raw.githubusercontent.com/metatypedev/ghjk/0.2.0/hack.ts";
import node from "https://raw.githubusercontent.com/metatypedev/ghjk/0.2.0/ports/node.ts";

// install programs (ports) into your env
install(
node({ version: "14.17.0" }),
);
install(node({ version: "14.17.0" }));

// write simple scripts and execute them using
// `$ ghjk x greet`
Expand All @@ -65,7 +66,7 @@ ghjk sync

### Environments

Ghjk is primarily configured through constructs called "environments" or "envs" for short.
Ghjk is primarily configured through constructs called "environments" or "envs" for short.
They serve as recipes for making (mostly) reproducable posix shells.

```ts
Expand All @@ -90,10 +91,7 @@ ghjk
inherit: false,
// envs can specify posix env vars
vars: { CARGO_TARGET_DIR: "my_target" },
installs: [
ports.cargobi({ crateName: "cargo-insta" }),
ports.act(),
],
installs: [ports.cargobi({ crateName: "cargo-insta" }), ports.act()],
})
// use env hooks to run code on activation/deactivation
.onEnter(ghjk.task(($) => $`echo dev activated`))
Expand Down Expand Up @@ -131,7 +129,7 @@ Once you've configured your environments:

### Ports

TBD: this feature is in development.
TBD: this feature is in development.
Look in the [kitchen sink](./examples/kitchen/ghjk.ts) for what's currently implemented.

### Tasks
Expand All @@ -141,7 +139,7 @@ Look in the [tasks example](./examples/tasks/ghjk.ts) for what's currently imple

#### Anonymous tasks

Tasks that aren't give names cannot be invoked from the CLI.
Tasks that aren't give names cannot be invoked from the CLI.
They can be useful for tasks that are meant to be common dependencies of other tasks.

### `hack.ts`
Expand Down

0 comments on commit a67231e

Please sign in to comment.