Skip to content

Commit ed5c28e

Browse files
committed
chore: wip
chore: wip chore: wip
1 parent 88d94da commit ed5c28e

File tree

18 files changed

+984
-14
lines changed

18 files changed

+984
-14
lines changed

.stacks/core/actions/src/domains/add.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { createHostedZone } from '@stacksjs/dns'
33
import { app } from '@stacksjs/config'
44
import { handleError } from '@stacksjs/error-handling'
55
import { projectStoragePath } from '@stacksjs/path'
6-
import { italic, parseOptions, prompt } from '@stacksjs/cli'
6+
import { italic, parseOptions } from '@stacksjs/cli'
7+
import { whois } from '@stacksjs/whois'
78
import { logger } from '@stacksjs/logging'
89

910
interface AddOptions {
@@ -52,6 +53,7 @@ logger.log(italic(`cached in ${projectStoragePath('framework/cache/nameservers.t
5253
logger.log('')
5354
logger.log('Once the nameservers have been updated, re-run the following command:')
5455
logger.log('')
55-
logger.log(`➡️ ${italic('buddy deploy')}`)
56+
logger.log(` ➡️ ${italic('buddy deploy')}`)
5657
logger.log('')
57-
logger.log(italic('If you have any questions, please reach out to us via Discord.'))
58+
logger.log(`Your domain registrar is: ${(await whois(options.domain, true)).parsedData.Registrar}`)
59+
logger.log('If you have any questions, please reach out to us via Discord.')

.stacks/core/buddy/src/commands/deploy.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
/* eslint-disable no-console */
12
import process from 'node:process'
23
import type { CLI, DeployOptions } from '@stacksjs/types'
34
import { runAction } from '@stacksjs/actions'
45
import { intro, italic, outro } from '@stacksjs/cli'
56
import { Action, ExitCode } from '@stacksjs/types'
6-
import { config } from '@stacksjs/config'
77
import { Route53 } from '@aws-sdk/client-route-53'
8+
import app from '~/config/app'
89

910
export function deploy(buddy: CLI) {
1011
const descriptions = {
@@ -18,7 +19,18 @@ export function deploy(buddy: CLI) {
1819
.option('--verbose', descriptions.verbose, { default: false })
1920
.action(async (options: DeployOptions) => {
2021
const perf = await intro('buddy deploy')
21-
const domain = options.domain || config.app.url
22+
const domain = options.domain || app.url
23+
24+
if (!domain) {
25+
console.log('We could not identify a domain to deploy to.')
26+
console.log('Please set your .env or ./config/app.ts properly.')
27+
console.log('')
28+
console.log('ℹ️ Alternatively, specify a domain to deploy via the `--domain` flag.')
29+
console.log('')
30+
console.log(' ➡️ Example: `buddy deploy --domain example.com`')
31+
console.log('')
32+
process.exit(ExitCode.FatalError)
33+
}
2234

2335
if (await hasUserDomainBeenAddedToCloud(domain)) {
2436
options.domain = domain
@@ -27,17 +39,11 @@ export function deploy(buddy: CLI) {
2739
// if the domain hasn't been added to the user's (AWS) cloud, we will add it for them
2840
// and then exit the process with prompts for the user to update their nameservers
2941
else {
30-
// eslint-disable-next-line no-console
3142
console.log('')
32-
// eslint-disable-next-line no-console
33-
console.log(`ℹ️ It appears to be your first ${domain} deployment.`)
34-
// eslint-disable-next-line no-console
43+
console.log(`ℹ️ It appears to be your first ${italic(domain)} deployment.`)
3544
console.log('')
36-
// eslint-disable-next-line no-console
3745
console.log(italic('Let’s ensure your it is connected properly.'))
38-
// eslint-disable-next-line no-console
3946
console.log(italic('One moment...'))
40-
// eslint-disable-next-line no-console
4147
console.log('')
4248

4349
options.domain = domain

.stacks/core/cli/src/exec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function execSync(command: string | string[], options?: CliOptions): Resu
7070
stdout: options?.stdout ?? 'inherit',
7171
stderr: options?.stderr ?? 'inherit',
7272
cwd: options?.cwd ?? import.meta.dir,
73-
env: { ...process.env, ...options?.env },
73+
// env: { ...Bun.env, ...options?.env },
7474
// onExit(subprocess: any, exitCode: any, signalCode: any, error: any) {
7575
// if (exitCode !== ExitCode.Success)
7676
// log.error(error)

.stacks/core/dns/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@
5454
"@stacksjs/error-handling": "workspace:*",
5555
"@stacksjs/path": "workspace:*",
5656
"@stacksjs/storage": "workspace:*",
57+
"@stacksjs/whois": "workspace:*",
5758
"aws-cdk-lib": "^2.96.2"
5859
},
5960
"dependencies": {
6061
"@aws-sdk/client-route-53": "^3.414.0",
6162
"@stacksjs/error-handling": "workspace:*",
6263
"@stacksjs/path": "workspace:*",
6364
"@stacksjs/storage": "workspace:*",
65+
"@stacksjs/strings": "workspace:*",
66+
"@stacksjs/whois": "workspace:*",
6467
"aws-cdk-lib": "^2.96.2"
6568
},
6669
"devDependencies": {

.stacks/core/env/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const enums: EnumObject = {
1717

1818
const handler = {
1919
get: (target: Env, key: EnvKey) => {
20+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2021
const value = target[key] as any
2122

2223
if (value instanceof ValidationEnum)

.stacks/core/types/src/scheduler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { Schedule, Scheduler } from '@stacksjs/scheduler'
1+
export type { Schedule, Scheduler } from '@stacksjs/scheduler'

.stacks/core/types/src/services.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ export interface ServicesOptions {
44
apiKey: string
55
}
66

7+
godaddy?: {
8+
apiKey: string
9+
apiSecret: string
10+
}
11+
712
meilisearch?: {
813
appId: string
914
apiKey: string

.stacks/core/whois/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# whois
2+
3+
Find out domain whois information.
4+
5+
## ☘️ Features
6+
7+
- whois lookup
8+
9+
## 🤖 Usage
10+
11+
```bash
12+
bun install -d @stacksjs/whois
13+
```
14+
15+
Now, you can use it in your project:
16+
17+
```js
18+
import { lookup } from '@stacksjs/whois'
19+
20+
const result = await lookup('google.com')
21+
22+
console.log(result)
23+
```
24+
25+
Learn more in the docs.
26+
27+
## 🧪 Testing
28+
29+
```bash
30+
bun test
31+
```
32+
33+
## 📈 Changelog
34+
35+
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
36+
37+
## 🚜 Contributing
38+
39+
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
40+
41+
## 🏝 Community
42+
43+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
44+
45+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
46+
47+
For casual chit-chat with others using this package:
48+
49+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
50+
51+
## 📄 License
52+
53+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
54+
55+
Made with ❤️

.stacks/core/whois/build.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { log, runCommand } from '@stacksjs/cli'
2+
3+
const result = await runCommand('bun build ./src/index.ts --outdir dist --format esm --external @stacksjs/cli --target bun', {
4+
cwd: import.meta.dir,
5+
})
6+
7+
if (result.isErr())
8+
log.error(result.error)

.stacks/core/whois/package.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "@stacksjs/whois",
3+
"type": "module",
4+
"version": "0.57.4",
5+
"description": "Easily get whois info.",
6+
"author": "Chris Breuer",
7+
"license": "MIT",
8+
"funding": "https://github.com/sponsors/chrisbbreuer",
9+
"homepage": "https://github.com/stacksjs/stacks/tree/main/.stacks/core/whois#readme",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/stacksjs/stacks.git",
13+
"directory": "./.stacks/core/whois"
14+
},
15+
"bugs": {
16+
"url": "https://github.com/stacksjs/stacks/issues"
17+
},
18+
"keywords": [
19+
"whois",
20+
"domain",
21+
"management",
22+
"stacks",
23+
"aws",
24+
"typescript",
25+
"javascript"
26+
],
27+
"exports": {
28+
".": {
29+
"bun": "./src/index.ts",
30+
"import": "./dist/index.js"
31+
},
32+
"./*": {
33+
"bun": "./src/*",
34+
"import": "./dist/*"
35+
}
36+
},
37+
"contributors": [
38+
"Chris Breuer <chris@ow3.org>"
39+
],
40+
"files": [
41+
"dist",
42+
"README.md"
43+
],
44+
"scripts": {
45+
"build": "bun --bun build.ts",
46+
"typecheck": "bun --bun tsc --noEmit",
47+
"prepublishOnly": "bun --bun run build"
48+
},
49+
"peerDependencies": {
50+
"node-fetch": "^3.3.2",
51+
"socks": "^2.7.1"
52+
},
53+
"dependencies": {
54+
"node-fetch": "^3.3.2",
55+
"socks": "^2.7.1"
56+
},
57+
"devDependencies": {
58+
"@stacksjs/development": "workspace:*"
59+
}
60+
}

0 commit comments

Comments
 (0)