@m14i/sith 1.9.0 → 1.10.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.
package/dist/index.js CHANGED
@@ -43271,8 +43271,10 @@ async function runShell() {
43271
43271
  `${process.cwd()}:${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.workspaceMount}`,
43272
43272
  "-e",
43273
43273
  `GITHUB_TOKEN=${process.env.GITHUB_TOKEN || ""}`,
43274
+ "--entrypoint",
43275
+ "nix-shell",
43274
43276
  _config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.imageName,
43275
- "bash",
43277
+ _config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.shellEntrypoint,
43276
43278
  ];
43277
43279
  try {
43278
43280
  await (0,execa__WEBPACK_IMPORTED_MODULE_6__/* .execa */ .Ho)("docker", dockerArgs, {
@@ -43340,6 +43342,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
43340
43342
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(6928);
43341
43343
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nccwpck_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
43342
43344
  /* harmony import */ var update_notifier__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(6213);
43345
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(9611);
43343
43346
  /* harmony import */ var _commands_docker_js__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(5515);
43344
43347
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_commands_docker_js__WEBPACK_IMPORTED_MODULE_4__]);
43345
43348
  _commands_docker_js__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
@@ -43349,6 +43352,7 @@ _commands_docker_js__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies
43349
43352
 
43350
43353
 
43351
43354
 
43355
+
43352
43356
  // Import package.json for version and update checks
43353
43357
  const __filename = (0,url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath)(import.meta.url);
43354
43358
  const __dirname = (0,path__WEBPACK_IMPORTED_MODULE_3__.dirname)(__filename);
@@ -43356,8 +43360,29 @@ const pkg = JSON.parse((0,fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync)(__nccwpc
43356
43360
  const PROGRAM_NAME = 'sith';
43357
43361
  const PROGRAM_VERSION = pkg.version;
43358
43362
  const PROGRAM_DESCRIPTION = 'Turn your context to the dark side. Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.';
43359
- // Check for updates
43360
- (0,update_notifier__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({ pkg }).notify();
43363
+ // Check for updates (automatic background check)
43364
+ const notifier = (0,update_notifier__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({ pkg });
43365
+ notifier.notify();
43366
+ async function checkForUpdates() {
43367
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.cyan('Checking for updates...'));
43368
+ // Force update check by setting updateCheckInterval to 0
43369
+ const notifier = (0,update_notifier__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
43370
+ pkg,
43371
+ updateCheckInterval: 0
43372
+ });
43373
+ // Fetch the latest version
43374
+ await notifier.fetchInfo();
43375
+ const update = notifier.update;
43376
+ if (update && update.latest !== pkg.version) {
43377
+ console.log();
43378
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.green(`Update available: ${chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.dim(pkg.version)} → ${chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.bold(update.latest)}`));
43379
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.cyan(`Run ${chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.bold(`npm install -g ${pkg.name}`)} to update`));
43380
+ console.log();
43381
+ }
43382
+ else {
43383
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.green(`✓ You're on the latest version (${pkg.version})`));
43384
+ }
43385
+ }
43361
43386
  function createProgram() {
43362
43387
  const program = new commander__WEBPACK_IMPORTED_MODULE_0__/* .Command */ .uB();
43363
43388
  program
@@ -43366,11 +43391,15 @@ function createProgram() {
43366
43391
  .version(PROGRAM_VERSION)
43367
43392
  .option('--pull', 'Pull prebuilt Docker image (recommended)')
43368
43393
  .option('--build', 'Build the Docker image from scratch')
43369
- .option('--it', 'Launch interactive shell in Docker container');
43394
+ .option('--it', 'Launch interactive shell in Docker container')
43395
+ .option('--update', 'Check for updates');
43370
43396
  // Default action - show interactive menu or run shell with --it
43371
43397
  program
43372
43398
  .action(async (options) => {
43373
- if (options.it) {
43399
+ if (options.update) {
43400
+ await checkForUpdates();
43401
+ }
43402
+ else if (options.it) {
43374
43403
  await (0,_commands_docker_js__WEBPACK_IMPORTED_MODULE_4__/* .runShellDirect */ .l)();
43375
43404
  }
43376
43405
  else {
package/dist/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@m14i/sith","version":"1.9.0","description":"Turn your context to the dark side. Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.","type":"module","repository":{"type":"git","url":"https://github.com/MerzoukeMansouri/sith.git"},"bin":{"sith":"./dist/index.js"},"scripts":{"build":"ncc build src/index.ts -o dist && rm -rf dist/assets && cp -r assets dist/","dev":"tsx src/index.ts","dev:build":"pnpm build && node dist/index.js","dev:shell":"pnpm build && node dist/index.js shell","typecheck":"tsc --noEmit","clean":"rm -rf dist","prepublishOnly":"pnpm build"},"files":["dist","assets","docker"],"keywords":["opencode","docker","ci","automation","cli","nix"],"author":"","license":"MIT","dependencies":{"@inquirer/prompts":"^5.0.0","chalk":"^5.3.0","commander":"^12.1.0","execa":"^9.0.0","ink":"^7.0.3","react":"^19.2.6","update-notifier":"^7.3.1"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@types/node":"^20.12.7","@types/react":"^19.2.14","@types/update-notifier":"^6.0.8","@vercel/ncc":"^0.38.1","semantic-release":"^24.2.0","tsx":"^4.7.2","typescript":"^5.4.5"},"engines":{"node":">=18"}}
1
+ {"name":"@m14i/sith","version":"1.10.0","description":"Turn your context to the dark side. Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.","type":"module","repository":{"type":"git","url":"https://github.com/MerzoukeMansouri/sith.git"},"bin":{"sith":"./dist/index.js"},"scripts":{"build":"ncc build src/index.ts -o dist && rm -rf dist/assets && cp -r assets dist/","dev":"tsx src/index.ts","dev:build":"pnpm build && node dist/index.js","dev:shell":"pnpm build && node dist/index.js shell","typecheck":"tsc --noEmit","clean":"rm -rf dist","prepublishOnly":"pnpm build"},"files":["dist","assets","docker"],"keywords":["opencode","docker","ci","automation","cli","nix"],"author":"","license":"MIT","dependencies":{"@inquirer/prompts":"^5.0.0","chalk":"^5.3.0","commander":"^12.1.0","execa":"^9.0.0","ink":"^7.0.3","react":"^19.2.6","update-notifier":"^7.3.1"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@types/node":"^20.12.7","@types/react":"^19.2.14","@types/update-notifier":"^6.0.8","@vercel/ncc":"^0.38.1","semantic-release":"^24.2.0","tsx":"^4.7.2","typescript":"^5.4.5"},"engines":{"node":">=18"}}
package/docker/Dockerfile CHANGED
@@ -25,11 +25,9 @@ COPY docker/nix/ /opt/sith/nix/
25
25
  # Configurer npm pour utiliser le registry public
26
26
  RUN echo "registry=https://registry.npmjs.org/" > /root/.npmrc
27
27
 
28
- # Generate flake.lock and pre-build environment with profile
29
- RUN cd /opt/sith/nix && \
30
- nix flake lock && \
31
- nix develop --profile /opt/sith/nix-profile --command echo '✅ Flake environment cached' && \
32
- nix-store --gc --print-dead
28
+ # Pré-charger l'environnement Nix (installe tous les packages)
29
+ # Cela cache les dépendances dans le layer Docker
30
+ RUN nix-shell /opt/sith/nix/shell.nix --run "echo '✅ Environment cached'"
33
31
 
34
32
  # Installer OpenCode CLI via script officiel
35
33
  RUN nix-shell /opt/sith/nix/shell.nix --run " \
@@ -60,6 +58,7 @@ COPY --from=builder /opt/sith/ /opt/sith/
60
58
 
61
59
  # Copier les binaires et configuration Nix depuis builder
62
60
  COPY --from=builder /nix/store /nix/store
61
+ COPY --from=builder /nix/var /nix/var
63
62
  COPY --from=builder /root/.opencode /root/.opencode
64
63
  COPY --from=builder /root/.npmrc /root/.npmrc
65
64
 
@@ -108,8 +107,8 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
108
107
  # Répertoire de travail pour les projets
109
108
  WORKDIR /workspace
110
109
 
111
- # Point d'entrée via nix develop (flakes) with cached profile
112
- ENTRYPOINT ["sh", "-c", "cd /opt/sith/nix && nix develop --offline --command"]
110
+ # Point d'entrée via nix-shell
111
+ ENTRYPOINT ["nix-shell", "/opt/sith/nix/shell.nix", "--run"]
113
112
 
114
113
  # Commande par défaut
115
114
  CMD ["opencode --help"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m14i/sith",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Turn your context to the dark side. Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.",
5
5
  "type": "module",
6
6
  "repository": {