diff --git a/CHANGELOG.md b/CHANGELOG.md index 55b9743..5c1a154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ aiur version history ==================== +v0.12.0 +------- + +_TBD_ + +maintenance release to update dependencies + +* bumped Node requirement to v20 or later, dropping support for obsolete versions + v0.11.0 ------- diff --git a/bin/aiur b/bin/aiur index 7a0dda5..711d9ad 100755 --- a/bin/aiur +++ b/bin/aiur @@ -1,9 +1,9 @@ #!/usr/bin/env node "use strict"; -let faucet = require("faucet-pipeline-core"); +let { faucetDispatch } = require("faucet-pipeline-core"); let parseCLI = require("../lib/cli"); let { referenceDir, config, options } = parseCLI(); -faucet(referenceDir, config, options); +faucetDispatch(referenceDir, config, options); diff --git a/example/package.json b/example/package.json index c081e96..2da2bea 100644 --- a/example/package.json +++ b/example/package.json @@ -1,10 +1,9 @@ { "scripts": { - "start": "aiur --watch --liveserve", + "start": "aiur --watch --serve 0.0.0.0:8080", "compile": "aiur --fingerprint --compact" }, "dependencies": { - "aiur": "..", - "prismjs": "^1.17.0" + "aiur": ".." } } diff --git a/lib/cli.js b/lib/cli.js index 42d50f3..7403df3 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -56,6 +56,7 @@ module.exports = function parseCLI(argv = process.argv.slice(2), help = HELP) { "mode to avoid littering your file system with obsolete bundles"); } + // TODO: remove the baseuri option, use the setting from the manifest config instead let { source, target, baseuri } = argv; let rawConfig = require(path.resolve(process.cwd(), source)); let watchDirs = rawConfig.watchDirs || []; @@ -63,18 +64,7 @@ module.exports = function parseCLI(argv = process.argv.slice(2), help = HELP) { let config = { aiur: [{ source, - target, - baseURI: baseuri - }], - - sass: [{ - source: "aiur/lib/style.scss", - target: `${target}/style-aiur.css` - }], - - js: [{ - source: "aiur/lib/client/index.js", - target: `${target}/script-aiur.js` + target }], watchDirs: [source, ...watchDirs], @@ -85,13 +75,7 @@ module.exports = function parseCLI(argv = process.argv.slice(2), help = HELP) { webRoot: target }, - plugins: [ - { - bucket: "markup", - key: "aiur", - plugin: aiur - } - ] + plugins: [aiur] }; Object.entries(rawConfig.snippetAssets || {}).forEach(([pipeline, entries]) => { diff --git a/lib/client/component_preview.js b/lib/client/component_preview.js deleted file mode 100644 index 88dfe6a..0000000 --- a/lib/client/component_preview.js +++ /dev/null @@ -1,28 +0,0 @@ -/* global HTMLElement */ -export default class ComponentPreview extends HTMLElement { - connectedCallback() { - this._previewFrame = this.querySelector("." + this.getAttribute("preview")) || - this.querySelector("#" + this.getAttribute("preview")); - this.setDimensions(); - this._previewFrame.addEventListener("load", event => this.fitPreviewFrame()); - } - - setDimensions() { - let height = this.getAttribute("height"); - let width = this.getAttribute("width"); - if(height) this._previewFrame.style.height = parseInt(height) + "px"; - if(width) this._previewFrame.style.width = parseInt(width) + "px"; - } - - fitPreviewFrame() { - if(!this.hasAttribute("height")) { - let frameBody = this._previewFrame.contentWindow.document.body; - let bodyDisplay = frameBody.style.display; - frameBody.style.display = "inline-block"; - let height = frameBody.offsetHeight; - frameBody.style.display = bodyDisplay; - // TODO: fix me: 16, a magic number for now to prevent scrollbars - this._previewFrame.style.height = height + 16 + "px"; - } - } -} diff --git a/lib/client/external_text.js b/lib/client/external_text.js deleted file mode 100644 index 6f9d96d..0000000 --- a/lib/client/external_text.js +++ /dev/null @@ -1,38 +0,0 @@ -/* global HTMLElement, fetch */ -// TODO use "find" attribute with css selector to extract parts of external page -// TODO overall proper embedding process ... - -export default class ExternalText extends HTMLElement { - connectedCallback() { - this._wrapElementType = this.getAttribute("wrap"); - this._src = this.getAttribute("src"); - this._embedTarget = this; - - this.prepareEmbed(); - this.loadExternal(); - } - - prepareEmbed() { - if(this._wrapElementType !== null) { - let bed = document.createElement(this._wrapElementType); - this.append(bed); - this._embedTarget = bed; - } - } - - async loadExternal() { - let response = await fetch(this._src); - let externalText = await response.text(); - this.embedExternal(externalText); - } - - embedExternal(body) { - body = body.replace(/^[]*(\[[^]]*\])?>/gm, "").trim(); - body = body.replace(/()|()|()|()|(