Skip to content

Commit a426309

Browse files
committed
chore: wip
chore: wip chore: wip chore: wip
1 parent f97f9b8 commit a426309

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1398
-1350
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"extends": "@stacksjs",
33
// need to migrate the following into our config
4-
"ignorePatterns": ["**/README.md"]
4+
"ignorePatterns": ["**/README.md", "**/lint/eslint/**"]
55
}

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ health:
148148
- '.stacks/core/health/**'
149149

150150
lint:
151-
- '.stacks/core/utils/lint/**'
151+
- '.stacks/core/lint/**'
152152

153153
logging:
154154
- '.stacks/core/logging/**'

.stacks/core/actions/src/generate/component-meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { hasComponents } from '@stacksjs/storage'
99
import { generateComponentMeta } from '../helpers/component-meta'
1010

1111
if (hasComponents())
12-
await generateComponentMeta()
12+
generateComponentMeta()
1313

1414
else
1515
log.info('No components found. Skipping component meta generation.')

.stacks/core/actions/src/generate/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export async function generateTypes(options?: GeneratorOptions) {
120120
log.success('Types were generated successfully')
121121
}
122122

123-
export async function generateMigrations() {
123+
export function generateMigrations() {
124124
// const path = frameworkPath('database/schema.prisma')
125125

126126
// await migrate(path, { database: database.driver })
@@ -130,7 +130,7 @@ export async function generateMigrations() {
130130
log.success('Successfully updated migrations')
131131
}
132132

133-
export async function generateTeaConfig() {
133+
export function generateTeaConfig() {
134134
// define your dependencies
135135
const deps = dependencies
136136

.stacks/core/actions/src/helpers/component-meta.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { frameworkPath, join, parse, projectPath } from '@stacksjs/path'
1414
* original script: https://raw.githubusercontent.com/jd-solanki/anu/main/scripts/gen-component-meta.ts
1515
*/
1616

17-
export async function generateComponentMeta() {
17+
export function generateComponentMeta() {
1818
const md = new MarkdownIt()
1919
const checkerOptions: MetaCheckerOptions = {
2020
forceUseTs: true,
@@ -32,8 +32,8 @@ export async function generateComponentMeta() {
3232

3333
// Exclude global props
3434
const props: ComponentApiProps[] = []
35-
meta.props.forEach((prop: any) => {
36-
if (prop.global)
35+
meta.props.forEach((prop) => {
36+
if (prop?.global)
3737
return
3838

3939
const { name, description, required, type, default: defaultValue } = prop
@@ -69,6 +69,7 @@ export async function generateComponentMeta() {
6969
const metaDirPath = frameworkPath('component-meta')
7070

7171
// if meta dir doesn't exist create
72+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
7273
if (!existsSync(metaDirPath))
7374
mkdirSync(metaDirPath)
7475

.stacks/core/actions/src/helpers/lib-entries.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function createVueLibraryEntryPoint(type: LibraryType = 'vue-compon
3636
path: libraryEntryPath(type),
3737
data: generateEntryPointData(type),
3838
}).catch((err) => {
39-
log.error(new Error('There was an error generating the Vue component library entry point.', err))
39+
log.error('There was an error generating the Vue component library entry point.', err)
4040
process.exit(ExitCode.FatalError)
4141
})
4242

@@ -50,7 +50,7 @@ export async function createWebComponentLibraryEntryPoint(type: LibraryType = 'w
5050
path: libraryEntryPath(type),
5151
data: generateEntryPointData(type),
5252
}).catch((err) => {
53-
log.error(new Error('There was an error generating the Web Component library entry point', err))
53+
log.error('There was an error generating the Web Component library entry point', err)
5454
process.exit(ExitCode.FatalError)
5555
})
5656

@@ -64,7 +64,7 @@ export async function createFunctionLibraryEntryPoint(type: LibraryType = 'funct
6464
path: libraryEntryPath(type),
6565
data: generateEntryPointData(type),
6666
}).catch((err) => {
67-
log.error(new Error('There was an error generating Function library entry point', err))
67+
log.error('There was an error generating Function library entry point', err)
6868
process.exit(ExitCode.FatalError)
6969
})
7070

.stacks/core/actions/src/key-generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ import { generateAppKey } from '@stacksjs/security'
77
if (!isFile('.env'))
88
await runCommand('cp .env.example .env', { cwd: projectPath() })
99

10-
await setEnvValue('APP_KEY', await generateAppKey())
10+
await setEnvValue('APP_KEY', generateAppKey())

.stacks/core/actions/src/make.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export async function invoke(options: MakeOptions) {
1010
await component(options)
1111

1212
if (options.database)
13-
await database(options)
13+
database(options)
1414

1515
if (options.factory)
16-
await factory(options)
16+
factory(options)
1717

1818
if (options.function)
1919
await fx(options)
@@ -31,7 +31,7 @@ export async function invoke(options: MakeOptions) {
3131
await page(options)
3232

3333
if (options.stack)
34-
await stack(options)
34+
stack(options)
3535
}
3636

3737
/**
@@ -74,11 +74,11 @@ console.log('Hello World component created')
7474
})
7575
}
7676

77-
export async function database(options: MakeOptions) {
77+
export function database(options: MakeOptions) {
7878
try {
7979
const name = options.name
8080
log.info(`Creating your ${italic(name)} database...`)
81-
await createDatabase(options)
81+
createDatabase(options)
8282
log.success(`Created the ${italic(name)} database`)
8383
}
8484
catch (error) {
@@ -87,16 +87,16 @@ export async function database(options: MakeOptions) {
8787
}
8888
}
8989

90-
export async function createDatabase(options: MakeOptions) {
90+
export function createDatabase(options: MakeOptions) {
9191
// eslint-disable-next-line no-console
9292
console.log('options', options) // wip
9393
}
9494

95-
export async function factory(options: MakeOptions) {
95+
export function factory(options: MakeOptions) {
9696
try {
9797
const name = options.name
9898
log.info(`Creating your ${italic(name)} factory...`)
99-
await createDatabase(options)
99+
createDatabase(options)
100100
log.success(`Created the ${italic(name)} factory`)
101101
}
102102
catch (error) {
@@ -105,7 +105,7 @@ export async function factory(options: MakeOptions) {
105105
}
106106
}
107107

108-
export async function createFactory(options: MakeOptions) {
108+
export function createFactory(options: MakeOptions) {
109109
// eslint-disable-next-line no-console
110110
console.log('options', options) // wip
111111
}
@@ -127,7 +127,7 @@ export async function page(options: MakeOptions) {
127127
try {
128128
const name = options.name
129129
log.info('Creating your page...')
130-
createPage(options)
130+
await createPage(options)
131131
log.success(`Created the ${name} page`)
132132
}
133133
catch (error) {
@@ -192,7 +192,7 @@ export async function language(options: MakeOptions) {
192192
try {
193193
const name = options.name
194194
log.info('Creating your translation file...')
195-
createLanguage(options)
195+
await createLanguage(options)
196196
log.success(`Created the ${name} translation file`)
197197
}
198198
catch (error) {
@@ -211,7 +211,7 @@ export async function createLanguage(options: MakeOptions) {
211211
})
212212
}
213213

214-
export async function stack(options: MakeOptions) {
214+
export function stack(options: MakeOptions) {
215215
try {
216216
const name = options.name
217217
log.info(`Creating your ${name} stack...`)

.stacks/core/actions/src/migrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { generateMigrations } from './generate'
22

3-
await generateMigrations()
3+
generateMigrations()

.stacks/core/actions/src/preinstall.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ import { log } from '@stacksjs/logging'
66
// import { determineDebugLevel } from '@stacksjs/utils'
77

88
// export async function invoke(options?: PreinstallOptions) {
9-
export async function invoke() {
9+
export function invoke() {
1010
try {
11-
// const stdio = determineDebugLevel(options) ? 'inherit' : 'ignore'
12-
1311
log.info('Preinstall check...')
14-
// await spawn('bunx only-allow pnpm', { stdio, cwd: projectPath() })
12+
// ...
1513
log.success('Environment ready')
1614
}
1715
catch (error) {
@@ -25,6 +23,6 @@ export async function invoke() {
2523
* @param options
2624
* @returns
2725
*/
28-
export async function preinstall() {
26+
export function preinstall() {
2927
return invoke()
3028
}

0 commit comments

Comments
 (0)