Skip to content

Commit 25a67d5

Browse files
committed
chore: wip
1 parent a75fe3a commit 25a67d5

Some content is hidden

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

61 files changed

+393
-1064
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ buddy upgrade # auto-update deps & the Stacks framework
7070

7171
buddy make:component HelloWorld # scaffolds a component
7272
buddy make:function HelloWorld # scaffolds a function
73-
buddy make:page hello-world # scaffolds a page (https://127.0.0.1/hello-world)
73+
buddy make:page hello-world # scaffolds a page (https://my-project.test/hello-world)
7474

7575
buddy help
7676
```

.stacks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ buddy upgrade # auto-update deps & the Stacks framework
133133

134134
buddy make:component HelloWorld # scaffolds a component
135135
buddy make:function HelloWorld # scaffolds a function
136-
buddy make:page hello-world # scaffolds a page (https://127.0.0.1/hello-world)
136+
buddy make:page hello-world # scaffolds a page (https://my-project.test/hello-world)
137137

138138
buddy --help
139139
```

.stacks/api/nitro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineNitroConfig } from 'nitropack'
2+
23
// import { alias } from '@stacksjs/alias'
34
// import { resolve } from '@stacksjs/path'
45
// import { deploy } from '@stacksjs/config/user'

.stacks/components/vue/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createApp } from 'vue'
2+
23
// import Previewer from 'virtual:vue-component-preview'
34
import Demo from '../../../components/Demo.vue'
45

.stacks/core/actions/src/generate/ide-helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { log } from '@stacksjs/logging'
99
import { hasComponents } from '@stacksjs/storage'
1010
import { generateVsCodeCustomData } from '../helpers/vscode-custom-data'
11+
1112
// import { generateVsCodeCustomData, generateWebTypes } from './generate/vscode-custom-data'
1213

1314
if (hasComponents()) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { log } from '@stacksjs/logging'
2+
23
// import { kebabCase } from '@stacksjs/strings'
34
import { libraryEntryPath } from '@stacksjs/path'
45
import { writeTextFile } from '@stacksjs/storage'

.stacks/core/actions/src/helpers/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import storage from '@stacksjs/storage'
2-
import { log, runCommand, runCommands } from '@stacksjs/cli'
2+
import { italic, log, runCommand, runCommands } from '@stacksjs/cli'
33
import { actionsPath, functionsPath } from '@stacksjs/path'
4-
import type { CliOptions as ActionOptions, CommandResult } from '@stacksjs/types'
4+
import type { ActionOptions, CommandResult } from '@stacksjs/types'
55
import type { Err, Result } from '@stacksjs/error-handling'
66
import { err } from '@stacksjs/error-handling'
77

@@ -48,8 +48,8 @@ export async function runAction(action: string, options?: ActionOptions): Promis
4848

4949
const cmd = `npx esno ${actionsPath(`${action}.ts ${opts}`)}`
5050

51-
if (options?.debug)
52-
log.info('Running command:', cmd)
51+
if (options?.verbose)
52+
log.debug('running command:', italic(cmd))
5353

5454
return options?.showSpinner
5555
? await runCommands([cmd], options)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { frameworkPath } from '@stacksjs/path'
33
import { runActions } from '@stacksjs/actions'
44
import { Action } from '@stacksjs/types'
5+
56
// import { log } from '@stacksjxs/cli'
67

78
await runActions([

.stacks/core/actions/src/upgrade.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { intro, log, outro, prompts, runCommand, spawn } from '@stacksjs/cli'
1+
import { intro, log, outro, prompt, runCommand, spawn } from '@stacksjs/cli'
22
import storage from '@stacksjs/storage'
3-
import { determineDebugMode, loop } from '@stacksjs/utils'
4-
import { frameworkPath, projectPath } from '@stacksjs/path'
3+
import { determineDebugMode } from '@stacksjs/utils'
4+
import { projectPath } from '@stacksjs/path'
55
import type { UpgradeOptions } from '@stacksjs/types'
66
import { ExitCode, NpmScript } from '@stacksjs/types'
77

@@ -20,14 +20,11 @@ export async function checkForUncommittedChanges(path = './.stacks', options: Up
2020
// the user knows what they are doing. There is also a change that simply the deps within .stacks
2121
// folder have been updated and that could produce a diff.
2222
if (!options?.force) {
23-
const answer = await prompts.confirm({
24-
type: 'select',
25-
name: 'framework-update',
26-
message: 'We detected there are uncommitted in the ./stacks folder. Do you want to overwrite those?',
23+
const confirmed = await prompt('We detected there are uncommitted in the ./stacks folder. Do you want to overwrite those?', {
24+
type: 'confirm',
2725
})
2826

29-
// @ts-expect-error the answer object type expects to return a void type but it returns boolean
30-
if (!answer) {
27+
if (!confirmed) {
3128
log.info('Aborted. Stacks did not update itself.')
3229
log.info('Note: if you commit your changes and replay the update, you can see what changed.')
3330
process.exit(ExitCode.Success)

.stacks/core/actions/src/upgrade/framework.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ import { frameworkPath, projectPath } from '@stacksjs/path'
55

66
// await runCommand(NpmScript.UpgradeFramework, parseArgs())
77

8-
await checkForUncommittedChanges('./.stacks', options)
9-
await downloadFrameworkUpdate(options)
8+
await checkForUncommittedChanges('./.stacks', options)
9+
await downloadFrameworkUpdate(options)
1010

11-
log.info('Updating framework...')
11+
log.info('Updating framework...')
1212

13-
const exclude = ['functions/package.json', 'components/vue/package.json', 'components/web/package.json', 'auto-imports.d.ts', 'components.d.ts', 'dist']
14-
await storage.deleteFiles(frameworkPath(), exclude)
13+
const exclude = ['functions/package.json', 'components/vue/package.json', 'components/web/package.json', 'auto-imports.d.ts', 'components.d.ts', 'dist']
14+
await storage.deleteFiles(frameworkPath(), exclude)
1515

16-
// loop 5 times to make sure all "deep empty" folders are deleted
17-
loop(5, async () => {
18-
await storage.deleteEmptyFolders(frameworkPath())
19-
})
16+
// loop 5 times to make sure all "deep empty" folders are deleted
17+
loop(5, async () => {
18+
await storage.deleteEmptyFolders(frameworkPath())
19+
})
2020

21-
await storage.copyFolder(frameworkPath(), projectPath('./updates/.stacks'), exclude)
21+
await storage.copyFolder(frameworkPath(), projectPath('./updates/.stacks'), exclude)
2222

23-
if (determineDebugMode(options))
24-
log.info('Cleanup...')
23+
if (determineDebugMode(options))
24+
log.info('Cleanup...')
2525

26-
await storage.deleteFolder(projectPath('updates'))
26+
await storage.deleteFolder(projectPath('updates'))
2727

28-
outro('Framework updated', { startTime: perf, useSeconds: true })
29-
process.exit()
28+
outro('Framework updated', { startTime: perf, useSeconds: true })
29+
process.exit()

0 commit comments

Comments
 (0)