pattern-dump 0.1.0-alpha.2 → 0.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/README.md +1 -1
- package/dist/chunks/{chunk-3WZHFYHZ.js → chunk-NXGPZL5L.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/pd.js +481 -310
- package/dist/types/config/index.d.ts +12 -4
- package/dist/types/contracts/dev-protocol.d.ts +4 -3
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.4
|
|
4
|
+
|
|
5
|
+
Fixes found while moving a third PatternLab styleguide (CTS) to Pattern Dump with hTWOo consumed only as
|
|
6
|
+
pattern packages: its templates, data, scripts and CSS all come from `@n8d/htwoo-patterns` and
|
|
7
|
+
`@n8d/htwoo-core`, and the project compiles only its own SCSS.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `styles: false` on a package reference leaves that package's stylesheets out, for a project that
|
|
12
|
+
compiles them itself; its templates, data, themes, scripts and assets are still used. It also works
|
|
13
|
+
for a package that another brings in as a peer: name the peer with the option.
|
|
14
|
+
- `themes.dir` is optional: `themes: { default: "<name>" }` alone makes one of your packages' themes the
|
|
15
|
+
one previews start with. `pd dev` warns when the default matches no theme.
|
|
16
|
+
- A component or variant `.json` that does not parse is reported as a `DATA_INVALID` diagnostic, with
|
|
17
|
+
the file and, where the parser gives one, the line and column, instead of being dropped silently. An
|
|
18
|
+
invalid variant file no longer fails the whole render.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- A class belongs to the rule that defines it (the class on its own, such as `.card` or `.card:hover`),
|
|
23
|
+
not to every rule that mentions it. A project rule that restyles a package class in context
|
|
24
|
+
(`.tile .hoo-radio`) took the class over, so the package component's CSS was never linked where the
|
|
25
|
+
class was used.
|
|
26
|
+
- A rule repeated after a different one (A, B, A) keeps its last position in the base layer and in
|
|
27
|
+
component CSS, as the browser applies it. The first copy was kept, so B won.
|
|
28
|
+
- Included partials keep the caller's data frame, as in stock Handlebars: `@root` is the page's data,
|
|
29
|
+
and `{{#if @partial-block}}` sees the block of a block call.
|
|
30
|
+
- A configured `styles.entry` list compiles in the order given. It was sorted, which could change the
|
|
31
|
+
cascade.
|
|
32
|
+
- SCSS can load an installed package by its bare name (`@use '@scope/pkg/…'`) or a `pkg:` URL, without
|
|
33
|
+
`SASS_PATH`.
|
|
34
|
+
- A data variant reached by its own id (`/preview/atoms/chip~danger`) or included by its handle
|
|
35
|
+
(`{{> "atoms-chip~danger"}}`) renders on top of its base component's data, as `?variant=` already did.
|
|
36
|
+
- `pd build` copies assets as `pd dev` serves them: where two asset folders share a name, the first one
|
|
37
|
+
(the project's) wins and the other is left out and reported. A package's `images/` used to overwrite
|
|
38
|
+
the project's in the snapshot. `pd dev` warns about such folders at startup.
|
|
39
|
+
|
|
40
|
+
## 0.1.0-alpha.3
|
|
41
|
+
|
|
42
|
+
Fixes found while moving a second PatternLab styleguide (n8d) to Pattern Dump.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- A numbered `templates` or `pages` folder now gets the `full` preview layout its category promises.
|
|
47
|
+
The category was matched with its ordering prefix still attached, so a PatternLab tree
|
|
48
|
+
(`04-templates`, `05-pages`) could never hit the documented default — only a per-folder
|
|
49
|
+
`preview: full` could. Folder *labels* still keep the number: `2-col` is a name and `04-templates`
|
|
50
|
+
a prefix, and nothing in the string tells them apart, so a numbered folder sets `title:` for a
|
|
51
|
+
clean label.
|
|
52
|
+
- A `requireScript` or `globalScripts` id with no matching `<scriptsDir>/<id>.ts` is reported instead
|
|
53
|
+
of failing inside the preview. `pd dev` names every unresolvable id at startup — with the component
|
|
54
|
+
for a `requireScript` — and the script's URL answers 404 saying which file it expected and where,
|
|
55
|
+
rather than embedding a raw `ENOENT`. Scripts are TypeScript, so a `.js` file of the same name does
|
|
56
|
+
not satisfy an id; that is the common case this hid.
|
|
57
|
+
|
|
3
58
|
## 0.1.0-alpha.2
|
|
4
59
|
|
|
5
60
|
Fixes found while moving a PatternLab styleguide to Pattern Dump, and the changes they needed.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A workbench for HTML and CSS design systems, and a successor to PatternLab. Writ
|
|
|
4
4
|
Handlebars templates with SCSS, data and Markdown docs; Pattern Dump shows them live, checks them, maps
|
|
5
5
|
how they relate, and publishes the result as a static site.
|
|
6
6
|
|
|
7
|
-
> **Alpha (0.1.0-alpha.
|
|
7
|
+
> **Alpha (0.1.0-alpha.4).** Published under the `alpha` tag. Options and file conventions can still change
|
|
8
8
|
> between releases.
|
|
9
9
|
|
|
10
10
|
## Requirements
|
|
@@ -19,7 +19,7 @@ var SHAPE = {
|
|
|
19
19
|
switch: { values: ["attribute", "stylesheet"] },
|
|
20
20
|
swatch: { keys: { slots: "strings" }, required: ["slots"] }
|
|
21
21
|
},
|
|
22
|
-
required: ["
|
|
22
|
+
required: ["default"]
|
|
23
23
|
},
|
|
24
24
|
assets: {
|
|
25
25
|
keys: {
|
|
@@ -107,8 +107,8 @@ function checkValue(value, rule, at, problems) {
|
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
if (rule === "packages") {
|
|
110
|
-
const ok = Array.isArray(value) && value.every((p) => typeof p === "string" || isObject(p) && typeof p.name === "string" && (p.exclude === void 0 || isStrings(p.exclude)));
|
|
111
|
-
if (!ok) fail(`a list of package names or { name, exclude } objects`);
|
|
110
|
+
const ok = Array.isArray(value) && value.every((p) => typeof p === "string" || isObject(p) && typeof p.name === "string" && (p.exclude === void 0 || isStrings(p.exclude)) && (p.styles === void 0 || typeof p.styles === "boolean"));
|
|
111
|
+
if (!ok) fail(`a list of package names or { name, exclude, styles } objects`);
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
if (rule === "logo") {
|