Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Mar 12, 2024
1 parent dbda38c commit baff004
Show file tree
Hide file tree
Showing 58 changed files with 693 additions and 78 deletions.
6 changes: 4 additions & 2 deletions storage/framework/core/actions/build.ts
@@ -1,6 +1,8 @@
import { outro } from '@stacksjs/build'
import { intro, outro } from '@stacksjs/build'

const startTime = Date.now()
const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
root: './src',
Expand Down
13 changes: 12 additions & 1 deletion storage/framework/core/ai/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
root: './src',

entrypoints: [
Expand All @@ -12,5 +18,10 @@ await Bun.build({
'@aws-sdk/client-bedrock-runtime',
'@aws-sdk/client-bedrock',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/alias/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: [
'./src/index.ts',
],
Expand All @@ -9,5 +15,10 @@ await Bun.build({
external: [
'@stacksjs/path',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/analytics/build.ts
@@ -1,9 +1,20 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: [
'./src/index.ts',
],

outdir: './dist',
format: 'esm',
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/build/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',
Expand All @@ -7,5 +13,10 @@ await Bun.build({
'bun',
'@stacksjs/vite',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
15 changes: 13 additions & 2 deletions storage/framework/core/build/src/index.ts
@@ -1,7 +1,7 @@
import process from 'node:process'
import { path as p } from '@stacksjs/path'
import { fs, glob } from '@stacksjs/storage'
import { bold, dim, log } from '@stacksjs/cli'
import { bold, dim, green, italic, log } from '@stacksjs/cli'

export {
vueComponentExample,
Expand Down Expand Up @@ -50,5 +50,16 @@ export async function outro(options: {
console.log(`${bold(dim(`[${sizeStr}]`))} ${dim('dist/')}${relativeFilePath}`)
}

log.success(`${bold(dim(`[${timeTaken}ms]`))} Built ${pkgName}`)
log.success(`${bold(dim(`[${timeTaken}ms]`))} Built ${italic(bold(green(pkgName)))}`)
}

export async function intro(options: {
dir: string
}) {
const pkgName = `@stacksjs/${p.basename(options.dir)}`

log.info(`Building ${italic(pkgName)}...`)
const startTime = Date.now()

return { startTime }
}
13 changes: 12 additions & 1 deletion storage/framework/core/cache/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],

outdir: './dist',
Expand All @@ -9,5 +15,10 @@ await Bun.build({
'ioredis',
'@stacksjs/config',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/chat/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],

outdir: './dist',
Expand All @@ -9,5 +15,10 @@ await Bun.build({
'@stacksjs/cli',
'@stacksjs/error-handling',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/cli/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
target: 'bun',
Expand All @@ -19,5 +25,10 @@ await Bun.build({
'cac',
'@stacksjs/collections',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
19 changes: 17 additions & 2 deletions storage/framework/core/cloud/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
target: 'bun',
Expand Down Expand Up @@ -71,8 +77,17 @@ await Bun.build({
})

// Building the edge/origin-request separately
await Bun.build({
const res = await Bun.build({
entrypoints: ['./src/edge/origin-request.ts'],
outdir: './dist',
// Specify any additional options if needed
})

if (!res.success)
throw new Error('Failed to build edge/origin-request')

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/collections/build.ts
@@ -1,10 +1,21 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',

external: [
'collect.js',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/config/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',
Expand All @@ -18,5 +24,10 @@ await Bun.build({
'validator',
'@vinejs/vine',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/database/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',
Expand All @@ -15,5 +21,10 @@ await Bun.build({
'kysely',
'mysql2',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/datetime/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',
Expand All @@ -9,5 +15,10 @@ await Bun.build({
'bun',
'@stacksjs/utils',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/desktop/build.ts
@@ -1,7 +1,18 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',
target: 'bun',
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/development/build.ts
@@ -1,7 +1,18 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',
target: 'bun',
})

await outro({
dir: import.meta.dir,
startTime,
result,
})
13 changes: 12 additions & 1 deletion storage/framework/core/dns/build.ts
@@ -1,4 +1,10 @@
await Bun.build({
import { intro, outro } from '@stacksjs/build'

const { startTime } = await intro({
dir: import.meta.dir,
})

const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
format: 'esm',
Expand All @@ -21,5 +27,10 @@ await Bun.build({
'@aws-sdk/client-route-53-domains',
'@stacksjs/types',
],
})

await outro({
dir: import.meta.dir,
startTime,
result,
})

0 comments on commit baff004

Please sign in to comment.