c8y-nitro 0.9.1 → 0.9.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.
@@ -1,4 +1,4 @@
1
- import { n as name, r as version, t as description } from "../package-CUuWGZoQ.mjs";
1
+ import { n as name, r as version, t as description } from "../package-bl4QZvAk.mjs";
2
2
  import { defineCommand, runMain } from "citty";
3
3
  //#region src/cli/index.ts
4
4
  runMain(defineCommand({
@@ -414,6 +414,18 @@ interface C8yCacheOptions {
414
414
  //#endregion
415
415
  //#region src/types/docker.d.ts
416
416
  interface C8yDockerOptions {
417
+ /**
418
+ * Path to a custom Dockerfile, relative to the Nitro config file location
419
+ * (`rootDir`).
420
+ *
421
+ * When set, the built-in Dockerfile template is **not** generated. The file
422
+ * at this path is copied into the build context and used as-is for the Docker
423
+ * build. The `baseImage` and `extraInstructions` options are ignored when a
424
+ * custom Dockerfile is provided.
425
+ *
426
+ * @example 'docker/Dockerfile'
427
+ */
428
+ dockerfile?: string;
417
429
  /**
418
430
  * Base image for the generated Dockerfile.
419
431
  *
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as C8yNitroModuleOptions } from "./index-Dil1PcDr.mjs";
1
+ import { n as C8yNitroModuleOptions } from "./index-DHd7xpBX.mjs";
2
2
  import { t as TenantCredentials } from "./credentials-eKnJ7m9Y.mjs";
3
3
  import { NitroModule } from "nitro/types";
4
4
  //#region src/index.d.ts
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { _ as GENERATED_READINESS_ROUTE, g as GENERATED_LIVENESS_ROUTE, h as GENERATED_INVALIDATE_TENANT_OPTIONS_ROUTE, m as createC8yManifestFromNitro, p as createC8yManifest } from "./c8y-api-DpCWhaJU.mjs";
2
2
  import { t as autoBootstrap } from "./autoBootstrap-qCcCgset.mjs";
3
- import { n as name } from "./package-CUuWGZoQ.mjs";
4
- import { basename, dirname, join, relative } from "node:path";
5
- import { mkdir, writeFile } from "node:fs/promises";
3
+ import { n as name } from "./package-bl4QZvAk.mjs";
4
+ import { basename, dirname, join, relative, resolve } from "node:path";
5
+ import { copyFile, mkdir, writeFile } from "node:fs/promises";
6
6
  import { x } from "tinyexec";
7
7
  import { join as join$1 } from "pathe";
8
8
  import { mkdir as mkdir$1, readFile as readFile$1, stat, writeFile as writeFile$1 } from "fs/promises";
@@ -249,12 +249,12 @@ async function checkDockerInstalled() {
249
249
  return false;
250
250
  }
251
251
  }
252
- async function writeDockerfile(outputDir, options) {
253
- const outputDirName = basename(outputDir);
252
+ async function writeDockerfile(outputDir, rootDir, options) {
254
253
  const c8yDir = join(outputDir, "../.c8y");
255
254
  const dockerfilePath = join(c8yDir, "Dockerfile");
256
255
  await mkdir(c8yDir, { recursive: true });
257
- await writeFile(dockerfilePath, getDockerfileContent(outputDirName, options), "utf-8");
256
+ if (options.dockerfile) await copyFile(resolve(rootDir, options.dockerfile), dockerfilePath);
257
+ else await writeFile(dockerfilePath, getDockerfileContent(basename(outputDir), options), "utf-8");
258
258
  return c8yDir;
259
259
  }
260
260
  async function buildDockerImage(nitro, c8yDir) {
@@ -309,7 +309,7 @@ async function saveDockerImageToTar(nitro, c8yDir, imageName) {
309
309
  async function createDockerImage(nitro, options = {}) {
310
310
  if (!await checkDockerInstalled()) throw new Error("Docker is not installed or not available in PATH. Please install Docker to build images.");
311
311
  nitro.logger.debug("Creating Docker image...");
312
- const c8yDir = await writeDockerfile(nitro.options.output.dir, options);
312
+ const c8yDir = await writeDockerfile(nitro.options.output.dir, nitro.options.rootDir, options);
313
313
  const imageTarPath = await saveDockerImageToTar(nitro, c8yDir, await buildDockerImage(nitro, c8yDir));
314
314
  nitro.logger.debug("Docker image creation complete.");
315
315
  return imageTarPath;
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "c8y-nitro";
3
- var version = "0.9.1";
3
+ var version = "0.9.2";
4
4
  var description = "Lightning fast Cumulocity IoT microservice development powered by Nitro";
5
5
  //#endregion
6
6
  export { name as n, version as r, description as t };
package/dist/types.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { a as C8YTenantOptionKey, c as C8yDockerOptions, d as C8YManifest, f as C8YManifestOptions, g as C8YAPIClientOptions, h as C8YKnownRole, i as C8YSettingsCategory, l as C8yCacheOptions, m as C8YRoles, n as C8yNitroModuleOptions, o as C8YTenantOptionKeysCacheConfig, p as C8YRole, r as C8yOpenAPIOptions, s as C8yRealtimeOptions, t as C8yDevOptions, u as C8YZipOptions } from "./index-Dil1PcDr.mjs";
1
+ import { a as C8YTenantOptionKey, c as C8yDockerOptions, d as C8YManifest, f as C8YManifestOptions, g as C8YAPIClientOptions, h as C8YKnownRole, i as C8YSettingsCategory, l as C8yCacheOptions, m as C8YRoles, n as C8yNitroModuleOptions, o as C8YTenantOptionKeysCacheConfig, p as C8YRole, r as C8yOpenAPIOptions, s as C8yRealtimeOptions, t as C8yDevOptions, u as C8YZipOptions } from "./index-DHd7xpBX.mjs";
2
2
  import { t as TenantCredentials } from "./credentials-eKnJ7m9Y.mjs";
3
3
  export { C8YAPIClientOptions, type C8YKnownRole, type C8YManifest, type C8YManifestOptions, C8YRole, C8YRoles, C8YSettingsCategory, C8YTenantOptionKey, C8YTenantOptionKeysCacheConfig, type C8YZipOptions, type C8yCacheOptions, C8yDevOptions, type C8yDockerOptions, C8yNitroModuleOptions, C8yOpenAPIOptions, type C8yRealtimeOptions, type TenantCredentials };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c8y-nitro",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "description": "Lightning fast Cumulocity IoT microservice development powered by Nitro",
6
6
  "keywords": [