@_davideast/jules-env 0.1.2 → 0.2.0

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +95 -2
  2. package/package.json +6 -2
package/dist/cli.mjs CHANGED
@@ -6176,6 +6176,94 @@ var DartRecipe = {
6176
6176
  }
6177
6177
  };
6178
6178
 
6179
+ // src/recipes/flutter.ts
6180
+ import { spawnSync as spawnSync2 } from "node:child_process";
6181
+ async function resolveDarwin2() {
6182
+ const installSteps = [
6183
+ {
6184
+ id: "install-flutter",
6185
+ label: "Install Flutter SDK",
6186
+ cmd: "brew install --cask flutter",
6187
+ checkCmd: "brew list --cask flutter"
6188
+ },
6189
+ {
6190
+ id: "precache-web",
6191
+ label: "Precache Flutter web artifacts",
6192
+ cmd: "flutter precache --web",
6193
+ checkCmd: 'test -d "$(brew --cask --room 2>/dev/null || echo /usr/local/Caskroom)/flutter"/*/flutter/bin/cache/flutter_web_sdk'
6194
+ }
6195
+ ];
6196
+ let flutterRoot = "";
6197
+ try {
6198
+ const result = spawnSync2("brew", ["--cask", "--room"], { encoding: "utf-8" });
6199
+ if (result.status === 0) {
6200
+ const caskroom = result.stdout.trim();
6201
+ const ls = spawnSync2("ls", [caskroom + "/flutter"], { encoding: "utf-8" });
6202
+ if (ls.status === 0) {
6203
+ const version = ls.stdout.trim().split(`
6204
+ `)[0];
6205
+ if (version) {
6206
+ flutterRoot = `${caskroom}/flutter/${version}/flutter`;
6207
+ }
6208
+ }
6209
+ }
6210
+ } catch (e) {}
6211
+ if (!flutterRoot) {
6212
+ flutterRoot = "/usr/local/Caskroom/flutter/latest/flutter";
6213
+ }
6214
+ installSteps[1].checkCmd = `test -d ${flutterRoot}/bin/cache/flutter_web_sdk`;
6215
+ const env = {
6216
+ FLUTTER_ROOT: flutterRoot
6217
+ };
6218
+ const paths = [
6219
+ `${flutterRoot}/bin`
6220
+ ];
6221
+ return ExecutionPlanSchema.parse({ installSteps, env, paths });
6222
+ }
6223
+ async function resolveLinux2() {
6224
+ const installSteps = [
6225
+ {
6226
+ id: "install-flutter-prereqs",
6227
+ label: "Install prerequisites",
6228
+ cmd: "sudo apt-get update && sudo apt-get install -y curl git unzip xz-utils",
6229
+ checkCmd: "dpkg -s curl && dpkg -s git && dpkg -s unzip && dpkg -s xz-utils"
6230
+ },
6231
+ {
6232
+ id: "clone-flutter",
6233
+ label: "Clone Flutter SDK",
6234
+ cmd: "git clone -b stable https://github.com/flutter/flutter.git /usr/local/flutter",
6235
+ checkCmd: "test -d /usr/local/flutter"
6236
+ },
6237
+ {
6238
+ id: "precache-web",
6239
+ label: "Precache Flutter web artifacts",
6240
+ cmd: "/usr/local/flutter/bin/flutter precache --web",
6241
+ checkCmd: "test -d /usr/local/flutter/bin/cache/flutter_web_sdk"
6242
+ }
6243
+ ];
6244
+ const env = {
6245
+ FLUTTER_ROOT: "/usr/local/flutter"
6246
+ };
6247
+ const paths = [
6248
+ "/usr/local/flutter/bin"
6249
+ ];
6250
+ return ExecutionPlanSchema.parse({ installSteps, env, paths });
6251
+ }
6252
+ var FlutterRecipe = {
6253
+ name: "flutter",
6254
+ description: "Flutter SDK (web)",
6255
+ resolve: async (ctx) => {
6256
+ switch (process.platform) {
6257
+ case "darwin":
6258
+ return resolveDarwin2();
6259
+ case "linux":
6260
+ return resolveLinux2();
6261
+ default:
6262
+ throw new Error(`Unsupported platform: ${process.platform}`);
6263
+ }
6264
+ }
6265
+ };
6266
+
6179
6267
  // src/core/loader.ts
6180
6268
  function substituteVars(str, vars) {
6181
6269
  return str.replace(/\{\{(\w+)\}\}/g, (_, key) => {
@@ -6255,7 +6343,7 @@ var ollama_default = {
6255
6343
  // package.json
6256
6344
  var package_default = {
6257
6345
  name: "@_davideast/jules-env",
6258
- version: "0.1.2",
6346
+ version: "0.2.0",
6259
6347
  description: "Configure ephemeral development environments",
6260
6348
  license: "Apache-2.0",
6261
6349
  type: "module",
@@ -6288,7 +6376,11 @@ var package_default = {
6288
6376
  test: "bun test",
6289
6377
  typecheck: "tsc --noEmit",
6290
6378
  "check:all": "bun run scripts/prepublish-checks.ts",
6291
- prepack: "bun run scripts/prepublish-checks.ts"
6379
+ prepack: "bun run scripts/prepublish-checks.ts",
6380
+ docker: "docker build -t jules-env . && docker run --rm -it jules-env"
6381
+ },
6382
+ np: {
6383
+ "2fa": false
6292
6384
  }
6293
6385
  };
6294
6386
 
@@ -6296,6 +6388,7 @@ var package_default = {
6296
6388
  var program2 = new Command;
6297
6389
  var recipes = {
6298
6390
  dart: DartRecipe,
6391
+ flutter: FlutterRecipe,
6299
6392
  ollama: loadDataRecipe(ollama_default)
6300
6393
  };
6301
6394
  program2.name("jules-env").description("Configure ephemeral development environments").version(package_default.version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_davideast/jules-env",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Configure ephemeral development environments",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -33,6 +33,10 @@
33
33
  "test": "bun test",
34
34
  "typecheck": "tsc --noEmit",
35
35
  "check:all": "bun run scripts/prepublish-checks.ts",
36
- "prepack": "bun run scripts/prepublish-checks.ts"
36
+ "prepack": "bun run scripts/prepublish-checks.ts",
37
+ "docker": "docker build -t jules-env . && docker run --rm -it jules-env"
38
+ },
39
+ "np": {
40
+ "2fa": false
37
41
  }
38
42
  }