Skip to content

Commit

Permalink
Remove support for Handlebars, Thymeleaf and JSX
Browse files Browse the repository at this point in the history
Based on this, restore compatability with the current versions of
faucet-pipeline-*

Use the opportunity to update the other dependencies as well
  • Loading branch information
moonglum committed Jul 18, 2023
1 parent 3de8007 commit cb9885d
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 215 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
aiur version history
====================

v0.10.0
-------


significant changes for end users:

* fix compatability with current versions of faucet-pipeline
* remove support for JSX, Handlebars and Thymeleaf

v0.9.0
------

Expand Down
4 changes: 2 additions & 2 deletions bin/aiur
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ let liveserve = options.liveserve;
delete options.liveserve;
faucet(referenceDir, config, options);

if (liveserve) {
server.live(liveserve, config.manifest.webRoot);
if(liveserve) {
server.live(liveserve, config.manifest.webRoot);
}
25 changes: 3 additions & 22 deletions example/aiur.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
exports.title = "Example Styleguide";
exports.language = "en";

exports.snippetAssets = {
sass: [{
source: "./index.scss",
target: "./snippet.css"
}],

js: [{
source: "./index.js",
target: "./snippet.js"
}]
};

exports.vendor = {
styles: [{
crossorigin: "anonymous",
Expand All @@ -28,23 +16,16 @@ exports.pages = {
"": {
file: "./components/welcome.md",
children: {
languages: {
file: "./languages/languages.md",
data: "./languages/languages.data.js"
}
languages: "./languages/languages.md"
}
},
atoms: {
file: "./components/atoms.md",
children: {
button: "./components/button/doc.md",
strong: "./components/strong/doc.md",
thing: {
file: "./components/thing/thing.md",
data: "./components/thing/thing.json"
}
strong: "./components/strong/doc.md"
}
}
};

exports.watchDirs = ["./components", "./languages"]
exports.watchDirs = ["./components", "./languages"];
7 changes: 2 additions & 5 deletions example/components/button/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ status: ready

My favorite button:

```jsx
import { Button } from "./components/button";
import { createElement } from "complate-stream";

<Button label="ok" />
```html
<button class="btn">ok</button>
```
5 changes: 0 additions & 5 deletions example/components/button/index.jsx

This file was deleted.

1 change: 0 additions & 1 deletion example/components/thing/thing.html

This file was deleted.

11 changes: 0 additions & 11 deletions example/components/thing/thing.json

This file was deleted.

27 changes: 0 additions & 27 deletions example/components/thing/thing.md

This file was deleted.

3 changes: 0 additions & 3 deletions example/components/thing/thing.scss

This file was deleted.

Empty file removed example/index.js
Empty file.
1 change: 0 additions & 1 deletion example/index.scss

This file was deleted.

11 changes: 0 additions & 11 deletions example/languages/languages.data.js

This file was deleted.

17 changes: 5 additions & 12 deletions example/languages/languages.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
title: Languages in Aiur

In Aiur it is quite simple to mix several templating languages in one document. Aiur uses slightly enhanced markdown code blocks to transform your component code into an interactive preview of it.

Here, a handlebars template wants to say “Hello!”:

```handlebars
<button>{{handlebars.message}}</button>
```

Plain HTML is with us, too, of course:
Aiur uses slightly enhanced markdown code blocks to transform your component code into an interactive preview of it.
Use the language `html` for the snippet:

```html
<button>Hi, HTML here 👋</button>
```

Simply provide an annotated code block as you are used to:
This is how it looks like in Markdown:

```handlebars
<button>{{message}}</button>
```html
<button>Hi, HTML here 👋</button>
```
13 changes: 7 additions & 6 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Options:
-t, --target
put the generated files here (default: ./dist)
--baseuri
base uri path the files are served from (default: /)
base uri path the files are served from (default: /)
--fingerprint
add unique hash to file names
--sourcemaps
Expand Down Expand Up @@ -85,12 +85,13 @@ module.exports = function parseCLI(argv = process.argv.slice(2), help = HELP) {
webRoot: target
},

plugins: {
aiur: {
plugin: aiur,
bucket: "markup"
plugins: [
{
bucket: "markup",
key: "aiur",
plugin: aiur
}
}
]
};

Object.entries(rawConfig.snippetAssets || {}).forEach(([pipeline, entries]) => {
Expand Down
29 changes: 0 additions & 29 deletions lib/complate.js

This file was deleted.

18 changes: 0 additions & 18 deletions lib/complate_rendering.js

This file was deleted.

7 changes: 0 additions & 7 deletions lib/handlebars.js

This file was deleted.

23 changes: 6 additions & 17 deletions lib/site.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
let generatePageTree = require("./tree");
let resolvePath = require("faucet-pipeline-core/lib/util/resolve");
let { abort, reportFileStatus } = require("faucet-pipeline-core/lib/util");
let mkdirp = require("mkdirp");
let fs = require("fs");
let { mkdirp } = require("mkdirp");
let { writeFile } = require("node:fs/promises");
let path = require("path");
let { promisify } = require("util");
let PageRenderer = require("./page_renderer");
let SnippetWrapper = require("./snippet_wrapper");
let generateLayout = require("./generate_layout");
let Navigation = require("./navigation");

let writeFile = promisify(fs.writeFile);

let DEFAULTS = {
renderers: {
handlebars: require("./handlebars"),
html: require("./html"),
jsx: require("./complate"),
thymeleaf: require("./thymeleaf")
},
generateLayout
};

module.exports = class Site {
constructor({ source, target, baseURI }, assetManager) {
let { referenceDir } = assetManager;
Expand All @@ -30,9 +17,11 @@ module.exports = class Site {
target: resolvePath(target, referenceDir, { enforceRelative: true }),
baseURI,
// TODO: either make this configurable or autoload renderers on use
renderers: DEFAULTS.renderers,
renderers: {
html: require("./html")
},
// TODO: make this configurable, but first find a simpler contract
generateLayout: DEFAULTS.generateLayout,
generateLayout,
assetManager
});
this.dirs = new Set();
Expand Down
23 changes: 0 additions & 23 deletions lib/thymeleaf.js

This file was deleted.

16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,23 @@
},
"dependencies": {
"commonmark": "^0.30.0",
"complate-stream": "^0.16.10",
"donny": "^0.3.0",
"faucet-pipeline-core": "^2.0.0",
"faucet-pipeline-esnext": "^2.1.7",
"faucet-pipeline-jsx": "^2.1.7",
"faucet-pipeline-esnext": "^3.0.0",
"faucet-pipeline-jsx": "^3.0.0",
"faucet-pipeline-sass": "^1.7.0",
"faucet-pipeline-static": "^2.0.0",
"five-server": "^0.1.2",
"handlebars": "^4.7.7",
"five-server": "^0.3.1",
"metacolon": "^1.1.1",
"minimist": "^1.2.5",
"mkdirp": "^1.0.4",
"mkdirp": "^3.0.1",
"parse5": "^7.1.2",
"prismjs": "^1.26.0",
"require-from-string": "^2.0.2",
"thymeleaf": "^0.21.0"
"prismjs": "^1.26.0"
},
"devDependencies": {
"eslint-config-fnd": "^1.12.0",
"mocha": "^10.2.0",
"release-util-fnd": "^3.0.0",
"rimraf": "^3.0.2"
"rimraf": "^5.0.1"
}
}
7 changes: 2 additions & 5 deletions test/test_site.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/* global describe, it, beforeEach, afterEach */
let Site = require("../lib/site");
let { assertSame, fixturesPath, fixturesDir, expectationsPath, MockAssetManager } = require("./util");
let fs = require("fs");
let { promisify } = require("util");
let rimraf = promisify(require("rimraf"));

let readFile = promisify(fs.readFile);
let { readFile } = require("node:fs/promises");
let { rimraf } = require("rimraf");

let assetManager = new MockAssetManager(fixturesDir);

Expand Down

0 comments on commit cb9885d

Please sign in to comment.