@flydotio/dockerfile
Advanced tools
Comparing version 0.5.7 to 0.5.8
41
gdf.js
@@ -125,3 +125,3 @@ import fs from 'node:fs' | ||
return !!(this.#pj.dependencies?.astro) && | ||
!!(this.#pj.dependencies?.['@astrojs/node']) | ||
!!(this.#pj.dependencies?.['@astrojs/node']) | ||
} | ||
@@ -158,2 +158,6 @@ | ||
get meteor() { | ||
return !!this.#pj.dependencies?.['meteor-node-stubs'] | ||
} | ||
// Does this application use next.js? | ||
@@ -264,2 +268,6 @@ get nextjs() { | ||
if (this.meteor) { | ||
packages.push('python3-pip', 'g++', 'make', 'curl') | ||
} | ||
// https://docs.npmjs.com/cli/v10/configuring-npm/package-json#git-urls-as-dependencies | ||
@@ -447,5 +455,29 @@ if (Object.values(this.#pj.dependencies || {}).some(value => /^git(\+|:|hub:)|^\w+\//.test(value))) { | ||
get nodeVersion() { | ||
const ltsVersion = '20.11.1' | ||
const ltsVersion = '20.15.0' | ||
return process.version.match(/\d+\.\d+\.\d+/)?.[0] || ltsVersion | ||
let version = process.version.match(/\d+\.\d+\.\d+/)?.[0] || ltsVersion | ||
if (this.#pj.engines?.node) { | ||
// determine minimal version from package.json | ||
const { node } = this.#pj.engines | ||
const minversion = node.match(/\d+(\.\d+(\.\d+)?)?/)?.[0].split('.') | ||
if (node.includes('>') && !node.includes('=')) { | ||
minversion.push(parseInt(minversion.pop()) + 1) | ||
} | ||
// ensure version is at least the minimum | ||
version = version.split('.') | ||
for (let i = 0; i < version.length; i++) { | ||
if (minversion[i] > version[i]) { | ||
version = minversion | ||
break | ||
} else if (minversion[i] < version[i]) { | ||
break | ||
} | ||
} | ||
version = version.join('.') | ||
} | ||
return version | ||
} | ||
@@ -701,2 +733,3 @@ | ||
if (this.remix) runtime = 'Remix' | ||
if (this.meteor) runtime = 'Meteor' | ||
if (this.nextjs) runtime = 'Next.js' | ||
@@ -740,2 +773,4 @@ if (this.nuxtjs) runtime = 'Nuxt' | ||
return ['node', '.output/server/index.mjs'] | ||
} else if (this.meteor) { | ||
return ['node', 'main.js'] | ||
} else if (this.gatsby) { | ||
@@ -742,0 +777,0 @@ return [this.npx, 'gatsby', 'serve', '-H', '0.0.0.0'] |
{ | ||
"name": "@flydotio/dockerfile", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "Dockerfile generator", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
Sorry, the diff of this file is not supported yet
67028
1377