Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
chore: wip

chore: release v0.58.60

chore: wip

chore: wip
  • Loading branch information
chrisbbreuer committed Feb 12, 2024
1 parent 81091fc commit d6bf1dd
Show file tree
Hide file tree
Showing 113 changed files with 727 additions and 598 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion routes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ route.get('/api/', () => 'hello world 2') // stacksjs.org/api/
route.get('/api/welcome', () => 'hello world 3') // stacksjs.org/api/welcome
route.get('/api/welcome/', () => 'hello world 4') // stacksjs.org/api/welcome/
route.get('/api/health', () => 'healthy')
route.get('/api/buddy', 'BuddyAction')
// route.get('/api/buddy', 'BuddyAction')

// route.group({ prefix: '/users' }, () => {
// route.before(async (params) => {
Expand Down
3 changes: 2 additions & 1 deletion storage/framework/cloud/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*
cdk.context.json
cdk.out
!.gitignore
2 changes: 0 additions & 2 deletions storage/framework/cloud/.gitkeep

This file was deleted.

File renamed without changes.
File renamed without changes.
112 changes: 112 additions & 0 deletions storage/framework/cloud/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"name": "stacks-cloud",
"type": "module",
"version": "0.58.60",
"description": "The Stacks cloud/serverless integration & implementation.",
"author": "Chris Breuer",
"license": "MIT",
"funding": "https://github.com/sponsors/chrisbbreuer",
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/cloud#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/stacksjs/stacks.git",
"directory": "./storage/framework/core/cloud"
},
"bugs": {
"url": "https://github.com/stacksjs/stacks/issues"
},
"keywords": [
"cloud",
"serverless",
"infrastructure as code",
"automation",
"aws",
"stacks"
],
"exports": {
".": {
"bun": "./src/index.ts",
"import": "./dist/index.js"
},
"./*": {
"bun": "./src/*",
"import": "./dist/*"
}
},
"module": "dist/index.js",
"types": "dist/index.d.ts",
"contributors": [
"Chris Breuer <[email protected]>"
],
"files": [
"README.md",
"dist",
"src"
],
"scripts": {
"bootstrap": "bunx cdk bootstrap",
"deploy": "cd .. && bun run build && cd ./docs && bun run build && cd ../core/cloud && bunx cdk deploy --require-approval never"
},
"peerDependencies": {
"@aws-sdk/client-bedrock": "^3.511.0",
"@aws-sdk/client-cloudformation": "^3.511.0",
"@aws-sdk/client-cloudfront": "^3.511.0",
"@aws-sdk/client-cloudwatch-logs": "^3.511.0",
"@aws-sdk/client-ec2": "^3.511.0",
"@aws-sdk/client-efs": "^3.511.0",
"@aws-sdk/client-iam": "^3.511.0",
"@aws-sdk/client-lambda": "^3.511.0",
"@aws-sdk/client-route-53-domains": "^3.511.0",
"@aws-sdk/client-s3": "^3.511.0",
"@aws-sdk/client-ses": "^3.511.0",
"@aws-sdk/client-sesv2": "^3.511.0",
"@aws-sdk/client-ssm": "^3.511.0",
"@stacksjs/config": "workspace:*",
"@stacksjs/env": "workspace:*",
"@stacksjs/logging": "workspace:*",
"@stacksjs/path": "workspace:*",
"@stacksjs/router": "workspace:*",
"@stacksjs/storage": "workspace:*",
"@stacksjs/strings": "workspace:*",
"@stacksjs/utils": "workspace:*",
"@stacksjs/validation": "workspace:*"
},
"dependencies": {
"@aws-sdk/client-bedrock": "^3.511.0",
"@aws-sdk/client-cloudformation": "^3.511.0",
"@aws-sdk/client-cloudfront": "^3.511.0",
"@aws-sdk/client-cloudwatch-logs": "^3.511.0",
"@aws-sdk/client-dynamodb": "3.511.0",
"@aws-sdk/client-ec2": "^3.511.0",
"@aws-sdk/client-efs": "^3.511.0",
"@aws-sdk/client-iam": "^3.511.0",
"@aws-sdk/client-lambda": "^3.511.0",
"@aws-sdk/client-route-53-domains": "^3.511.0",
"@aws-sdk/client-s3": "^3.511.0",
"@aws-sdk/client-ses": "^3.511.0",
"@aws-sdk/client-sesv2": "^3.511.0",
"@aws-sdk/client-ssm": "^3.511.0",
"@stacksjs/config": "workspace:*",
"@stacksjs/dns": "workspace:*",
"@stacksjs/env": "workspace:*",
"@stacksjs/logging": "workspace:*",
"@stacksjs/path": "workspace:*",
"@stacksjs/router": "workspace:*",
"@stacksjs/storage": "workspace:*",
"@stacksjs/utils": "workspace:*",
"@stacksjs/validation": "workspace:*",
"aws-cdk": "^2.127.0",
"aws-cdk-lib": "^2.127.0",
"aws4fetch": "^1.0.17",
"constructs": "^10.3.0"
},
"devDependencies": {
"@oclif/plugin-plugins": "^4.2.2",
"@stacksjs/cli": "workspace:*",
"@stacksjs/development": "workspace:*",
"@stacksjs/env": "workspace:*",
"jszip": "^3.10.1",
"oclif": "^4.4.11",
"source-map-support": "^0.5.21"
}
}
2 changes: 1 addition & 1 deletion storage/framework/core/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/actions",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "The Stacks actions.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions storage/framework/core/actions/src/clean.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { log } from '@stacksjs/logging'
import { clean } from '@stacksjs/utils'
import { cleanProject } from '@stacksjs/utils'

log.info('Running clean command...')

await clean()
await cleanProject()
3 changes: 1 addition & 2 deletions storage/framework/core/actions/src/dev/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { config } from '@stacksjs/config'

const options = parseOptions()

if (options.verbose)
log.info('Running API dev server via', `bunx vite --config ${p.vitePath('src/api.ts')}`, options)
log.debug('Running API dev server via', `bunx vite --config ${p.vitePath('src/api.ts')}`, options)

serve({
port: config.app.ports?.api, // defaults to 3999
Expand Down
39 changes: 12 additions & 27 deletions storage/framework/core/actions/src/domains/add.ts
Original file line number Diff line number Diff line change
@@ -1,57 +1,42 @@
import process from 'node:process'
import { createHostedZone, getNameservers, updateNameservers } from '@stacksjs/dns'
import { app } from '@stacksjs/config'
import { handleError } from '@stacksjs/error-handling'
import { italic, parseOptions, runCommand } from '@stacksjs/cli'
import { italic, log, parseOptions, runCommand } from '@stacksjs/cli'
import { whois } from '@stacksjs/whois'
import { logger } from '@stacksjs/logging'
import { projectConfigPath } from '@stacksjs/path'

interface AddOptions {
domain?: string
verbose: boolean
}

const parsedOptions = parseOptions()
const options: AddOptions = {
domain: parsedOptions.domain as string,
verbose: parsedOptions.verbose as boolean,
}
const options = parseOptions()
const domain = (options.domain as string | undefined) ?? app.url

if (!options.domain) {
if (app.url) {
options.domain = app.url
}
else {
handleError('there was no domain provided when')
process.exit(1)
}
if (!domain) {
log.error('There was no Domain or App URL provided. Please provide a domain using the --domain flag or add a url to your app config.')
process.exit(1)
}

const result = await createHostedZone(options.domain)
const result = await createHostedZone(domain)

if (result.isErr()) {
handleError(result.error)
process.exit(1)
}

// Update the nameservers
const nameServers = await getNameservers(options.domain)
const nameServers = await getNameservers(domain)

if (!nameServers) {
handleError(`No nameservers found for domain: ${options.domain}. Please ensure the Hosted Zone exists in Route53.`)
handleError(`No nameservers found for domain: ${domain}. Please ensure the Hosted Zone exists in Route53.`)
process.exit(1)
}

await updateNameservers(nameServers)

const nameservers = result.value
const registrar: string = (await whois(options.domain, true)).parsedData.Registrar
const registrar: string = (await whois(domain, true)).parsedData.Registrar

// usually for Route53 registered domains, we don't need to update create a hosted zone as it's already
// done for us. But in case it's not, we still need to ensure it's created before we can deploy
if (registrar.includes('Amazon')) {
if (parsedOptions.deploy) {
if (options.deploy) {
await runCommand('buddy deploy')
}
else {
Expand All @@ -70,7 +55,7 @@ logger.log(` update your ${registrar} nameservers to the following:`)

const emojis = ['1️⃣', '2️⃣', '3️⃣', '4️⃣']
logger.log('')
nameservers.forEach((nameserver, index) => {
nameServers.forEach((nameserver: string, index: number) => {
logger.log(` ${emojis[index]} Nameserver: ${nameserver}`)
})
logger.log('')
Expand Down
7 changes: 6 additions & 1 deletion storage/framework/core/actions/src/lint/fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { projectPath } from '@stacksjs/path'
import { NpmScript } from '@stacksjs/enums'

log.info('Ensuring Code Style...')

const options = parseOptions()
await runCommand(NpmScript.LintFix, { cwd: projectPath() }, options)
await runCommand(NpmScript.LintFix, {
cwd: projectPath(),
...options,
})

log.success('Linted')
2 changes: 1 addition & 1 deletion storage/framework/core/actions/src/migrate/dns.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { generateMigrations } from './generate'
import { generateMigrations } from '../generate'

generateMigrations()
7 changes: 5 additions & 2 deletions storage/framework/core/actions/src/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { intro, outro, runCommand } from '@stacksjs/cli'
import { log } from '@stacksjs/logging'
import { projectPath } from '@stacksjs/path'
import * as storage from '@stacksjs/storage'
import { NpmScript } from '@stacksjs/enums'
import type { UpgradeOptions } from '@stacksjs/types'
import { version } from '../package.json'

Expand Down Expand Up @@ -53,10 +54,12 @@ export async function downloadFrameworkUpdate(options: UpgradeOptions) {
// export async function updateDependencies(options: UpgradeOptions) {
export async function updateDependencies() {
const perf = await intro('buddy upgrade:dependencies')
const result = await runCommand(NpmScript.UpgradeDependencies, options)
const result = await runCommand(NpmScript.UpgradeDependencies, {
cwd: projectPath(),
})

if (result.isErr()) {
outro('While running the upgrade:dependencies command, there was an issue', { startTime: perf, useSeconds: true }, result.error)
await outro('While running the upgrade:dependencies command, there was an issue', { startTime: perf, useSeconds: true }, result.error)
process.exit()
}

Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/ai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/ai",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Stacks Artificial Intelligence.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/alias/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/alias",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "The Stacks aliases.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/analytics",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Stacks Analytics. Privacy-friendly.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/api",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "The Stacks array utilities.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/arrays/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/arrays",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "The Stacks array utilities.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/auth",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "A more simplistic way to authenticate.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/buddy/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/buddy",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Meet Buddy. The Stacks runtime.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/build/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stacksjs/build",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "The Stacks framework build tools and configurations.",
"author": "Chris Breuer",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/bun-create/bud/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bun-examples/bud",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Your project description.",
"author": "your-name <your-email>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/bun-create/buddy/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bun-examples/buddy",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Your project description.",
"author": "your-name <your-email>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/bun-create/stack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bun-examples/stack",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Your project description.",
"author": "your-name <your-email>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/bun-create/stacks/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bun-examples/stacks",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Your project description.",
"author": "your-name <your-email>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion storage/framework/core/bun-create/stx/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bun-examples/stx",
"type": "module",
"version": "0.58.59",
"version": "0.58.60",
"description": "Your project description.",
"author": "your-name <your-email>",
"license": "MIT",
Expand Down
Loading

0 comments on commit d6bf1dd

Please sign in to comment.