Skip to content

[Bug]: Changes needed post init for successful storybook and build runs #383

@tekante

Description

@tekante

Describe the bug

This issue is to document changes made post init to allow for a successful execution of yarn run start and yarn run build. Successful as defined by completion of the process without an error code return. Detailed examination of results was not conducted.

To Reproduce
Steps to reproduce the behavior:

  1. Run npx @phase2/outline-cli@latest init -a -s issue-repro
  2. cd issue-repro
  3. Run yarn run start
  4. See error
  5. Run yarn run build
  6. See error

Expected behavior
A storybook instance successfully builds and launches with yarn run start

A full build completes successfully with yarn run build

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

This is a diff showing changes I made to the produced codebase in order to successfully execute the two referenced commands

diff --git a/node_modules/@phase2/outline-core/index.d.ts b/node_modules/@phase2/outline-core/index.d.ts
new file mode 100644
index 00000000..02903aec
--- /dev/null
+++ b/node_modules/@phase2/outline-core/index.d.ts
@@ -0,0 +1,8 @@
+/**
+ * Add the scopeId to each CSS rule selector.
+ * Handle the :host and ::slotted selectors.
+ */
+declare module '@phase2/outline-core/src/internal/light-dom.mjs' {
+  export function addScopeToStyles(cssStyles: any, scopeId: any): string;
+}
+//# sourceMappingURL=light-dom.d.mts.map
\ No newline at end of file
diff --git a/node_modules/@phase2/outline-core/src/controllers/light-dom-styles.ts b/node_modules/@phase2/outline-core/src/controllers/light-dom-styles.ts
index 3f229520..c0aa0993 100644
--- a/node_modules/@phase2/outline-core/src/controllers/light-dom-styles.ts
+++ b/node_modules/@phase2/outline-core/src/controllers/light-dom-styles.ts
@@ -1,6 +1,6 @@
 /* eslint-disable no-console */
 import { ReactiveControllerHost, CSSResultGroup, CSSResult } from 'lit';
-import { addScopeToStyles } from '../internal/light-dom';
+import { addScopeToStyles } from '@phase2/outline-core/src/internal/light-dom.mjs';

 /**
  * The LightComStyles ReactiveController.
diff --git a/rollup.config.mjs b/rollup.config.mjs
index 1698aab8..325c48ca 100644
--- a/rollup.config.mjs
+++ b/rollup.config.mjs
@@ -48,6 +48,7 @@ const defaultOutput = {
       'src/components/**/*.css.lit.ts',
       'src/components/**/*.test.ts',
       'src/components/examples/**/*',
+      'src/components/sample/**/*',
     ],
   },
   output: [
diff --git a/scripts/styles.mjs b/scripts/styles.mjs
index bd0a9600..09bf816b 100644
--- a/scripts/styles.mjs
+++ b/scripts/styles.mjs
@@ -6,7 +6,7 @@ import postcss from 'postcss';
 import fs from 'fs';
 import path from 'path';
 import glob from 'glob';
-import config from '@phase2/outline-config/postcss.config.js';
+import config from '@phase2/outline-config/postcss.config';
 import outline from '../outline.config.js';
 import { addScopeToStyles } from '@phase2/outline-core/src/internal/light-dom.mjs';

diff --git a/tsconfig.json b/tsconfig.json
index c0aa638e..63c9f053 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -42,6 +42,7 @@
   "exclude": [
     "./src/components/**/*.stories.ts",
     "./src/components/**/*.lit.ts",
+    "./src/components/sample/**/*.ts",
     "node_modules"
   ]
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Requires TriageA ticket that requires verification before being worked.Type: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions