Skip to content

Commit

Permalink
feat: watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Nov 20, 2024
1 parent 80a4ffa commit e4893c1
Show file tree
Hide file tree
Showing 18 changed files with 251 additions and 78 deletions.
6 changes: 6 additions & 0 deletions .changeset/eleven-carrots-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kopflos-cms/core": patch
"@kopflos-cms/express": patch
---

Changed static method `Kopflos.fromGraphs` to `Kopflos#loadApiGraphs`
5 changes: 5 additions & 0 deletions .changeset/friendly-pandas-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kopflos-cms/core": patch
---

New plugin hooks: `onStop` and `apiTriples`
6 changes: 6 additions & 0 deletions .changeset/wise-tomatoes-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kopflos-cms/plugin-deploy-resources": patch
"kopflos": patch
---

Watch mode
2 changes: 2 additions & 0 deletions example/kopflos.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ export default <KopflosConfig> {
updateUrl: 'http://localhost:7878/update',
},
},
watch: ['lib'],
plugins: {
'@kopflos-cms/plugin-deploy-resources': {
paths: ['resources', 'resources.dev'],
watch: false,
},
'@kopflos-cms/express/middleware': {
before: [
Expand Down
120 changes: 89 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ program.command('serve')
.option('-h, --host <host>', 'Host to bind to (default: "0.0.0.0")')
.addOption(variable)
.option('--trust-proxy [proxy]', 'Trust the X-Forwarded-Host header')
.option('--watch', 'Enable watching for changes')
.option('--no-watch', 'Disable watching for changes')
.action(serve)

program.command('build')
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/command/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface BuildArgs {
}

export default async function (args: BuildArgs) {
const config = await loadConfig({
const { config } = await loadConfig({
path: args.config,
})
const plugins = await loadPlugins(config.plugins)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/command/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface DeployArgs {
}

export default async function (args: DeployArgs) {
const config = await loadConfig({
const { config } = await loadConfig({
path: args.config,
})

Expand Down
Loading

0 comments on commit e4893c1

Please sign in to comment.