Skip to content

Commit

Permalink
feat: build system converted to esbuild (#109)
Browse files Browse the repository at this point in the history
* feat: build system converted to esbuild

esbuild is way faster and give good options for publishing ES Modules.

This commit also includes changes for using CSS files for component styles and having Rubik fpnt
locally via fontsource library.

* ci: build project before storybook deployment

* ci: action worklows are unified

* ci: github actions workflow rearrenged

Co-authored-by: Murat Çorlu <murat.corlu@trendyol.com>

Fixes #65 , #104, #102
  • Loading branch information
muratcorlu authored May 16, 2022
1 parent 2429123 commit 4a24e65
Show file tree
Hide file tree
Showing 28 changed files with 2,007 additions and 4,951 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/chromatic.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/github-actions.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/lint.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/pull-request.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/verify-and-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Verify and Preview'

on:
pull_request:
branches: [ next ]
push:
branches: [ next ]

jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set Node env
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Run linter check
run: npm run lint
- name: Set testing environment
uses: microsoft/playwright-github-action@v1
- name: Run tests
run: npm run test

chromatic-deployment:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Node env
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Build Grace
run: npm run build
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
11 changes: 6 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
test/
coverage/
jest.config.js
storybook-static/
.loki/
docs/
.github
.husky
.storybook
*.mdx
*.test.ts
10 changes: 10 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require('path');

module.exports = {
logLevel: 'debug',
stories: [
Expand All @@ -17,4 +19,12 @@ module.exports = {
buildStoriesJson: true,
},
framework: '@storybook/web-components',
webpackFinal: async config => {
const gracePath = path.join(__dirname, '..', 'dist');
config.resolve.alias['@trendyol-js/grace'] = path.resolve(
gracePath,
'grace.js'
);
return config;
},
};
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { setCustomElementsManifest } from '@storybook/web-components';
import customElements from '../src/custom-elements.json';
import '../src/themes/default.css';
import '../dist/themes/default.css';

setCustomElementsManifest(customElements);

Expand Down
3 changes: 1 addition & 2 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"extends": "stylelint-config-standard",
"customSyntax": "postcss-lit"
"extends": ["stylelint-config-standard", "stylelint-config-prettier"]
}
8 changes: 0 additions & 8 deletions dev/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions dev/index.html

This file was deleted.

20 changes: 0 additions & 20 deletions grace.config.js

This file was deleted.

Loading

0 comments on commit 4a24e65

Please sign in to comment.