Skip to content

Commit e233038

Browse files
committed
chore: wip
1 parent ce7c222 commit e233038

File tree

17 files changed

+1167
-1786
lines changed

17 files changed

+1167
-1786
lines changed

.idea/stacks.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.stacks/core/actions/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@
7777
"types": "./dist/generate/lib-entries.d.ts",
7878
"import": "./dist/generate/lib-entries.mjs"
7979
},
80-
"./generate/package-jsons": {
81-
"types": "./dist/generate/package-jsons.d.ts",
82-
"import": "./dist/generate/package-jsons.mjs"
83-
},
8480
"./generate/settings": {
8581
"types": "./dist/generate/settings.d.ts",
8682
"import": "./dist/generate/settings.mjs"

.stacks/core/actions/src/clean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { log } from '@stacksjs/cli'
22
import { projectPath } from '@stacksjs/path'
33
import { del } from '@stacksjs/utils'
44

5-
log.info('Running clean command...', projectPath())
5+
log.info('Running clean command...')
66

77
await del([
88
projectPath('pnpm-lock.yaml'),

.stacks/core/actions/src/generate/package-jsons.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export default <Model> {
310310
name: {
311311
type: 'String',
312312
validation: validate.string().min(3).max(255),
313-
factory: () => faker.name,
313+
factory: () => faker.person,
314314
},
315315
// more fields here
316316
},

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
import { frameworkPath } from '@stacksjs/path'
33
import { runActions } from '@stacksjs/actions'
44
import { Action } from '@stacksjs/types'
5+
import { log } from '@stacksjs/cli'
6+
import { app } from '@stacksjs/config'
57

68
await runActions([
7-
Action.GeneratePackageJsons, // generate the package.json's for each package
9+
Action.GeneratePackageJsons, // generates the package/library entry points
810
Action.LintFix, // ensure there are no lint errors
911
// Action.Test, // run the tests
1012
Action.Bump, // bump the versions, create the git tag, generate the changelog, commit & push the changes
1113
], { verbose: true, cwd: frameworkPath(), shell: true }) // debug mode needs to be enabled to see the output due to the interactive prompts
1214

13-
// log.success('Successfully released the Stacks framework')
15+
log.success(`Successfully released ${app.name}`)

.stacks/core/buddy/src/cli.ts

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
#!/usr/bin/env node
22
import { runAction } from '@stacksjs/actions'
3-
import { command, execSync, log, runCommand } from '@stacksjs/cli'
4-
import { env, frameworkVersion, isProjectCreated, parseYaml, semver } from '@stacksjs/utils'
3+
import { command, log } from '@stacksjs/cli'
4+
import { env, frameworkVersion, installIfVersionMismatch, isProjectCreated } from '@stacksjs/utils'
55
import { projectPath } from '@stacksjs/path'
66
import { Action } from '@stacksjs/types'
7-
import { filesystem } from '@stacksjs/storage'
87
import { build, changelog, clean, commit, create, dev, example, fresh, generate, key, lint, make, migrate, preinstall, prepublish, release, seed, setup, test, upgrade, version } from './commands'
98

109
const cli = command('buddy')
11-
const { fs } = filesystem
1210

1311
// setup global error handlers
1412
process.on('uncaughtException', errorHandler)
1513
process.on('unhandledRejection', errorHandler)
1614

1715
async function main() {
1816
// the following commands are not dependent on the project being initialized
19-
installIfVersionMismatch()
17+
await installIfVersionMismatch()
2018
await setup(cli)
2119
await key(cli)
2220

@@ -69,27 +67,6 @@ async function main() {
6967

7068
main()
7169

72-
async function installIfVersionMismatch() {
73-
const dependenciesYaml = fs.readFileSync(projectPath('tea.yaml'), 'utf8')
74-
const dependencies = parseYaml(dependenciesYaml).dependencies
75-
76-
const requiredNodeVersion = dependencies['nodejs.org']
77-
const requiredPnpmVersion = dependencies['pnpm.io']
78-
79-
const installedNodeVersion = process.version
80-
const installedPnpmVersion = execSync('pnpm -v').trim()
81-
82-
if (!semver.satisfies(installedNodeVersion, requiredNodeVersion)) {
83-
log.error(`Installed Node.js version (${installedNodeVersion}) does not satisfy required version (${requiredNodeVersion}). Installing...`)
84-
await runCommand(`tea +nodejs.org${requiredNodeVersion} >/dev/null 2>&1`)
85-
}
86-
87-
if (!semver.satisfies(installedPnpmVersion, requiredPnpmVersion)) {
88-
log.error(`Installed pnpm version (${installedPnpmVersion}) does not satisfy required version (${requiredPnpmVersion}). Installing...`)
89-
await runCommand(`tea +pnpm.io${requiredPnpmVersion} >/dev/null 2>&1`)
90-
}
91-
}
92-
9370
function errorHandler(error: Error): void {
9471
log.error(error)
9572
process.exit(1)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function fresh(buddy: CLI) {
2121
process.exit(ExitCode.FatalError)
2222
}
2323

24-
outro('Freshly reinstalled your dependencies.', { startTime: perf, useSeconds: true })
24+
outro('Freshly reinstalled your dependencies', { startTime: perf, useSeconds: true })
2525
process.exit(ExitCode.Success)
2626
})
2727
}
Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
import type { CLI } from '@stacksjs/types'
2-
import { intro, outro } from '@stacksjs/cli'
3-
import { Action } from '@stacksjs/types'
4-
import { runAction } from '@stacksjs/actions'
52

63
async function onboarding(buddy: CLI) {
7-
const descriptions = {
8-
command: 'Generate Onboarding Pages',
9-
verbose: 'Enable verbose output',
10-
}
4+
// const descriptions = {
5+
// command: 'Generate Onboarding Pages',
6+
// verbose: 'Enable verbose output',
7+
// }
118

12-
buddy
13-
.command('page:onboarding', descriptions.command)
14-
.option('--verbose', descriptions.verbose, { default: false })
15-
.action(async () => {
16-
const startTime = await intro('buddy page:onboarding')
17-
const result = await runAction(Action.GenerateOnboarding)
18-
19-
if (result.isErr()) {
20-
log.error('Something went wrong when generating', result.error as Error)
21-
process.exit()
22-
}
23-
24-
outro('Pages generated successfully', { startTime })
25-
})
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+
// })
2622
}
2723

2824
export { onboarding }
Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
import type { CLI } from '@stacksjs/types'
2-
import { intro, outro } from '@stacksjs/cli'
3-
import { Action } from '@stacksjs/types'
4-
import { runAction } from '@stacksjs/actions'
52

63
async function setting(buddy: CLI) {
7-
const descriptions = {
8-
command: 'Generate Setting Pages',
9-
verbose: 'Enable verbose output',
10-
}
11-
12-
buddy
13-
.command('page:setting', descriptions.command)
14-
.option('--verbose', descriptions.verbose, { default: false })
15-
.action(async () => {
16-
const startTime = await intro('buddy page:setting')
17-
const result = await runAction(Action.GenerateSettings)
18-
19-
if (result.isErr()) {
20-
log.error('Something went wrong when generating', result.error as Error)
21-
process.exit()
22-
}
23-
24-
outro('Pages generated successfully', { startTime })
25-
})
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+
// })
2623
}
2724

2825
export { setting }

0 commit comments

Comments
 (0)