Skip to content

Commit 5e466e1

Browse files
committed
chore: wip
1 parent 751e298 commit 5e466e1

File tree

8 files changed

+84
-70
lines changed

8 files changed

+84
-70
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { log } from '@stacksjs/logging'
2-
3-
// import { kebabCase } from '@stacksjs/strings'
2+
import { kebabCase } from '@stacksjs/strings'
43
import { libraryEntryPath } from '@stacksjs/path'
54
import { writeTextFile } from '@stacksjs/storage'
65
import { determineResetPreset } from '@stacksjs/utils'
@@ -25,7 +24,7 @@ export async function generateLibEntry(type: LibEntryType) {
2524
await createFunctionLibraryEntryPoint()
2625
}
2726
catch (err) {
28-
log.error('There was an error generating the library entry point.', err)
27+
log.error('There was an error generating the library entry point', err)
2928
process.exit()
3029
}
3130
}
@@ -38,7 +37,7 @@ export async function createVueLibraryEntryPoint() {
3837
data: generateEntryPointData('vue-components'),
3938
})
4039

41-
log.success('Created the Vue component library entry point.')
40+
log.success('Created the Vue component library entry point')
4241
}
4342

4443
export async function createWebComponentLibraryEntryPoint() {
@@ -49,7 +48,7 @@ export async function createWebComponentLibraryEntryPoint() {
4948
data: generateEntryPointData('web-components'),
5049
})
5150

52-
log.success('Created Web Component library entry point.')
51+
log.success('Created Web Component library entry point')
5352
}
5453

5554
export async function createFunctionLibraryEntryPoint() {
@@ -60,7 +59,7 @@ export async function createFunctionLibraryEntryPoint() {
6059
data: generateEntryPointData('functions'),
6160
})
6261

63-
log.success('Created Functions library entry point.')
62+
log.success('Created Functions library entry point')
6463
}
6564

6665
export function generateEntryPointData(type: 'vue-components' | 'web-components' | 'functions'): string {
@@ -74,9 +73,9 @@ export function generateEntryPointData(type: 'vue-components' | 'web-components'
7473

7574
for (const fx of library.functions?.functions) {
7675
if (Array.isArray(fx))
77-
arr.push(`export * as ${fx[1]} from '../../../functions/${fx[0]}'`)
76+
arr.push(`export * as ${fx[1]} from '../../../resources/functions/${fx[0]}'`)
7877
else
79-
arr.push(`export * from '../../../functions/${fx}'`)
78+
arr.push(`export * from '../../../resources/functions/${fx}'`)
8079
}
8180

8281
// join the array into a string with each element being on a new line
@@ -93,9 +92,9 @@ export function generateEntryPointData(type: 'vue-components' | 'web-components'
9392

9493
for (const component of library.vueComponents?.tags.map(tag => tag.name)) {
9594
if (Array.isArray(component))
96-
arr.push(`export { default as ${component[1]} } from '../../../components/${component[0]}.vue'`)
95+
arr.push(`export { default as ${component[1]} } from '../../../resources/components/${component[0]}.vue'`)
9796
else
98-
arr.push(`export { default as ${component} } from '../../../components/${component}.vue'`)
97+
arr.push(`export { default as ${component} } from '../../../resources/components/${component}.vue'`)
9998
}
10099

101100
// join the array into a string with each element being on a new line
@@ -115,12 +114,12 @@ export function generateEntryPointData(type: 'vue-components' | 'web-components'
115114

116115
for (const component of library.webComponents?.tags.map(tag => tag.name)) {
117116
if (Array.isArray(component)) {
118-
imports.push(`import ${component[1]} from '../../../components/${component[0]}.vue'`)
117+
imports.push(`import ${component[1]} from '../../../resources/components/${component[0]}.vue'`)
119118
declarations.push(`const ${component[1]}CustomElement = defineCustomElement(${component[1]})`)
120119
definitions.push(`customElements.define('${kebabCase(component[1])}', ${component[1]}CustomElement)`)
121120
}
122121
else {
123-
imports.push(`import ${component} from '../../../components/${component}.vue'`)
122+
imports.push(`import ${component} from '../../../resources/components/${component}.vue'`)
124123
declarations.push(`const ${component}CustomElement = defineCustomElement(${component})`)
125124
definitions.push(`customElements.define('${kebabCase(component)}', ${component}CustomElement)`)
126125
}

.stacks/core/actions/src/release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Action } from '@stacksjs/types'
55
import { log } from '@stacksjs/cli'
66
import { app } from '@stacksjs/config'
77

8-
const result = await runActions([
8+
await runActions([
99
Action.GenerateLibraryEntries, // generates the package/library entry points
1010
Action.LintFix, // ensure there are no lint errors
1111
// Action.Test, // run the tests
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import type { CLI } from '@stacksjs/types'
22

33
export async function onboarding(buddy: CLI) {
4-
// const descriptions = {
5-
// command: 'Generate Onboarding Pages',
6-
// verbose: 'Enable verbose output',
7-
// }
4+
const descriptions = {
5+
command: 'Generate Onboarding Pages',
6+
verbose: 'Enable verbose output',
7+
}
88

9-
// buddy
10-
// .command('page:onboarding', descriptions.command)
11-
// .option('--verbose', descriptions.verbose, { default: false })
12-
// .action(async () => {
13-
// const startTime = await intro('buddy page:onboarding')
14-
// const result = await runAction(Action.GenerateOnboarding)
15-
//
16-
// if (result.isErr()) {
17-
// process.exit()
18-
// }
19-
//
20-
// outro('Pages generated successfully', { startTime })
21-
// })
9+
buddy
10+
.command('page:onboarding', descriptions.command)
11+
.option('--verbose', descriptions.verbose, { default: false })
12+
.action(async () => {
13+
console.log('onboarding')
14+
// const startTime = await intro('buddy page:onboarding')
15+
// const result = await runAction(Action.GenerateOnboarding)
16+
//
17+
// if (result.isErr())
18+
// process.exit()
19+
//
20+
// outro('Pages generated successfully', { startTime })
21+
})
2222
}
Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
import type { CLI } from '@stacksjs/types'
22

33
async function setting(buddy: CLI) {
4-
// const descriptions = {
5-
// command: 'Generate Setting Pages',
6-
// verbose: 'Enable verbose output',
7-
// }
8-
//
9-
// buddy
10-
// .command('page:setting', descriptions.command)
11-
// .option('--verbose', descriptions.verbose, { default: false })
12-
// .action(async () => {
13-
// const startTime = await intro('buddy page:setting')
14-
// const result = await runAction(Action.GenerateSettings)
15-
//
16-
// if (result.isErr()) {
17-
// log.error('Something went wrong when generating', result.error as Error)
18-
// process.exit()
19-
// }
20-
//
21-
// outro('Pages generated successfully', { startTime })
22-
// })
4+
const descriptions = {
5+
command: 'Generate Setting Pages',
6+
verbose: 'Enable verbose output',
7+
}
8+
9+
buddy
10+
.command('page:setting', descriptions.command)
11+
.option('--verbose', descriptions.verbose, { default: false })
12+
.action(async () => {
13+
console.log('Generating setting pages...')
14+
// const startTime = await intro('buddy page:setting')
15+
// const result = await runAction(Action.GenerateSettings)
16+
//
17+
// if (result.isErr()) {
18+
// log.error('Something went wrong when generating', result.error as Error)
19+
// process.exit()
20+
// }
21+
//
22+
// outro('Pages generated successfully', { startTime })
23+
})
2324
}
2425

2526
export { setting }

.stacks/core/cli/src/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export async function runCommands(commands: string[], options?: CliOptions): Pro
7575
}
7676
else if (result.isErr()) {
7777
if (spinner) {
78-
log.error(new Error('Failed to run command'))
78+
log.error(new Error(`Failed to run command ${italic(command)}`, result.mapErr(e => e)))
7979
process.exit(ExitCode.FatalError)
8080
}
8181

.stacks/core/logging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"vue-ray": "^1.17.4"
5252
},
5353
"dependencies": {
54-
"node-ray": "1.20.11",
54+
"node-ray": "1.20.7",
5555
"vue-ray": "^1.17.4"
5656
},
5757
"devDependencies": {

pnpm-lock.yaml

Lines changed: 33 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/components/HelloWorld.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script setup lang="ts">
22
// which properties does your component accept?
33
const { greeting = 'Welcome!' } = defineProps<{
4-
greeting: string
54
showButtons: boolean
65
}>()
76

0 commit comments

Comments
 (0)