Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor adjustments and tweaks #434

Merged
merged 30 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7fbdaee
feat(adopted-stylesheets): Make `AdoptedStyleSheets` controller more …
himerus Jan 18, 2024
6328804
fix(adopted-stylesheets): Throw an error if no root is present.
himerus Jan 18, 2024
ce0cacf
Merge branch 'next' into feature/adopted-stylesheets-update
glitchgirl Feb 6, 2024
12be159
feat(adopted-stylesheets): Tweaked docs.
himerus Feb 6, 2024
6bafd84
feat(adopted-stylesheets): Comment update.
himerus Feb 6, 2024
58dff7b
Merge branch 'next' into feature/adopted-stylesheets-update
himerus Feb 7, 2024
41c46cf
feat(adopted-stylesheets): Adjustments to README.
himerus Feb 12, 2024
568a692
feat(adopted-stylesheets): Make passing `document` optional and the d…
himerus Feb 12, 2024
3dbe9bb
feat(adopted-stylesheets): Updated documentation.
himerus Feb 15, 2024
87329bb
feat(tooling): Updated GitHub Actions.
himerus Feb 15, 2024
ffe4890
Merge branch 'next' into feature/action-updates
himerus Feb 15, 2024
9aade98
chore(diff): Update yarn.lock.
himerus Feb 15, 2024
b448d69
feat(actions): Update installations/setup.
himerus Feb 15, 2024
0b20790
feat(actions): Use local yarn version.
himerus Feb 15, 2024
38ae743
feat(actions): Update step ordering.
himerus Feb 15, 2024
ea2fe53
feat(actions): Switching to node:lts container image for testing.
himerus Feb 15, 2024
2e9d54c
feat(tooling): Tweaking setup to simplify CSS and component builds.
himerus Feb 15, 2024
d5637cd
Merge branch 'next' into feature/adopted-stylesheets-update
himerus Feb 15, 2024
fad8aba
Merge branch 'feature/adopted-stylesheets-update' into feature/action…
himerus Feb 15, 2024
b8f9361
feat(tooling): Moved all deprecated packages to a more friendly folde…
himerus Feb 15, 2024
66b1168
feat(tooling): fix for broken deps and linting.
himerus Feb 15, 2024
8cf9103
feat(tooling): Adjusting for storybook build and css setup.
himerus Feb 15, 2024
755e9e3
feat(tooling): Refactor for many package deps.
himerus Feb 15, 2024
7bbfee4
feat(tooling): Adjusting action.
himerus Feb 15, 2024
d7a3cfb
feat(tooling): Remove need for `rsync` call.
himerus Feb 15, 2024
94d9260
feat(tooling): Wiped deprecated packages to move to new location.
himerus Feb 15, 2024
226c27a
feat(tooling): Remove comments.
himerus Feb 15, 2024
f20dca0
fix(styles): Adjust CSS setup.
himerus Feb 16, 2024
c34b007
fix(outline-alert): Prepare for initial release.
himerus Feb 16, 2024
ce4612e
fix(changeset): Adding changesetl.
himerus Feb 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ storybook-static/
.yarn/
project/
*.d.ts
packages/tools/outline-cli/
packages/deprecated
53 changes: 24 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ jobs:
setup:
name: Install & Lint Codebase
runs-on: ubuntu-latest
container:
image: node:lts
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout Codebase
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use local Yarn version
run: echo "$(pwd)/.yarn/releases" >> $GITHUB_PATH

# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -54,30 +59,10 @@ jobs:
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@phase2'

- name: Initialize .npmrc
run: cp $NPM_CONFIG_USERCONFIG .npmrc

# # @see https://github.com/marketplace/actions/cache
# # node_modules caching is validated by always running yarn install.
# # Turborepo cache lives inside node_modules/.cache/turbo
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

# - name: Setup Cache
# id: cache-yarn
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-node-yarn-18-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
# restore-keys:
# ${{ runner.os }}-node-yarn-18-${{ env.cache-name }}-
# ${{ runner.os }}-node-yarn-${{ env.cache-name }}-
# ${{ runner.os }}-node-yarn-

- name: Install
run: yarn install
env:
Expand All @@ -92,15 +77,20 @@ jobs:
build_outline:
name: Build Outline Codebase
runs-on: ubuntu-latest
container:
image: node:lts
needs: ['setup']
# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout Codebase
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use local Yarn version
run: echo "$(pwd)/.yarn/releases" >> $GITHUB_PATH

# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand Down Expand Up @@ -128,16 +118,21 @@ jobs:
name: "Publish: GitHub Pages"
if: github.ref == 'refs/heads/next'
runs-on: ubuntu-latest
container:
image: node:lts
needs: ['setup', 'build_outline']

# The steps for the setup job.
steps:
# @see https://github.com/marketplace/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use local Yarn version
run: echo "$(pwd)/.yarn/releases" >> $GITHUB_PATH

# @see https://github.com/marketplace/actions/setup-node-js-environment
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -150,7 +145,7 @@ jobs:
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@phase2'

- name: Install
run: yarn install

Expand Down Expand Up @@ -180,7 +175,7 @@ jobs:

# @see https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Storybook artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: storybook-latest
path: storybook-static/
Expand Down
2 changes: 1 addition & 1 deletion .storybook/storybook.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import url('https://rsms.me/inter/inter.css');
/* Outline */
@import '../packages/outline-templates/default/outline.theme.css';
@import '../outline.theme.css';
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
"workspaces": [
"./packages/*",
"./packages/components/*",
"./packages/components/@deprecated/*",
"./packages/deprecated/*",
"./packages/documentation/*",
"./packages/controllers/*",
"./packages/controllers/@deprecated/*",
"./packages/tools/*",
"./docs"
],
Expand All @@ -34,18 +33,19 @@
"license": "BSD-3-Clause",
"scripts": {
"analyze": "yarn build && wca analyze 'packages/**/*.ts' --outFiles '{dir}/../README.md'",
"build": "turbo run build --concurrency=100% --filter=!./packages/**/@deprecated/*",
"build": "turbo run build --concurrency=100%",
"changeset": "changeset",
"changeset:publish": "yarn build && yarn changeset:version && yarn changeset publish",
"changeset:version": "changeset version",
"chromatic": "chromatic --build-script-name storybook:build --exit-zero-on-changes --skip '@(renovate/**|dependabot/**)'",
"clean": "npm-run-all -s clean:*",
"clean": "npm-run-all -p clean:*",
"clean:dist": "rimraf dist && rimraf packages/**/dist",
"clean:turbo": "rimraf packages/**/.turbo",
"clean:storybook": "rimraf storybook-static",
"clean:css": "rimraf packages/**/*.lit.*",
"clean:maps": "rimraf packages/**/*.map",
"clean:types": "rimraf packages/**/*.d.ts",
"dev": "yarn watch",
"fix": "yarn format && yarn lint",
"format": "npm-run-all -s format:*",
"format:code": "eslint --fix . && prettier --write .",
Expand All @@ -56,23 +56,18 @@
"lint:tsc": "tsc --noEmit",
"lint:prettier": "prettier --check .",
"package": "turbo run package --filter=!./packages/**/@deprecated/*",
"prep": "npm-run-all -s prep:*",
"prep:css": "node scripts/styles.js",
"prebuild": "yarn prep",
"prestart": "yarn prep",
"rebuild": "yarn reset && yarn build",
"reset": "yarn clean && npm-run-all -s reset:*",
"reset:packages": "rimraf packages/**/node_modules",
"reset:root": "rimraf ./node_modules",
"reset:root": "rimraf node_modules",
"reset:install": "yarn install",
"restart": "yarn reset && yarn start",
"start": "yarn watch",
"start": "yarn dev",
"storybook": "storybook",
"storybook:build": "storybook build",
"test": "turbo run test",
"watch": "npm-run-all -p watch:*",
"watch:storybook": "yarn storybook dev -p ${npm_package_storybook_port}",
"watch:css": "node scripts/styles.js --watch"
"watch:storybook": "yarn storybook dev -p ${npm_package_storybook_port}"
},
"keywords": [
"web-components",
Expand Down Expand Up @@ -136,5 +131,8 @@
},
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/phase2/outline#readme",
"_id": "@phase2/[email protected]"
"_id": "@phase2/[email protected]",
"dependencies": {
"lit": "^3.1.2"
}
}
2 changes: 1 addition & 1 deletion packages/components/outline-core-accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@phase2/outline-core": "^0.2.6",
"lit": "^2.3.1"
"lit": "^3.1.2"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { html, TemplateResult, CSSResultGroup } from 'lit';
import { html, TemplateResult } from 'lit';
import { customElement } from 'lit/decorators.js';

// Our base component, which all others extend.
import { OutlineElement } from '@phase2/outline-core';

import componentStyles from './outline-core-accordion.css.lit';
// import componentStyles from './outline-core-accordion.css.lit';

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting out the import of component styles will prevent the component from being styled as intended. Ensure this is the desired behavior.

/** The element name, reused throughout the codebase */
const componentName = 'outline-core-accordion';
Expand All @@ -26,7 +26,7 @@ const componentName = 'outline-core-accordion';
*/
@customElement(componentName)
export class OutlineCoreAccordion extends OutlineElement {
static styles: CSSResultGroup = [componentStyles];
// static styles: CSSResultGroup = [componentStyles];

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting out the assignment of styles removes the component's styling. If this is intentional, consider removing the code instead of commenting it out for cleaner code.

render(): TemplateResult {
return html` <slot></slot> `;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/outline-core-alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Outline Core Alert component

| Property | Attribute | Type | Default | Description |
|----------------------|------------------|-----------------------------------------------|---------|-----------------------------------------------|
| `adoptedStylesheets` | | `AdoptedStyleSheets` | | |
| `adoptedStylesheets` | | `AdoptedStylesheets` | | |
| `debug` | | `boolean` | false | |
| `isInteractive` | `is-interactive` | `boolean` | false | This is important context for screen readers. |
| `status` | `status` | `"info" \| "warning" \| "error" \| "success"` | "info" | |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/outline-core-alert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@phase2/outline-core": "^0.2.6",
"lit": "^2.3.1"
"lit": "^3.1.2"
},
"publishConfig": {
"access": "public"
Expand Down
29 changes: 8 additions & 21 deletions packages/components/outline-core-alert/src/outline-core-alert.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { html, TemplateResult, CSSResultGroup, css } from 'lit';
import { html, TemplateResult } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { OutlineElement } from '@phase2/outline-core';
import {
CoreAlertStatusType,
OutlineCoreAlertInterface,
} from '@phase2/outline-core-alert';
import { AdoptedStyleSheets } from '@phase2/outline-adopted-stylesheets-controller';
import componentStyles from './style/outline-core-alert.css.lit';
import componentVars from './style/outline-core-alert.vars.css.lit';
import globalStyles from './style/outline-core-alert.lightDom.css.lit';
import { AdoptedStylesheets } from '@phase2/outline-adopted-stylesheets-controller';
import globalStyles from './style/outline-core-alert.global.css?inline';

/** The element name, reused throughout the codebase */
const componentName = 'outline-core-alert';
Expand Down Expand Up @@ -43,8 +41,11 @@ export class OutlineCoreAlert
extends OutlineElement
implements OutlineCoreAlertInterface
{
static styles: CSSResultGroup = [componentStyles];
adoptedStylesheets: AdoptedStyleSheets;
// static styles: CSSResultGroup = [componentStyles];
GlobalStylesheets: AdoptedStylesheets | undefined = new AdoptedStylesheets(
himerus marked this conversation as resolved.
Show resolved Hide resolved
this,
globalStyles
);
debug = false;

@property({ type: String, attribute: 'status' })
Expand All @@ -56,20 +57,6 @@ export class OutlineCoreAlert
@property({ type: Boolean, attribute: 'is-interactive' })
isInteractive = false;

/**
* @see `outline-core-link` documentation as to the purpose of this method.
*/
connectedCallback() {
super.connectedCallback();
this.adoptedStylesheets = new AdoptedStyleSheets(css`
outline-core-alert {
${componentVars}
}
${globalStyles}
`);
this.addController(this.adoptedStylesheets);
}

render(): TemplateResult {
// The `body` wrapper is used to circumvent limitations with styling the `:host` directly, such as applying borders.
return html`
Expand Down
2 changes: 1 addition & 1 deletion packages/components/outline-core-breadcrumb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@phase2/outline-core": "^0.2.6",
"lit": "^2.3.1"
"lit": "^3.1.2"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { html, TemplateResult, CSSResultGroup } from 'lit';
import { html, TemplateResult } from 'lit';
import { customElement } from 'lit/decorators.js';

// Our base component, which all others extend.
import { OutlineElement } from '@phase2/outline-core';

import componentStyles from './outline-core-breadcrumb.css.lit';
// import componentStyles from './outline-core-breadcrumb.css.lit';

himerus marked this conversation as resolved.
Show resolved Hide resolved
/** The element name, reused throughout the codebase */
const componentName = 'outline-core-breadcrumb';
Expand All @@ -26,7 +26,7 @@ const componentName = 'outline-core-breadcrumb';
*/
@customElement(componentName)
export class OutlineCoreBreadcrumb extends OutlineElement {
static styles: CSSResultGroup = [componentStyles];
// static styles: CSSResultGroup = [componentStyles];

himerus marked this conversation as resolved.
Show resolved Hide resolved
render(): TemplateResult {
return html` <slot></slot> `;
Expand Down
Loading
Loading