@archlast/cli 0.1.6 → 0.1.9

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
@@ -75,7 +75,6 @@ export default {
75
75
  image: "algochad/archlast-server",
76
76
  tag: "latest",
77
77
  containerName: "archlast-server",
78
- volumeName: "archlast-data",
79
78
  },
80
79
  server: { port: 4000 },
81
80
  paths: {
@@ -93,6 +92,9 @@ export default {
93
92
  Environment variables starting with `ARCHLAST_`, `S3_`, `AWS_`, and `STORAGE_`
94
93
  are forwarded into the container.
95
94
 
95
+ If `volumeName` is not set, the CLI generates a unique Docker volume name per
96
+ project to keep data isolated.
97
+
96
98
  ## Dev and deploy flow
97
99
 
98
100
  The server receives deployments at `POST /_archlast/deploy` with payload:
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAcjF;AAED,qBAAa,uBAAwB,SAAQ,KAAK;;CAUjD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY9E;AAED,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAuD5D;AAED,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAK5E;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ9C;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOjD"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAcjF;AAED,qBAAa,uBAAwB,SAAQ,KAAK;;CAUjD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY9E;AAED,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAyD5D;AAED,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAK5E;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ9C;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOjD"}
package/dist/cli.js CHANGED
@@ -316631,6 +316631,8 @@ function readAdminToken(archlastPath) {
316631
316631
  if (archlastPath) {
316632
316632
  searchPaths.push(path6.resolve(archlastPath, ".env.local"));
316633
316633
  searchPaths.push(path6.resolve(archlastPath, ".env"));
316634
+ searchPaths.push(path6.resolve(archlastPath, "apps", "archlast", ".env.local"));
316635
+ searchPaths.push(path6.resolve(archlastPath, "apps", "archlast", ".env"));
316634
316636
  } else {
316635
316637
  searchPaths.push(path6.resolve(process.cwd(), ".env.local"));
316636
316638
  searchPaths.push(path6.resolve(process.cwd(), ".env"));
@@ -320848,7 +320850,7 @@ class DockerManager {
320848
320850
  const expectedBinds = [
320849
320851
  `${config.dataVolumeName}:/data`,
320850
320852
  `${formatBindPath(config.configDir)}:/config:ro`,
320851
- `${formatBindPath(config.deployDir)}:/app/server/.archlast-deploy:ro`
320853
+ `${formatBindPath(config.deployDir)}:/app/server/.archlast-deploy:rw`
320852
320854
  ];
320853
320855
  const bindsMatch = expectedBinds.every((bind) => bindSources.includes(bind));
320854
320856
  if (!imageMatches || !envMatches || !portMatches || !bindsMatch) {
@@ -320876,7 +320878,7 @@ class DockerManager {
320876
320878
  Binds: [
320877
320879
  `${config.dataVolumeName}:/data`,
320878
320880
  `${formatBindPath(config.configDir)}:/config:ro`,
320879
- `${formatBindPath(config.deployDir)}:/app/server/.archlast-deploy:ro`
320881
+ `${formatBindPath(config.deployDir)}:/app/server/.archlast-deploy:rw`
320880
320882
  ],
320881
320883
  PortBindings: {
320882
320884
  [`${config.port}/tcp`]: [{ HostPort: String(config.port) }]
@@ -321114,6 +321116,24 @@ function resolveNumber(value, fallback) {
321114
321116
  const parsed = typeof value === "number" ? value : parseInt(String(value), 10);
321115
321117
  return Number.isFinite(parsed) ? parsed : fallback;
321116
321118
  }
321119
+ function hashString2(value) {
321120
+ let hash = 0;
321121
+ for (let i = 0;i < value.length; i++) {
321122
+ hash = (hash << 5) - hash + value.charCodeAt(i);
321123
+ hash |= 0;
321124
+ }
321125
+ return Math.abs(hash).toString(36);
321126
+ }
321127
+ function normalizeProjectSlug(projectPath) {
321128
+ const base = path10.basename(projectPath);
321129
+ const slug = base.toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "");
321130
+ return slug || "archlast";
321131
+ }
321132
+ function deriveVolumeName(projectPath) {
321133
+ const slug = normalizeProjectSlug(projectPath);
321134
+ const suffix = hashString2(path10.resolve(projectPath)).slice(0, 6);
321135
+ return `${DEFAULTS.docker.volumeName}-${slug}-${suffix}`;
321136
+ }
321117
321137
  function loadDockerConfig(options) {
321118
321138
  const projectPath = path10.resolve(options.path || ".");
321119
321139
  const configFilePath = options.configFile ? resolvePath(projectPath, options.configFile) : path10.join(projectPath, "archlast.config.js");
@@ -321130,7 +321150,8 @@ function loadDockerConfig(options) {
321130
321150
  const image = options.image ?? process.env.ARCHLAST_DOCKER_IMAGE ?? process.env.ARCHLAST_IMAGE ?? configDocker.image ?? envFileVars.ARCHLAST_DOCKER_IMAGE ?? envFileVars.ARCHLAST_IMAGE ?? DEFAULTS.docker.image;
321131
321151
  const tag = options.tag ?? process.env.ARCHLAST_VERSION ?? configDocker.tag ?? envFileVars.ARCHLAST_VERSION ?? DEFAULTS.docker.tag;
321132
321152
  const containerName = options.containerName ?? process.env.ARCHLAST_CONTAINER_NAME ?? configDocker.containerName ?? envFileVars.ARCHLAST_CONTAINER_NAME ?? DEFAULTS.docker.containerName;
321133
- const dataVolumeName = process.env.ARCHLAST_DATA_VOLUME ?? configDocker.volumeName ?? envFileVars.ARCHLAST_DATA_VOLUME ?? DEFAULTS.docker.volumeName;
321153
+ const defaultVolumeName = deriveVolumeName(projectPath);
321154
+ const dataVolumeName = process.env.ARCHLAST_DATA_VOLUME ?? configDocker.volumeName ?? envFileVars.ARCHLAST_DATA_VOLUME ?? defaultVolumeName;
321134
321155
  const configDir = resolvePath(projectPath, process.env.ARCHLAST_CONFIG_DIR ?? configPaths.config ?? envFileVars.ARCHLAST_CONFIG_DIR ?? DEFAULTS.paths.config);
321135
321156
  const deployDir = resolvePath(projectPath, process.env.ARCHLAST_DEPLOY_DIR ?? configPaths.deploy ?? envFileVars.ARCHLAST_DEPLOY_DIR ?? DEFAULTS.paths.deploy);
321136
321157
  const envFromDefaults = { ...DEFAULTS.env };
@@ -321986,7 +322007,7 @@ function generateComposeFile(config) {
321986
322007
  volumes: [
321987
322008
  `${config.dataVolumeName}:/data`,
321988
322009
  `${normalizeDockerPath(config.configDir)}:/config:ro`,
321989
- `${normalizeDockerPath(config.deployDir)}:/app/server/.archlast-deploy:ro`
322010
+ `${normalizeDockerPath(config.deployDir)}:/app/server/.archlast-deploy:rw`
321990
322011
  ],
321991
322012
  environment,
321992
322013
  healthcheck: {
@@ -322349,7 +322370,7 @@ async function configCommand(options) {
322349
322370
 
322350
322371
  // src/cli.ts
322351
322372
  var program2 = new Command;
322352
- program2.name("archlast").description("Archlast CLI for development and deployment").version("0.1.6");
322373
+ program2.name("archlast").description("Archlast CLI for development and deployment").version("0.1.9");
322353
322374
  program2.command("build").description("Generate types without deploying").option("--path <path>", "Path to archlast folder", ".").action(buildCommand);
322354
322375
  program2.command("dev").description("Start development mode with file watching").option("-p, --port <port>", "Server port", "3001").option("--path <path>", "Path to archlast folder", ".").option("--server <url>", "Server URL for code upload", "http://localhost:4000").option("--max-poll <number>", "Maximum server polling retries", "30").action(devCommand);
322355
322376
  program2.command("deploy").description("Deploy to production").option("--path <path>", "Path to archlast folder", ".").option("--server <url>", "Server URL for code upload", "http://localhost:4000").option("--max-poll <number>", "Maximum server polling retries", "30").action(deployCommand);
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/docker/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAkID,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CA2G3E"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/docker/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AA0JD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CA4G3E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archlast/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.9",
4
4
  "description": "Archlast CLI for development and deployment",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",