Skip to content

Commit 1f7dd08

Browse files
committed
chore: wip
1 parent 4e960a7 commit 1f7dd08

File tree

16 files changed

+36
-16
lines changed

16 files changed

+36
-16
lines changed

bun.lockb

208 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './helpers'
2-
export * as actions from './helpers'
1+
export * from './helpers/utils'
2+
export * as actions from './helpers/utils'

storage/framework/core/actions/src/domains/add.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import process from 'node:process'
22
import { createHostedZone, getNameservers, updateNameservers } from '@stacksjs/dns'
3+
import { handleError } from '@stacksjs/error-handling'
34
import { app } from '@stacksjs/config'
45
import { italic, log, parseOptions, runCommand } from '@stacksjs/cli'
56
import { whois } from '@stacksjs/whois'

storage/framework/core/actions/src/domains/purchase.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { purchaseDomain } from '@stacksjs/cloud'
55
import { config } from '@stacksjs/config'
66
import { handleError } from '@stacksjs/error-handling'
77
import { ExitCode } from '@stacksjs/types'
8+
import type { CountryCode } from '@aws-sdk/client-route-53-domains'
9+
import { ContactType } from '@aws-sdk/client-route-53-domains'
810

911
const c = config.dns.contactInfo
1012
if (!c) {
@@ -24,7 +26,7 @@ const defaultOptions: PurchaseOptions = {
2426
registrantAddressLine2: c.addressLine2 as string,
2527
registrantCity: c.city as string,
2628
registrantState: c.state as string,
27-
registrantCountry: c.countryCode as string,
29+
registrantCountry: c.countryCode as CountryCode,
2830
registrantZip: c.zip as string,
2931
registrantPhone: c.phoneNumber as string,
3032
registrantEmail: c.email as string,
@@ -35,7 +37,7 @@ const defaultOptions: PurchaseOptions = {
3537
adminAddressLine2: c.admin?.addressLine2 || c.addressLine2 as string,
3638
adminCity: c.admin?.city || c.city as string,
3739
adminState: c.admin?.state || c.state as string,
38-
adminCountry: c.admin?.countryCode || c.countryCode as string,
40+
adminCountry: c.admin?.countryCode as CountryCode || c.countryCode as string,
3941
adminZip: c.admin?.zip || c.zip as string,
4042
adminPhone: c.admin?.phoneNumber as string || c.phoneNumber as string,
4143
adminEmail: c.admin?.email || c.email as string,
@@ -46,14 +48,14 @@ const defaultOptions: PurchaseOptions = {
4648
techAddressLine2: c.tech?.addressLine2 || c.addressLine2 as string,
4749
techCity: c.tech?.city || c.city as string,
4850
techState: c.tech?.state || c.state as string,
49-
techCountry: c.tech?.countryCode || c.countryCode as string,
51+
techCountry: c.tech?.countryCode as CountryCode || c.countryCode as string,
5052
techZip: c.tech?.zip || c.zip as string,
5153
techPhone: c.tech?.phoneNumber as string || c.phoneNumber as string,
5254
techEmail: c.tech?.email || c.email as string,
5355
privacyAdmin: c.privacyAdmin || c.privacy || true,
5456
privacyTech: c.privacyTech || c.privacy || true,
5557
privacyRegistrant: c.privacyRegistrant || c.privacy || true,
56-
contactType: 'person',
58+
contactType: ContactType.PERSON,
5759
verbose: false,
5860
}
5961

storage/framework/core/actions/src/fresh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import process from 'node:process'
22
import { ExitCode } from '@stacksjs/types'
33
import { runCommand } from '@stacksjs/cli'
44
import { logger } from '@stacksjs/logging'
5+
import { handleError } from '@stacksjs/error-handling'
56
import { projectPath } from '@stacksjs/path'
67
import { cleanProject } from '@stacksjs/utils'
78

storage/framework/core/actions/src/generate/custom-cli-file.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import process from 'node:process'
22
import { ExitCode } from '@stacksjs/types'
33
import { writeTextFile } from '@stacksjs/storage'
4+
import { log } from '@stacksjs/logging'
45
import { projectPath } from '@stacksjs/path'
56
import { cli } from '@stacksjs/config'
67

storage/framework/core/actions/src/generate/pkgx-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// generates the pkgx file based on the user configuration
22
import { config } from '@stacksjs/config'
3-
import { runCommand } from '@stacksjs/cli'
3+
import { log, runCommand } from '@stacksjs/cli'
44

55
// @ts-expect-error - no types
66
import data from '../../../../../pkgx.yaml'

storage/framework/core/actions/src/helpers/component-meta.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { frameworkPath, join, parse, projectPath } from '@stacksjs/path'
1+
import { frameworkPath, join, path, projectPath } from '@stacksjs/path'
22
import { existsSync, glob, mkdirSync, writeFileSync } from '@stacksjs/storage'
33
import MarkdownIt from 'markdown-it'
44
import { type ComponentMeta, type MetaCheckerOptions, createComponentMetaChecker } from 'vue-component-meta'
@@ -62,7 +62,7 @@ export function generateComponentMeta() {
6262

6363
components.forEach((componentPath) => {
6464
// Thanks: https://futurestud.io/tutorials/node-js-get-a-file-name-with-or-without-extension
65-
const componentExportName = parse(componentPath).name
65+
const componentExportName = path.parse(componentPath).name
6666
const meta = filterMeta(tsconfigChecker.getComponentMeta(componentPath, componentExportName))
6767

6868
const metaDirPath = frameworkPath('component-meta')

storage/framework/core/actions/src/helpers/lib-entries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function generateEntryPointData(type: LibraryType): string {
125125
if (Array.isArray(component)) {
126126
imports.push(`import ${component[1]} from '${componentsPath(component[0])}.stx'`)
127127
declarations.push(`const ${component[1]}CustomElement = defineCustomElement(${component[1]})`)
128-
definitions.push(`customElements.define('${kebabCase(component[1])}', ${component[1]}CustomElement)`)
128+
definitions.push(`customElements.define('${kebabCase(component[1]!)}', ${component[1]}CustomElement)`)
129129
}
130130
else {
131131
imports.push(`import ${component} from '${componentsPath(component)}.stx'`)

storage/framework/core/actions/src/make.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ export async function createMigration(options: MakeOptions) {
259259
const optionName = options.name
260260
// const table = options.tableName
261261
const table = 'dummy-name'
262+
263+
if (!optionName[0])
264+
throw new Error('options.name is required and cannot be empty')
265+
262266
const name = optionName[0].toUpperCase() + optionName.slice(1)
263267
const path = frameworkPath(`database/migrations/${name}.ts`)
264268

@@ -277,13 +281,17 @@ export async function up(db: Kysely<any>): Promise<void> {
277281

278282
log.success(`Successfully created your migration file at stacks/database/migrations/${name}.ts`)
279283
}
280-
catch (error) {
284+
catch (error: any) {
281285
log.error(error)
282286
}
283287
}
284288

285289
export async function createModel(options: MakeOptions) {
286290
const optionName = options.name
291+
292+
if (!optionName[0])
293+
throw new Error('options.name is required and cannot be empty')
294+
287295
const name = optionName[0].toUpperCase() + optionName.slice(1)
288296
const path = projectPath(`app/Models/${name}.ts`)
289297
try {
@@ -316,7 +324,7 @@ export default <Model> {
316324

317325
log.success(`Successfully created your model at app/Models/${name}.ts`)
318326
}
319-
catch (error) {
327+
catch (error: any) {
320328
log.error(error)
321329
}
322330
}

0 commit comments

Comments
 (0)