@tachyon-gg/railway-deploy 0.1.0 → 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 (3) hide show
  1. package/README.md +5 -6
  2. package/dist/index.js +30 -30
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -158,7 +158,6 @@ domains:
158
158
  - app.example.com # Simple domain
159
159
  - domain: api.example.com # Domain with target port
160
160
  target_port: 8080
161
- domain: simple.example.com # Shorthand for a single domain
162
161
 
163
162
  # Railway-provided domain
164
163
  railway_domain: true # Generate a .up.railway.app domain
@@ -166,8 +165,7 @@ railway_domain: # ...with a specific target port
166
165
  target_port: 3000
167
166
 
168
167
  # TCP proxies (for non-HTTP services like databases)
169
- tcp_proxy: 5432 # Single port
170
- tcp_proxies: [5432, 6379] # Multiple ports
168
+ tcp_proxies: [5432, 6379] # One or more ports
171
169
 
172
170
  # Outbound networking
173
171
  ipv6_egress: true # Enable IPv6 outbound traffic
@@ -232,7 +230,8 @@ variables:
232
230
  APP_VERSION: "%{tag}"
233
231
  DATABASE_URL: ${{Postgres.DATABASE_URL}}
234
232
 
235
- domain: "%{tag}.example.com"
233
+ domains:
234
+ - "%{tag}.example.com"
236
235
 
237
236
  healthcheck:
238
237
  path: /health
@@ -309,7 +308,7 @@ services:
309
308
  volume:
310
309
  mount: /var/lib/postgresql/data
311
310
  name: pg-data
312
- tcp_proxy: 5432
311
+ tcp_proxies: [5432]
313
312
  variables:
314
313
  POSTGRES_DB: myapp
315
314
 
@@ -319,7 +318,7 @@ services:
319
318
  volume:
320
319
  mount: /data
321
320
  name: redis-data
322
- tcp_proxy: 6379
321
+ tcp_proxies: [6379]
323
322
 
324
323
  worker:
325
324
  template: ../services/worker.yaml
package/dist/index.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
@@ -10704,9 +10722,9 @@ var require_instanceOf = __commonJS((exports) => {
10704
10722
  exports.instanceOf = undefined;
10705
10723
  var _inspect = require_inspect();
10706
10724
  var isProduction = globalThis.process && false;
10707
- var instanceOf = isProduction ? function instanceOf(value, constructor) {
10725
+ var instanceOf = isProduction ? function instanceOf2(value, constructor) {
10708
10726
  return value instanceof constructor;
10709
- } : function instanceOf(value, constructor) {
10727
+ } : function instanceOf2(value, constructor) {
10710
10728
  if (value instanceof constructor) {
10711
10729
  return true;
10712
10730
  }
@@ -37437,7 +37455,6 @@ var ServiceTemplateSchema = exports_external.object({
37437
37455
  params: exports_external.record(exports_external.string(), ParamDefSchema).optional(),
37438
37456
  source: SourceConfigSchema.optional(),
37439
37457
  variables: exports_external.record(exports_external.string(), exports_external.string().nullable()).optional(),
37440
- domain: DomainEntrySchema.optional(),
37441
37458
  domains: exports_external.array(DomainEntrySchema).optional(),
37442
37459
  region: RegionConfigSchema.optional(),
37443
37460
  restart_policy: RestartPolicySchema.optional(),
@@ -37460,7 +37477,6 @@ var ServiceTemplateSchema = exports_external.object({
37460
37477
  check_suites: exports_external.boolean().optional(),
37461
37478
  registry_credentials: RegistryCredentialsSchema.optional(),
37462
37479
  railway_domain: RailwayDomainSchema,
37463
- tcp_proxy: exports_external.number().int().positive().optional(),
37464
37480
  tcp_proxies: exports_external.array(exports_external.number().int().positive()).optional(),
37465
37481
  limits: LimitsConfigSchema,
37466
37482
  railway_config_file: exports_external.string().optional(),
@@ -37471,7 +37487,6 @@ var ServiceEntrySchema = exports_external.object({
37471
37487
  params: exports_external.record(exports_external.string(), exports_external.string()).optional(),
37472
37488
  variables: exports_external.record(exports_external.string(), exports_external.string().nullable()).optional(),
37473
37489
  source: SourceConfigSchema.optional(),
37474
- domain: DomainEntrySchema.optional(),
37475
37490
  domains: exports_external.array(DomainEntrySchema).optional(),
37476
37491
  volume: VolumeConfigSchema.optional(),
37477
37492
  region: RegionConfigSchema.optional(),
@@ -37494,7 +37509,6 @@ var ServiceEntrySchema = exports_external.object({
37494
37509
  check_suites: exports_external.boolean().optional(),
37495
37510
  registry_credentials: RegistryCredentialsSchema.optional(),
37496
37511
  railway_domain: RailwayDomainSchema,
37497
- tcp_proxy: exports_external.number().int().positive().optional(),
37498
37512
  tcp_proxies: exports_external.array(exports_external.number().int().positive()).optional(),
37499
37513
  limits: LimitsConfigSchema,
37500
37514
  railway_config_file: exports_external.string().optional(),
@@ -37571,17 +37585,10 @@ function normalizeDomainEntry(entry) {
37571
37585
  ...entry.target_port !== undefined ? { targetPort: entry.target_port } : {}
37572
37586
  };
37573
37587
  }
37574
- function normalizeDomains(domain2, domains) {
37575
- const result = [];
37576
- if (domains)
37577
- result.push(...domains.map(normalizeDomainEntry));
37578
- if (domain2) {
37579
- const normalized = normalizeDomainEntry(domain2);
37580
- if (!result.some((d) => d.domain === normalized.domain)) {
37581
- result.push(normalized);
37582
- }
37583
- }
37584
- return result;
37588
+ function normalizeDomains(domains) {
37589
+ if (!domains)
37590
+ return [];
37591
+ return domains.map(normalizeDomainEntry);
37585
37592
  }
37586
37593
  function loadEnvironmentConfig(envFilePath) {
37587
37594
  const absPath = resolve(envFilePath);
@@ -37682,18 +37689,16 @@ function resolveService(name, entry, envDir) {
37682
37689
  const checkSuites = template?.check_suites ?? entry.check_suites;
37683
37690
  const registryCredentials = template?.registry_credentials ?? entry.registry_credentials;
37684
37691
  const railwayDomain = template?.railway_domain ?? entry.railway_domain;
37685
- const tcpProxy = template?.tcp_proxy ?? entry.tcp_proxy;
37686
37692
  const tcpProxies = template?.tcp_proxies ?? entry.tcp_proxies;
37687
37693
  const limits = template?.limits ?? entry.limits;
37688
37694
  const railwayConfigFile = template?.railway_config_file ? expandParamsDeep(template.railway_config_file, params) : entry.railway_config_file;
37689
37695
  const staticOutboundIps = template?.static_outbound_ips ?? entry.static_outbound_ips;
37690
37696
  let templateDomains = [];
37691
37697
  if (template) {
37692
- const tplDomain = template.domain ? expandParamsDeep(template.domain, params) : undefined;
37693
37698
  const tplDomains = template.domains ? expandParamsDeep(template.domains, params) : undefined;
37694
- templateDomains = normalizeDomains(tplDomain, tplDomains);
37699
+ templateDomains = normalizeDomains(tplDomains);
37695
37700
  }
37696
- const entryDomains = normalizeDomains(entry.domain, entry.domains);
37701
+ const entryDomains = normalizeDomains(entry.domains);
37697
37702
  if (entry.source)
37698
37703
  source = entry.source;
37699
37704
  const domains = entryDomains.length > 0 ? entryDomains : templateDomains;
@@ -37782,13 +37787,8 @@ function resolveService(name, entry, envDir) {
37782
37787
  service.railwayDomain = { targetPort: railwayDomain.target_port };
37783
37788
  }
37784
37789
  }
37785
- const allTcpPorts = [];
37786
- if (tcpProxies)
37787
- allTcpPorts.push(...tcpProxies);
37788
- if (tcpProxy !== undefined && !allTcpPorts.includes(tcpProxy))
37789
- allTcpPorts.push(tcpProxy);
37790
- if (allTcpPorts.length > 0)
37791
- service.tcpProxies = allTcpPorts;
37790
+ if (tcpProxies && tcpProxies.length > 0)
37791
+ service.tcpProxies = tcpProxies;
37792
37792
  if (limits) {
37793
37793
  service.limits = {
37794
37794
  ...limits.memory_gb !== undefined ? { memoryGB: limits.memory_gb } : {},
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@tachyon-gg/railway-deploy",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/tachyon-gg/railway-deploy"
8
+ },
5
9
  "main": "./dist/index.js",
6
10
  "exports": {
7
11
  ".": "./dist/index.js"