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 21 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
18 changes: 8 additions & 10 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,12 +33,12 @@
"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",
Expand All @@ -56,14 +55,10 @@
"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",
Expand Down Expand Up @@ -136,5 +131,8 @@
},
"readme": "ERROR: No README data found!",
"homepage": "https://github.com/phase2/outline#readme",
"_id": "@phase2/outline@0.1.1"
"_id": "@phase2/outline@0.1.1",
"dependencies": {
"@phase2/outline-adopted-stylesheets-controller": "0.0.6"
}
}
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
11 changes: 3 additions & 8 deletions packages/components/outline-core-alert/src/outline-core-alert.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, TemplateResult, CSSResultGroup, css } from 'lit';
import { html, TemplateResult, css } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { OutlineElement } from '@phase2/outline-core';
Expand All @@ -7,9 +7,7 @@ import {
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 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,7 +41,7 @@ export class OutlineCoreAlert
extends OutlineElement
implements OutlineCoreAlertInterface
{
static styles: CSSResultGroup = [componentStyles];
// static styles: CSSResultGroup = [componentStyles];
adoptedStylesheets: AdoptedStyleSheets;
himerus marked this conversation as resolved.
Show resolved Hide resolved
debug = false;

Expand All @@ -62,9 +60,6 @@ export class OutlineCoreAlert
connectedCallback() {
super.connectedCallback();
this.adoptedStylesheets = new AdoptedStyleSheets(css`
outline-core-alert {
${componentVars}
}
${globalStyles}
`);
this.addController(this.adoptedStylesheets);
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
1 change: 0 additions & 1 deletion packages/components/outline-core-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"dependencies": {
"@phase2/outline-core": "^0.2.6",
"@phase2/outline-link": "^0.1.4",
"lit": "^2.3.1",
"tslib": "^2.1.0"
},
Expand Down
Loading
Loading