diff --git a/.changeset/dull-feet-help.md b/.changeset/dull-feet-help.md new file mode 100644 index 0000000..904ec30 --- /dev/null +++ b/.changeset/dull-feet-help.md @@ -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 diff --git a/.changeset/eleven-pandas-relate.md b/.changeset/eleven-pandas-relate.md new file mode 100644 index 0000000..691511a --- /dev/null +++ b/.changeset/eleven-pandas-relate.md @@ -0,0 +1,5 @@ +--- +"kopflos": patch +--- + +Running `kopflos build` is now possible with incomplete configuration diff --git a/.changeset/healthy-wombats-sort.md b/.changeset/healthy-wombats-sort.md new file mode 100644 index 0000000..e6c30ab --- /dev/null +++ b/.changeset/healthy-wombats-sort.md @@ -0,0 +1,5 @@ +--- +"kopflos": patch +--- + +Removed debug logs diff --git a/.changeset/nice-walls-compare.md b/.changeset/nice-walls-compare.md new file mode 100644 index 0000000..40afb8d --- /dev/null +++ b/.changeset/nice-walls-compare.md @@ -0,0 +1,5 @@ +--- +"@kopflos-labs/lit": patch +--- + +Exclude TS from package diff --git a/.changeset/plenty-spiders-vanish.md b/.changeset/plenty-spiders-vanish.md new file mode 100644 index 0000000..c91f636 --- /dev/null +++ b/.changeset/plenty-spiders-vanish.md @@ -0,0 +1,6 @@ +--- +"@kopflos-cms/express": patch +"@kopflos-cms/core": patch +--- + +Plugin dir wasn't packaged diff --git a/.changeset/silver-pumas-yell.md b/.changeset/silver-pumas-yell.md new file mode 100644 index 0000000..0c7adb2 --- /dev/null +++ b/.changeset/silver-pumas-yell.md @@ -0,0 +1,5 @@ +--- +"@kopflos-cms/logger": patch +--- + +Package proper built files diff --git a/.changeset/tasty-melons-work.md b/.changeset/tasty-melons-work.md new file mode 100644 index 0000000..1d175d9 --- /dev/null +++ b/.changeset/tasty-melons-work.md @@ -0,0 +1,6 @@ +--- +"@kopflos-cms/plugin-deploy-resources": patch +"@kopflos-cms/vite": patch +--- + +Added type augmentation of plugin config interface diff --git a/labs/handlebars/package.json b/labs/handlebars/package.json index 1780d5a..ddb1f29 100644 --- a/labs/handlebars/package.json +++ b/labs/handlebars/package.json @@ -23,6 +23,7 @@ "mocha-chai-rdf": "^0.1.4" }, "files": [ + "CHANGELOG.md", "*.js", "*.d.ts", "lib/*.js", diff --git a/labs/html-template/package.json b/labs/html-template/package.json index 4eeaf07..41e76f2 100644 --- a/labs/html-template/package.json +++ b/labs/html-template/package.json @@ -29,6 +29,7 @@ "sinon": "^19.0.2" }, "files": [ + "CHANGELOG.md", "*.js", "*.d.ts", "lib/*.js", diff --git a/labs/lit/package.json b/labs/lit/package.json index 06173ac..ee59a68 100644 --- a/labs/lit/package.json +++ b/labs/lit/package.json @@ -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", diff --git a/package-lock.json b/package-lock.json index bdac91f..ca9439a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,12 +35,13 @@ } }, "example": { + "version": "0.0.1-beta.0", "dependencies": { - "@kopflos-cms/serve-file": "*", - "@kopflos-cms/vite": "*", - "@kopflos-labs/handlebars": "*", - "@kopflos-labs/html-template": "*", - "@kopflos-labs/lit": "*", + "@kopflos-cms/serve-file": "0.1.0-beta.0", + "@kopflos-cms/vite": "0.0.1-beta.0", + "@kopflos-labs/handlebars": "0.1.0-beta.0", + "@kopflos-labs/html-template": "0.1.0-beta.0", + "@kopflos-labs/lit": "0.1.0-beta.0", "@openlayers-elements/core": "^0.3.0", "@openlayers-elements/maps": "^0.3.0", "@shoelace-style/shoelace": "^2.17.1", @@ -48,7 +49,7 @@ "compression": "^1.7.4", "cors": "^2.8.5", "express": "^5.0.1", - "kopflos": "*", + "kopflos": "0.1.0-beta.0", "lit-element": "^4.1.1" }, "devDependencies": { @@ -57,14 +58,14 @@ }, "labs/handlebars": { "name": "@kopflos-labs/handlebars", - "version": "0.0.0", + "version": "0.1.0-beta.0", "license": "MIT", "dependencies": { "@zazuko/env": "^2.3.0", "@zazuko/prefixes": "^2.2.0", "clownface-shacl-path": "^2.4.0", "handlebars": "^4.7.8", - "sparql-path-parser": "^0.0.0" + "sparql-path-parser": "^0.1.0-beta.0" }, "devDependencies": { "chai": "^5.1.1", @@ -73,17 +74,17 @@ }, "labs/html-template": { "name": "@kopflos-labs/html-template", - "version": "0.0.0", + "version": "0.1.0-beta.0", "license": "MIT", "dependencies": { - "@kopflos-cms/logger": "^0.0.0", + "@kopflos-cms/logger": "^0.1.0-beta.0", "@zazuko/env": "^2.3.0", "@zazuko/prefixes": "^2.2.0", "cheerio": "^1.0.0", "htmlparser2": "^9.1.0" }, "devDependencies": { - "@kopflos-cms/core": "^0.3.0-beta.8", + "@kopflos-cms/core": "^0.3.0-beta.9", "@types/chai-html": "^3.0.0", "@types/sinon": "^17.0.3", "@zazuko/env-node": "^2.1.4", @@ -128,7 +129,7 @@ }, "labs/lit": { "name": "@kopflos-labs/lit", - "version": "0.0.0", + "version": "0.1.0-beta.0", "dependencies": { "@lit-labs/ssr": "^3.2.2", "@lit-labs/ssr-client": "^1.1.7", @@ -18405,12 +18406,12 @@ }, "packages/cli": { "name": "kopflos", - "version": "0.0.0", + "version": "0.1.0-beta.0", "license": "MIT", "dependencies": { - "@kopflos-cms/core": "^0.3.0-beta.8", - "@kopflos-cms/express": "^0.0.1-beta.4", - "@kopflos-cms/plugin-deploy-resources": "^0.0.0", + "@kopflos-cms/express": "^0.1.0-beta.5", + "@kopflos-cms/logger": "^0.1.0-beta.0", + "@kopflos-cms/plugin-deploy-resources": "^0.1.0-beta.0", "commander": "^12.0.0", "cosmiconfig": "^9.0.0", "express": "^5.0.1", @@ -18425,10 +18426,10 @@ }, "packages/core": { "name": "@kopflos-cms/core", - "version": "0.3.0-beta.8", + "version": "0.3.0-beta.9", "license": "MIT", "dependencies": { - "@kopflos-cms/logger": "^0.0.0", + "@kopflos-cms/logger": "^0.1.0-beta.0", "@rdfjs/types": "^1.1.0", "@tpluscode/sparql-builder": "^3.0.0", "@types/clownface": "^2.0.8", @@ -18475,11 +18476,11 @@ }, "packages/express": { "name": "@kopflos-cms/express", - "version": "0.0.1-beta.4", + "version": "0.1.0-beta.5", "license": "MIT", "dependencies": { - "@kopflos-cms/core": "^0.3.0-beta.8", - "@kopflos-cms/logger": "^0.0.0", + "@kopflos-cms/core": "^0.3.0-beta.9", + "@kopflos-cms/logger": "^0.1.0-beta.0", "@rdfjs/express-handler": "^2.0.2", "@zazuko/env-node": "^2.1.3", "absolute-url": "^2.0.0", @@ -18521,23 +18522,23 @@ }, "packages/logger": { "name": "@kopflos-cms/logger", - "version": "0.0.0", + "version": "0.1.0-beta.0", "dependencies": { "anylogger": "^1.0.11" } }, "packages/plugin-deploy-resources": { "name": "@kopflos-cms/plugin-deploy-resources", - "version": "0.0.0", + "version": "0.1.0-beta.0", "license": "MIT", "dependencies": { "@hydrofoil/resource-store": "^0.2.2", "@hydrofoil/talos-core": "^0.2", - "@kopflos-cms/logger": "^0.0.0", + "@kopflos-cms/logger": "^0.1.0-beta.0", "anylogger": "^1.0.11" }, "devDependencies": { - "@kopflos-cms/core": "^0.3.0-beta.8", + "@kopflos-cms/core": "^0.3.0-beta.9", "@zazuko/env-node": "^2.1.3", "chai": "^5.1.1", "mocha-chai-rdf": "^0.1.4" @@ -18545,7 +18546,7 @@ }, "packages/serve-file": { "name": "@kopflos-cms/serve-file", - "version": "0.0.0", + "version": "0.1.0-beta.0", "dependencies": { "mime": "^4.0.4" }, @@ -18568,7 +18569,7 @@ } }, "packages/sparql-path-parser": { - "version": "0.0.0", + "version": "0.1.0-beta.0", "dependencies": { "@tpluscode/rdf-ns-builders": "^4", "@types/sparqljs": "^3.1.11", @@ -18596,10 +18597,10 @@ }, "packages/vite": { "name": "@kopflos-cms/vite", - "version": "0.0.0", + "version": "0.0.1-beta.0", "license": "MIT", "dependencies": { - "@kopflos-cms/logger": "^0.0.0", + "@kopflos-cms/logger": "^0.1.0-beta.0", "express": "^5.0.1", "glob": "^11.0.0", "onetime": "^7.0.0", diff --git a/packages/cli/bin/kopflos.sh b/packages/cli/bin/kopflos.sh index ba02734..4b3db90 100755 --- a/packages/cli/bin/kopflos.sh +++ b/packages/cli/bin/kopflos.sh @@ -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 diff --git a/packages/cli/index.ts b/packages/cli/index.ts index 8412162..2f0611e 100755 --- a/packages/cli/index.ts +++ b/packages/cli/index.ts @@ -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' @@ -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 { diff --git a/packages/cli/package.json b/packages/cli/package.json index 47792f8..1e92a79 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -6,6 +6,7 @@ "kopflos": "./bin/kopflos.sh" }, "files": [ + "CHANGELOG.md", "bin", "lib/*.js", "lib/*.d.ts", @@ -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", diff --git a/packages/core/lib/Kopflos.ts b/packages/core/lib/Kopflos.ts index 230c56c..d07706c 100644 --- a/packages/core/lib/Kopflos.ts +++ b/packages/core/lib/Kopflos.ts @@ -63,7 +63,7 @@ export interface Kopflos { } export interface KopflosPlugin { - build?: (instance: Kopflos) => Promise | void + build?: () => Promise | void onStart?(instance: Kopflos): Promise | void } diff --git a/packages/core/package.json b/packages/core/package.json index 7ff4568..02572c4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -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" ], diff --git a/packages/express/package.json b/packages/express/package.json index b1d3be3..c6375e3 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -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", diff --git a/packages/logger/package.json b/packages/logger/package.json index 2f40bf3..37f2063 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -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" } diff --git a/packages/plugin-deploy-resources/index.ts b/packages/plugin-deploy-resources/index.ts index 16622db..f7083f7 100644 --- a/packages/plugin-deploy-resources/index.ts +++ b/packages/plugin-deploy-resources/index.ts @@ -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> { diff --git a/packages/plugin-deploy-resources/package.json b/packages/plugin-deploy-resources/package.json index 993f82b..5091c2e 100644 --- a/packages/plugin-deploy-resources/package.json +++ b/packages/plugin-deploy-resources/package.json @@ -10,6 +10,7 @@ "prepack": "npm run build" }, "files": [ + "CHANGELOG.md", "*.js", "*.d.ts" ], diff --git a/packages/serve-file/package.json b/packages/serve-file/package.json index 9fb9a95..20b0f04 100644 --- a/packages/serve-file/package.json +++ b/packages/serve-file/package.json @@ -9,6 +9,7 @@ "prepack": "npm run build" }, "files": [ + "CHANGELOG.md", "lib/*.js", "lib/*.d.ts", "*.js", diff --git a/packages/sparql-path-parser/package.json b/packages/sparql-path-parser/package.json index ed50108..82f6e58 100644 --- a/packages/sparql-path-parser/package.json +++ b/packages/sparql-path-parser/package.json @@ -12,6 +12,7 @@ "build:dts": "tsc" }, "files": [ + "CHANGELOG.md", "index.js", "index.d.ts" ], diff --git a/packages/vite/index.ts b/packages/vite/index.ts index e3aaf9e..d8d0eff 100644 --- a/packages/vite/index.ts +++ b/packages/vite/index.ts @@ -15,6 +15,12 @@ export interface Options { entrypoints?: string[] } +declare module '@kopflos-cms/core' { + interface PluginConfig { + '@kopflos-cms/vite'?: Options + } +} + export default function ({ outDir = 'dist', ...options }: Options): KopflosPlugin { return { async beforeMiddleware(host: express.Router, { env }) { diff --git a/packages/vite/package.json b/packages/vite/package.json index 6f262d0..2d386bd 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -11,6 +11,7 @@ "prepack": "npm run build" }, "files": [ + "CHANGELOG.md", "lib/*.js", "lib/*.d.ts", "*.js",