Skip to content

Commit

Permalink
Merge branch 'release/v0.60.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Aug 31, 2024
2 parents ce4f6bb + b61cb0d commit 9016f31
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zerva/monorepo",
"type": "module",
"version": "0.60.0",
"version": "0.60.1",
"private": true,
"engines": {
"node": ">=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion zerva-bin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zerva/bin",
"type": "module",
"version": "0.60.0",
"version": "0.60.1",
"description": "🌱 Zerva Command Line Tool",
"author": {
"email": "[email protected]",
Expand Down
50 changes: 26 additions & 24 deletions zerva-bin/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,48 @@ import { arrayRemoveElement, parseArgs } from 'zeed'
import { entryCandidates } from './static'

export interface ZervaConf {
version: string
args: any
build: boolean
bun: boolean
deno: boolean
outfile: string
metafile: boolean
help: boolean
esm: boolean
cjs: boolean
sourcemap: boolean
entry: string
debug: boolean
open: boolean
external: string[]
node: []
define: Record<string, string>
loader: Record<string, string>
deno: boolean
entry: string
esbuild: Record<string, string>
args: any
esm: boolean
external: string[]
help: boolean
loader: Record<string, string>
metafile: boolean
mode: string
node: []
open: boolean
outfile: string
sourcemap: boolean
version: string
}

export function getConfig(): ZervaConf {
const config: Partial<ZervaConf> = {
args: {},
build: false,
bun: false,
deno: false,
help: false,
esm: true,
cjs: false,
version: '',
metafile: true,
sourcemap: true,
debug: false,
open: false,
external: [],
define: {},
loader: {},
deno: false,
esbuild: {},
esm: true,
external: [],
help: false,
loader: {},
metafile: true,
mode: 'development',
node: [],
args: {},
open: false,
sourcemap: true,
version: '',
}

try {
Expand Down Expand Up @@ -83,6 +85,7 @@ export function getConfig(): ZervaConf {
config.external = args.external ?? []
config.node = args.node ?? []
config.build = args.build ?? args._.includes('build')
config.mode = args.mode ?? (config.build ? 'production' : 'development')
config.esm = args.cjs !== true // default
config.bun = args.bun
config.deno = args.deno
Expand All @@ -104,7 +107,6 @@ export function getConfig(): ZervaConf {

if (config.build) {
config.outfile = args.outfile ?? resolve(`dist/main.${suffix}`)
config.build = true
}
else {
config.outfile = args.outfile ?? resolve(`.out.${suffix}`)
Expand Down
1 change: 1 addition & 0 deletions zerva-bin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ is restarted on every update.
--define=key:value Text replacement before compiling (see esbuild)
--esbuild=key:value Additional esbuild configs
--node=arg Command line argument to be added to node execution
--mode=mode Is passed to process.env.ZERVA_MODE and is used in @zerva/vite
--bun Execute with bun.sh
--deno Execute with deno.com
`,
Expand Down
1 change: 1 addition & 0 deletions zerva-bin/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ const __dirname = (await import("node:path")).dirname(__filename)`
'ZERVA_DEVELOPMENT': String(!config.build),
'ZERVA_PRODUCTION': String(config.build),
'ZERVA_VERSION': `"${config.version}"`,
'ZERVA_MODE': String(config.mode),
'process.env.ZERVA_DEVELOPMENT': String(!config.build),
'process.env.ZERVA_PRODUCTION': String(config.build),
'process.env.ZERVA_VERSION': `"${config.version}"`,
Expand Down
2 changes: 1 addition & 1 deletion zerva-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zerva/vite",
"type": "module",
"version": "0.60.0",
"version": "0.60.1",
"description": "🌱 Zerva and Vite",
"author": {
"name": "Dirk Holtwick",
Expand Down
4 changes: 2 additions & 2 deletions zerva-vite/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function useVite(config?: {
log(`use ${moduleName} ${process.env.ZERVA}`)
register(moduleName, ['http'])

// const isDevMode = ZERVA_DEVELOPMENT || process.env.ZERVA_VITE || process.env.NODE_MODE === 'development' || process.env.ZERVA_MODE === 'development'
// const isDevMode = ZERVA_DEVELOPMENT || process.env.ZERVA_VITE || process.env.NODE_MODE === 'development'

const {
root = process.cwd(),
Expand Down Expand Up @@ -61,7 +61,7 @@ export function useVite(config?: {
const { createServer } = await import('vite')

const config: InlineConfig = {
mode,
mode: process.env.ZERVA_MODE ?? mode,
root: rootPath,
server: {
middlewareMode: true,
Expand Down

0 comments on commit 9016f31

Please sign in to comment.