Skip to content

Commit

Permalink
Merge pull request #16 from aliefprihantoro/v2
Browse files Browse the repository at this point in the history
try finish but still bug in storybook
  • Loading branch information
aliefprihantoro authored Dec 9, 2024
2 parents 8e9489d + 8449180 commit 4ed79ed
Show file tree
Hide file tree
Showing 82 changed files with 1,851 additions and 334 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "Chromatic"

on:
push:
branches:
- master
paths:
- 'src/**/*.ts'
- '!src/**/*.d.ts'
- 'src/**/*.css'
- 'tailwind.config.mjs'
- 'postcss.config.cjs'
- 'astro.config.mjs'
workflow_dispatch:
inputs:
my_input:
description: 'testing e2e'
required: true

jobs:
install:
name: Install Project
permissions:
contents: write
discussions: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
build:
name: Build Project
needs: install
runs-on: ubuntu-latest
steps:
- name: build blogger template
run: pnpm build
- name: build storybook
run: pnpm build-storybook
- uses: montudor/action-zip@v1
with:
args: zip -qq -r storybook-static.zip storybook-static
released:
name: Released Project
needs: build
runs-on: ubuntu-latest
steps:
- name: Release with Notes
uses: softprops/action-gh-release@v2
with:
files: |
dist/blogger.xml
storybook-static.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 6 additions & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
pull_request:
paths:
- 'src/view/**'
workflow_dispatch:
inputs:
my_input:
description: 'testing e2e'
required: true

jobs:
chromatic:
Expand All @@ -29,4 +34,4 @@ jobs:
uses: chromaui/action@latest
with:
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: e2e test

on:
workflow_dispatch:
inputs:
my_input:
description: 'storybook'
required: true
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install playwright browsers
run: pnpx playwright install --with-deps
- name: Run Playwright tests
run: pnpm playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
17 changes: 17 additions & 0 deletions .github/workflows/osv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: OSV-Scanner Scheduled Scan

on:
schedule:
- cron: "30 12 * * 1"
push:
branches: [master]

permissions:
# Require writing security events to upload SARIF file to security tab
security-events: write
# Only need to read contents
contents: read

jobs:
scan-scheduled:
uses: "google/osv-scanner-action/.github/workflows/[email protected]"
21 changes: 21 additions & 0 deletions .github/workflows/pagespeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Chromatic"

on:
workflow_dispatch:
inputs:
my_input:
description: 'pagespeed'
required: true

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Running Page Speed Insights
uses: jakepartusch/[email protected]
id: psi
with:
url: "https://serabingampinbuyuni.biz.id/?m=1"
threshold: 70
key: ${{ secrets.APIKEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ pnpm-debug.log*
# jetbrains setting folder
.idea/
build-storybook.log
out/
storybook-static
4 changes: 2 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config: Targs.StorybookConfig = {
plugins: [
ViteMurypJsLiteral({
minify: {
html: true,
html: false,
},
}),
],
Expand All @@ -31,4 +31,4 @@ const config: Targs.StorybookConfig = {
autodocs: 'tag',
},
}
export default config
export default config
2 changes: 1 addition & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../src/assets/css/main.css'
import '../src/assets/css/main/init.css'
import '../src/assets/css/fonts.css'
import { withThemeByDataAttribute } from '@storybook/addon-themes'
import { DocsPage } from '@storybook/addon-docs/blocks'
Expand Down
5 changes: 0 additions & 5 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import { defineConfig } from 'astro/config'
import { murypAstroMinify } from '@muryp/vite-html'

import tailwind from '@astrojs/tailwind'

// https://astro.build/config
export default defineConfig({
vite: {
Expand All @@ -14,9 +12,6 @@ export default defineConfig({
},
},
integrations: [
tailwind({
nesting: true,
}),
murypAstroMinify({
minify: {
css: false,
Expand Down
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default [
},
{
...Lit.configs['flat/recommended'],
files: ['./src/view/**/*.ts'],
rules: {
'lit/no-template-map': 'error',
'lit/no-invalid-html': 'error',
Expand All @@ -51,4 +52,4 @@ export default [
'lit/quoted-expressions': ['error', 'always'],
},
},
]
]
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"dev": "astro build",
"start": "astro dev",
"lint": "eslint ./src/**/*.ts",
"build": "lint && astro check && astro build",
"build": "pnpm lint && astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"story:dev": "storybook dev -p 6006 --no-open",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token=chpt_4489abe6c8eefcd"
"build-storybook": "storybook build"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@muryp/vite-html": "^1.0.6",
"@storybook/addon-console": "^3.0.0",
"astro": "^4.16.12",
"esbuild": "^0.24.0",
"typescript": "^5.6.3"
},
"devDependencies": {
"@astrojs/tailwind": "^5.1.2",
"@chromatic-com/storybook": "^1.9.0",
"@eslint/js": "^9.15.0",
"@muryp/vite-html": "^1.0.8",
Expand Down Expand Up @@ -49,6 +48,8 @@
"eslint-plugin-lit": "^1.15.0",
"eslint-plugin-lit-a11y": "1.1.0-next.1",
"globals": "^15.12.0",
"postcss": "^8.4.49",
"postcss-import": "^16.1.0",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.13.0",
"prop-types": "^15.8.1",
Expand Down
Loading

0 comments on commit 4ed79ed

Please sign in to comment.