@_davideast/jules-env 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@ That's it. The runtime is installed, environment variables are set, and your she
10
10
 
11
11
  ```
12
12
  ✔ brew install dart-sdk
13
- Wrote .jules/shellenv
13
+ Wrote ~/.jules/shellenv
14
14
  export PATH="/opt/homebrew/opt/dart-sdk/bin:$PATH"
15
15
  export DART_SDK="/opt/homebrew/opt/dart-sdk/libexec"
16
16
  ```
@@ -21,7 +21,7 @@ Wrote .jules/shellenv
21
21
 
22
22
  1. **Recipe** — A recipe describes how to install a runtime. It probes the system (e.g., `brew --prefix dart-sdk`) but never modifies it.
23
23
  2. **Plan** — The recipe produces an execution plan: shell commands to run, environment variables to set, and paths to prepend.
24
- 3. **Execute** — The plan runs. Install steps that are already satisfied (checked via an optional `checkCmd`) are skipped. State is persisted to `.jules/shellenv`.
24
+ 3. **Execute** — The plan runs. Install steps that are already satisfied (checked via an optional `checkCmd`) are skipped. State is persisted to `~/.jules/shellenv`.
25
25
 
26
26
  ### Data recipes
27
27
 
@@ -29,7 +29,7 @@ Recipes can also be defined as JSON files. A data recipe is a static execution p
29
29
 
30
30
  ## Shell environment
31
31
 
32
- After execution, `.jules/shellenv` contains the environment your runtime needs:
32
+ After execution, `~/.jules/shellenv` contains the environment your runtime needs:
33
33
 
34
34
  ```bash
35
35
  export PATH="/opt/homebrew/opt/dart-sdk/bin:$PATH"
@@ -39,7 +39,7 @@ export DART_SDK="/opt/homebrew/opt/dart-sdk/libexec"
39
39
  Source it to activate:
40
40
 
41
41
  ```bash
42
- source .jules/shellenv
42
+ source ~/.jules/shellenv
43
43
  ```
44
44
 
45
45
  The file is appended to on subsequent runs, so multiple runtimes compose cleanly.
package/dist/cli.mjs CHANGED
@@ -6028,6 +6028,7 @@ var DataRecipeSchema = z.object({
6028
6028
  import { spawn } from "node:child_process";
6029
6029
  import { mkdir, writeFile, appendFile } from "node:fs/promises";
6030
6030
  import { resolve, dirname } from "node:path";
6031
+ import { homedir } from "node:os";
6031
6032
  async function executePlan(plan, dryRun) {
6032
6033
  if (dryRun) {
6033
6034
  console.log("--- DRY RUN: Execution Plan ---");
@@ -6064,16 +6065,18 @@ async function executePlan(plan, dryRun) {
6064
6065
  }
6065
6066
  }
6066
6067
  }
6067
- for (const file of plan.files) {
6068
- if (dryRun) {
6068
+ if (dryRun) {
6069
+ for (const file of plan.files) {
6069
6070
  console.log(`[File] Write to ${file.path}:`);
6070
6071
  console.log(file.content);
6071
- } else {
6072
+ }
6073
+ } else {
6074
+ await Promise.all(plan.files.map(async (file) => {
6072
6075
  await mkdir(dirname(file.path), { recursive: true });
6073
6076
  await writeFile(file.path, file.content);
6074
- }
6077
+ }));
6075
6078
  }
6076
- const julesDir = resolve(process.cwd(), ".jules");
6079
+ const julesDir = resolve(homedir(), ".jules");
6077
6080
  const stateFile = resolve(julesDir, "shellenv");
6078
6081
  let stateContent = "";
6079
6082
  if (plan.paths.length > 0) {
@@ -6085,13 +6088,13 @@ async function executePlan(plan, dryRun) {
6085
6088
  `;
6086
6089
  }
6087
6090
  if (dryRun) {
6088
- console.log(`[State] Append to .jules/shellenv:`);
6091
+ console.log(`[State] Append to ~/.jules/shellenv:`);
6089
6092
  console.log(stateContent);
6090
6093
  } else {
6091
6094
  if (stateContent) {
6092
6095
  await mkdir(julesDir, { recursive: true });
6093
6096
  await appendFile(stateFile, stateContent);
6094
- console.log(`Updated .jules/shellenv`);
6097
+ console.log(`Updated ~/.jules/shellenv`);
6095
6098
  }
6096
6099
  }
6097
6100
  }
@@ -6140,7 +6143,7 @@ async function resolveLinux() {
6140
6143
  {
6141
6144
  id: "add-dart-repo",
6142
6145
  label: "Add Dart repository",
6143
- cmd: "echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/dart-archive/channels/stable/release/latest/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list > /dev/null",
6146
+ cmd: "echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list > /dev/null",
6144
6147
  checkCmd: "test -f /etc/apt/sources.list.d/dart_stable.list"
6145
6148
  },
6146
6149
  {
@@ -6252,7 +6255,7 @@ var ollama_default = {
6252
6255
  // package.json
6253
6256
  var package_default = {
6254
6257
  name: "@_davideast/jules-env",
6255
- version: "0.1.0",
6258
+ version: "0.1.2",
6256
6259
  description: "Configure ephemeral development environments",
6257
6260
  license: "Apache-2.0",
6258
6261
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_davideast/jules-env",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Configure ephemeral development environments",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",