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

Add theming capability to Explorer 1 #433

Merged
merged 40 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
dac0484
converting monorepo (pnpm workspaces)
stephiescastle May 20, 2024
91f7f12
fixing symlinks issue in mdx
stephiescastle May 20, 2024
2067fd6
fixing ts config in packages/html
stephiescastle May 20, 2024
33b8602
small fixes to tailwind config and mdx render
stephiescastle May 20, 2024
5f69fd6
unifying prettier config and tsconfig
stephiescastle May 20, 2024
4902c42
prototyping how to share story data between storybooks
stephiescastle May 20, 2024
cf454c5
completing @explorer-1/vue package
stephiescastle May 20, 2024
8abac70
completing @explorer-1/storybook-vue app
stephiescastle May 21, 2024
0ffed09
updating makefile
stephiescastle May 21, 2024
71cfbbd
switching vue vite to library mode
stephiescastle May 21, 2024
857f94d
adding @explorer-1/nuxt module
stephiescastle May 21, 2024
0091991
adding module to makeful, minor cleanup
stephiescastle May 21, 2024
6548a8e
fixing duplicate modules in vite
stephiescastle May 21, 2024
a74fa2f
fixing make commands, building module
stephiescastle May 21, 2024
1c2c475
removing ignored dist
stephiescastle May 22, 2024
ef6df67
updating gitignore
stephiescastle May 22, 2024
eb1f8fb
renaming storybook-* to *-storybook
stephiescastle May 22, 2024
5e0196d
updating Storybook to 8.1.2
stephiescastle May 22, 2024
0107fef
wip updating github workflow for pnpm
stephiescastle May 22, 2024
81ef970
Adding scaffolding for theming Explorer-1
stephiescastle May 22, 2024
4ab62c4
Improvements to Storybook theme switcher
stephiescastle May 23, 2024
0ed7365
wip renaming ThemeLight, ThemeDark, and implementing theme-color via …
stephiescastle May 23, 2024
02cdf18
adding @explorer-1/common-storybook
stephiescastle May 23, 2024
70103e3
merging in latest monorepo changes
stephiescastle May 23, 2024
0bc1b29
restoring deleted files
stephiescastle May 23, 2024
29a1927
adding more addons to vue-storybook
stephiescastle May 23, 2024
b87dcc1
disabling linting in ci (temporary), fixing storybook action
stephiescastle May 23, 2024
7f5dd74
restore some linting actions
stephiescastle May 23, 2024
5cf88b2
updating gitignore
stephiescastle May 23, 2024
b090337
adding gitkeep for public folder
stephiescastle May 23, 2024
d739328
merging in latest monorepo branch
stephiescastle May 23, 2024
a21dff0
removing old themes key
stephiescastle May 23, 2024
f40d553
Feature: monorepo eslint upgrade to flat config (#435)
jamesray May 24, 2024
bf0d6bd
convert packages/html to use vite instead of parcel
stephiescastle May 24, 2024
b72e94e
merging in latest feature/monorepo
stephiescastle May 24, 2024
efa2418
clean up
stephiescastle May 24, 2024
adb8f1f
tailwind config cleanup
stephiescastle May 24, 2024
8eb3beb
merging in latest main
stephiescastle May 24, 2024
b2aecc4
lint emits
stephiescastle May 24, 2024
830ad87
Merge branch 'main' into poc/edu-theme
stephiescastle May 24, 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
  •  
  •  
  •  
21 changes: 0 additions & 21 deletions .eslintrc.js

This file was deleted.

13 changes: 8 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Set up Node ⬢
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies 🧱
run: npm install
run: pnpm install

- name: Lint scripts 🏗
run: npm run lint:js
run: pnpm run lint:js

- name: Lint styles 💅
run: npm run lint:style
run: pnpm run lint:style

- name: Check Prettier ✨
run: npm run lint:format
run: pnpm run lint:format
75 changes: 58 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,76 @@
# mac OS
.DS_Store

# npm
node_modules/
npm-debug.log

# parcel.js
.parcel-cache
/src/.parcel
# OSX
.DS_Store
.AppleDouble
.LSOverride
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Storybook
storybook_compiled
# Temp directories
.temp
.tmp
.cache

# Linter caches
.eslintcache
.stylelintcache

# Logs
*.log*

# PyCharm
.idea

# vscode
.vscode

# IntelliJ
# Intellij
out/
*.iml
.idea

# mpeltonen/sbt-idea plugin
.idea_modules/

# VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Testing
reports
coverage
*.lcov
.nyc_output

# parcel.js
.parcel-cache
.parcel

# Storybook
storybook_compiled

# Nuxt
.nuxt
.output
.data
.vercel_build_output
.build-*
.netlify

# Tailwind
.www-frontend_temp/

# Linter caches
.eslintcache
.stylelintcache
# copied assets when preparing builds
apps/**/.storybook/static/dist
packages/**/src/assets/fonts

# logs
.log
# dist
dist
!packages/**/dist
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
4 changes: 0 additions & 4 deletions .parcelrc

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["bradlc.vscode-tailwindcss", "Vue.volar"]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"scss.lint.unknownAtRules": "ignore"
}
121 changes: 113 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,119 @@ ifneq (,)
This makefile requires GNU Make.
endif

storybook:
npm run storybook
NODE_VERSION ?= $(shell node --version)
NPM_VERSION ?= $(shell npm --version)
NVM_EXISTS := $(shell if [ -d "${HOME}/.nvm" ]; then echo "nvm installed"; fi)

storybook-update:
npx storybook@latest upgrade
TERM_TEXT := tput -Txterm
GREEN := $(shell $(TERM_TEXT) setaf 2)
YELLOW := $(shell $(TERM_TEXT) setaf 3)
RESET := $(shell $(TERM_TEXT) sgr0)
TARGET_MAX_CHAR_NUM := 23
.DEFAULT_GOAL := help

storybook-migrate:
npx storybook automigrate
nvm-use:
. ${HOME}/.nvm/nvm.sh && nvm use

storybook-doctor:
npx storybook automigrate
check-nvm:
ifndef NVM_EXISTS
@echo '$(YELLOW)Node Version Manager not found 😿$(RESET)'
@( read -p "$(YELLOW)Please install nvm: https://github.com/nvm-sh/nvm$(RESET)")
else
if [ -d "$(HOME)/.nvm/.git" ]; then echo "🚚 installing dependencies from $(YELLOW)package.json$(RESET)..."; fi
@echo ' --------------------'
@echo '📦 $(GREEN)Node Version Manager$(RESET)'
@echo ' $(YELLOW)node: $(NODE_VERSION)$(RESET)'
@echo ' $(YELLOW)npm: v$(NPM_VERSION)$(RESET)'
@echo '👀 looking for $(YELLOW).nvmrc$(RESET) file with expected node version...'
@make nvm-use
@echo '⏳ it can take a few minutes to install all of the $(YELLOW)node_modules$(RESET)'
@echo '🙆 this could be a good opportunity to have a stretch... '
@echo '⏭️ postinstall will check $(GREEN)workspaces$(RESET) with $(YELLOW)manypkg$(RESET)...'
endif

nvm:
make check-nvm && $(CMD)

## install dependencies
install: check-nvm
pnpm install

i: install

## HTML: run Storybook
html-storybook:
pnpm --filter @explorer-1/html-storybook dev

## HTML: run Vite
html-dev:
pnpm --filter @explorer-1/html dev

html: html-dev

## HTML: build assets
html-build:
pnpm --filter @explorer-1/html build

## Vue: run Storybook
vue-storybook:
pnpm --filter @explorer-1/vue-storybook dev

## Vue: run Vite
vue-dev:
pnpm --filter @explorer-1/vue dev

vue: vue-dev

## Vue: build assets
vue-build:
pnpm --filter @explorer-1/vue build

## Nuxt: run module playground
nuxt-dev:
pnpm --filter @explorer-1/nuxt dev

## Nuxt: build module
nuxt-build:
pnpm --filter @explorer-1/nuxt build

# TODO: Below helper commands not running as expected change dir first, then pnpm dlx...
# ## HTML: update Storybook
# html-storybook-update:
# pnpm --dir apps/html-storybook dlx storybook@latest upgrade --config-dir apps/html-storybook/.storybook

# ## HTML: run Storybook automigrations
# html-storybook-migrate:
# pnpm --dir apps/html-storybook dlx storybook automigrate --config-dir apps/html-storybook/.storybook

# ## HTML: check Storybook health
# html-storybook-doctor:
# pnpm --dir apps/html-storybook dlx storybook doctor --config-dir apps/html-storybook/.storybook

# ## Vue: update Storybook
# vue-storybook-update:
# pnpm --dir apps/vue-storybook dlx storybook@latest upgrade --config-dir apps/vue-storybook/.storybook

# ## Vue: run Storybook automigrations
# vue-storybook-migrate:
# pnpm --dir apps/vue-storybook dlx storybook automigrate --config-dir apps/vue-storybook/.storybook

# ## Vue: check Storybook health
# vue-storybook-doctor:
# pnpm --dir apps/vue-storybook dlx storybook doctor --config-dir apps/vue-storybook/.storybook

## General: Show Makefile help / View all commands @default make target
help:
@echo ''
@echo 'Makefile Usage:'
@echo ' ${GREEN}make${RESET} ${GREEN}[command]${RESET}'
@echo 'Available Commands:'
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
9 changes: 9 additions & 0 deletions apps/html-storybook/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
extends: ['eslint:recommended', 'plugin:storybook/recommended'],
parserOptions: {
ecmaVersion: 'latest'
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions apps/html-storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import remarkGfm from 'remark-gfm'

export default {
framework: {
name: '@storybook/html-vite',
options: {}
},

stories: [
// @explorer-1/html
'./../node_modules/@explorer-1/html/src/**/*.stories.@(js|ts)',
'./../node_modules/@explorer-1/html/src/**/*.docs.@(mdx|jsx)'
],

staticDirs: ['./../public'],

addons: [
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
actions: false
}
},
{
name: '@storybook/addon-docs',
options: {
mdxPluginOptions: {
mdxCompileOptions: {
remarkPlugins: [remarkGfm]
}
}
}
},
'@storybook/addon-a11y',
'@whitespace/storybook-addon-html'
],

core: {
disableTelemetry: true
},

docs: {}
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<style type="text/css">
/* styles for the storybook sidebar */
@import 'css/font-face.css';
@import 'dist/css/font-face.css';

.sidebar-item {
font-family: Metropolis, serif !important;
font-family: Metropolis, sans-serif !important;
line-height: 1.2rem !important;
display: flex !important;
align-items: center !important;
Expand Down
Loading
Loading