@inkdropapp/theme-dev-helpers 0.2.0 → 0.2.1

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/bun.lockb CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkdropapp/theme-dev-helpers",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A helper module for creating themes for Inkdrop",
5
5
  "keywords": [
6
6
  "inkdrop",
@@ -18,7 +18,6 @@
18
18
  "@inkdropapp/base-ui-theme": "^0.3.0",
19
19
  "@inkdropapp/css": "^0.4.2",
20
20
  "commander": "^12.1.0",
21
- "debug": "^4.3.7",
22
21
  "puppeteer": "^23.5.3"
23
22
  }
24
23
  }
@@ -30,10 +30,14 @@ async function extractPalette(outputPath: string) {
30
30
  const page = await browser.newPage();
31
31
 
32
32
  page
33
- .on('console', message =>
34
- console.error(`${message.type().substr(0, 3).toUpperCase()} ${message.text()}`))
33
+ .on('console', message => {
34
+ if (message.type() === 'error') {
35
+ console.error(`${message.type().substr(0, 3).toUpperCase()} ${message.text()}`)
36
+ }
37
+ })
35
38
  .on('pageerror', ({ message }) => console.error(message));
36
39
 
40
+ const themeCSSFiles = (themePackageJson.styleSheets?.map((filePath: string) => (`<link rel="stylesheet" href="styles/${filePath}" />`)) || []).join('\n')
37
41
  const baseUrl = pathToFileURL(process.cwd()).toString() + '/';
38
42
  const content = `<!DOCTYPE html>
39
43
  <html>
@@ -43,7 +47,7 @@ async function extractPalette(outputPath: string) {
43
47
  <link rel="stylesheet" href="node_modules/@inkdropapp/css/tokens.css" />
44
48
  <link rel="stylesheet" href="node_modules/@inkdropapp/css/tags.css" />
45
49
  <link rel="stylesheet" href="node_modules/@inkdropapp/base-ui-theme/styles/theme.css" />
46
- <link rel="stylesheet" href="styles/theme.css" />
50
+ ${themeCSSFiles}
47
51
  </head>
48
52
  <body class="${themePackageJson.name} ${typeof appearance !== 'undefined' ? appearance + '-mode' : ''}">
49
53
  <h1>Hello</h1>