Skip to content

Commit

Permalink
build: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Nov 6, 2024
1 parent 031a5a0 commit 67ba100
Show file tree
Hide file tree
Showing 24 changed files with 119 additions and 40 deletions.
13 changes: 13 additions & 0 deletions .changeset/dull-feet-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@kopflos-cms/plugin-deploy-resources": patch
"sparql-path-parser": patch
"@kopflos-cms/serve-file": patch
"@kopflos-labs/html-template": patch
"@kopflos-cms/express": patch
"@kopflos-labs/handlebars": patch
"@kopflos-cms/core": patch
"@kopflos-cms/vite": patch
"kopflos": patch
---

Added CHANGELOG.md to build
5 changes: 5 additions & 0 deletions .changeset/eleven-pandas-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kopflos": patch
---

Running `kopflos build` is now possible with incomplete configuration
5 changes: 5 additions & 0 deletions .changeset/healthy-wombats-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kopflos": patch
---

Removed debug logs
5 changes: 5 additions & 0 deletions .changeset/nice-walls-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kopflos-labs/lit": patch
---

Exclude TS from package
6 changes: 6 additions & 0 deletions .changeset/plenty-spiders-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kopflos-cms/express": patch
"@kopflos-cms/core": patch
---

Plugin dir wasn't packaged
5 changes: 5 additions & 0 deletions .changeset/silver-pumas-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kopflos-cms/logger": patch
---

Package proper built files
6 changes: 6 additions & 0 deletions .changeset/tasty-melons-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kopflos-cms/plugin-deploy-resources": patch
"@kopflos-cms/vite": patch
---

Added type augmentation of plugin config interface
1 change: 1 addition & 0 deletions labs/handlebars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"mocha-chai-rdf": "^0.1.4"
},
"files": [
"CHANGELOG.md",
"*.js",
"*.d.ts",
"lib/*.js",
Expand Down
1 change: 1 addition & 0 deletions labs/html-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"sinon": "^19.0.2"
},
"files": [
"CHANGELOG.md",
"*.js",
"*.d.ts",
"lib/*.js",
Expand Down
5 changes: 5 additions & 0 deletions labs/lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"version": "0.1.0-beta.0",
"main": "index.js",
"type": "module",
"files": [
"CHANGELOG.md",
"*.js",
"*.d.ts"
],
"dependencies": {
"@lit-labs/ssr": "^3.2.2",
"@lit-labs/ssr-client": "^1.1.7",
Expand Down
59 changes: 30 additions & 29 deletions package-lock.json

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

2 changes: 0 additions & 2 deletions packages/cli/bin/kopflos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ kopflos=$(node -e "console.log(require.resolve('kopflos/bin/index.js'))" 2> /dev
# if ts-node exists in path
if command -v ts-node &> /dev/null
then
echo "use ts-node"
node --loader ts-node/esm/transpile-only --no-warnings "$kopflos" "$@"
else
echo "use plain node"
node "$kopflos" "$@"
fi
8 changes: 3 additions & 5 deletions packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'ulog'
import express from 'express'
import { program } from 'commander'
import kopflos from '@kopflos-cms/express'
import Kopflos, { log } from '@kopflos-cms/core'
import log from '@kopflos-cms/logger'
import { loadPlugins } from '@kopflos-cms/core/plugins.js' // eslint-disable-line import/no-unresolved
import { loadConfig } from './lib/config.js'
import { variable } from './lib/options.js'
Expand Down Expand Up @@ -76,12 +76,10 @@ program.command('build')
const config = await loadConfig({
path: configPath,
})
const instance = new Kopflos(config, {
plugins: await loadPlugins(config.plugins),
})
const plugins = await loadPlugins(config.plugins)

log.info('Running build actions...')
const buildActions = instance.plugins.map(plugin => plugin.build?.(instance))
const buildActions = plugins.map(plugin => plugin.build?.())
if (buildActions.length === 0) {
return log.warn('No plugins with build actions found')
} else {
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"kopflos": "./bin/kopflos.sh"
},
"files": [
"CHANGELOG.md",
"bin",
"lib/*.js",
"lib/*.d.ts",
Expand All @@ -29,7 +30,7 @@
},
"homepage": "https://github.com/zazuko/kopflos",
"dependencies": {
"@kopflos-cms/core": "^0.3.0-beta.9",
"@kopflos-cms/logger": "^0.1.0-beta.0",
"@kopflos-cms/express": "^0.1.0-beta.5",
"@kopflos-cms/plugin-deploy-resources": "^0.1.0-beta.0",
"commander": "^12.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/Kopflos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface Kopflos<D extends DatasetCore = Dataset> {
}

export interface KopflosPlugin {
build?: (instance: Kopflos) => Promise<void> | void
build?: () => Promise<void> | void
onStart?(instance: Kopflos): Promise<void> | void
}

Expand Down
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
"./plugin/shorthandTerms.js": "./plugin/shorthandTerms.js"
},
"files": [
"CHANGELOG.md",
"*.js",
"*.d.ts",
"lib/**/*.js",
"lib/**/*.d.ts",
"plugin/**/*.js",
"plugin/**/*.d.ts",
"graphs",
"query"
],
Expand Down
5 changes: 3 additions & 2 deletions packages/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
"./middleware": "./plugin/middleware.js"
},
"files": [
"CHANGELOG.md",
"*.js",
"*.d.ts",
"lib/**/*.js",
"lib/**/*.d.ts"
"plugin/**/*.js",
"plugin/**/*.d.ts"
],
"dependencies": {
"@kopflos-cms/core": "^0.3.0-beta.9",
Expand Down
9 changes: 9 additions & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
"version": "0.1.0-beta.0",
"type": "module",
"main": "index.js",
"scripts": {
"build": "tsc",
"prepack": "npm run build"
},
"files": [
"CHANGELOG.md",
"*.js",
"*.d.ts"
],
"dependencies": {
"anylogger": "^1.0.11"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-deploy-resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ interface Options {
paths?: string[]
}

declare module '@kopflos-cms/core' {
interface PluginConfig {
'@kopflos-cms/plugin-deploy-resources'?: Options
}
}

const log = createLogger('deploy-resources')

export default function kopflosPlugin({ paths = [], enabled = true }: Options = {}): Required<Pick<KopflosPlugin, 'onStart'>> {
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-deploy-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"prepack": "npm run build"
},
"files": [
"CHANGELOG.md",
"*.js",
"*.d.ts"
],
Expand Down
1 change: 1 addition & 0 deletions packages/serve-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"prepack": "npm run build"
},
"files": [
"CHANGELOG.md",
"lib/*.js",
"lib/*.d.ts",
"*.js",
Expand Down
1 change: 1 addition & 0 deletions packages/sparql-path-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build:dts": "tsc"
},
"files": [
"CHANGELOG.md",
"index.js",
"index.d.ts"
],
Expand Down
Loading

0 comments on commit 67ba100

Please sign in to comment.