Skip to content

Commit

Permalink
add repo
Browse files Browse the repository at this point in the history
  • Loading branch information
linspw committed Feb 7, 2024
1 parent 5fee584 commit 1a54929
Show file tree
Hide file tree
Showing 24 changed files with 1,421 additions and 398 deletions.
19 changes: 1 addition & 18 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,7 @@
"tsx": "never"
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true,
"packageDir": [
".",
"./packages/shared",
"./packages/utils",
"./packages/whiteboard",
"./packages/agile-board",
"./packages/grid",
"./packages/views",
"./packages/docs",
"./packages/playground/frontend",
"./packages/playground/backend"
]
}
],
"import/no-extraneous-dependencies": "off",
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down
77 changes: 57 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,64 @@
name: Release - CI
name: Release

on:
push:
branches:
- master
workflow_dispatch:
types:
- manual-trigger
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions: write-all

jobs:
release:
release:
name: Job Release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.13.1'
cache: 'yarn'
- run: yarn install
- run: yarn build:lib
- run: yarn test:unit
- run: yarn test:package
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.15.0

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.12
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build library
run: pnpm build

# Deploy Pages
- uses: actions/configure-pages@v2
- uses: actions/upload-pages-artifact@v1
with:
path: docs/.vitepress/dist
- name: Deploy
id: deployment
uses: actions/deploy-pages@v1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?

# vitepress build output
docs/.vitepress/dist
docs/.vitepress/cache
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,34 @@ providing visual components to facilitate the development of your application.

```
# If you use npm:
npm i @hyone/core-ui
npm i @linspw/experiment-ui
# Or if you use Yarn:
yarn add @hyone/core-ui
yarn add @linspw/experiment-ui
# Or if you use pnpm:
pnpm add @linspw/experiment-ui
```

### Use

After installing, add CoreUI to your vue instance.
After installing, add ExperimentUI to your vue instance.

- In main js:
- In main js/ts:

```js
```ts
import { createApp } from 'vue';
import { CoreUI } from '@hyone/core-ui';
import { ExperimentUI } from '@linspw/experiment-ui';
import App from './app.vue';

createApp
.use(CoreUI)
.use(ExperimentUI)
.mount('#root');
```

- In template:

```html
```vue
<template>
<h-button>My button</h-button>
</template>
Expand Down
36 changes: 18 additions & 18 deletions configs/project/alias-config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
const path = require('path');
import { join, resolve } from "path";

const baseUrl = path.join(__dirname, '..', '..');
const baseUrl = join(__dirname, "..", "..");

exports.alias = {
'@': path.resolve(baseUrl, 'src'),
'@root': path.resolve(baseUrl),
'@api': path.resolve(baseUrl, 'src/api'),
'@assets': path.resolve(baseUrl, 'src/assets'),
'@styles': path.resolve(baseUrl, 'src/styles'),
'@components': path.resolve(baseUrl, 'src/components'),
'@composables': path.resolve(baseUrl, 'src/composables'),
'@layouts': path.resolve(baseUrl, 'src/layouts'),
'@modules': path.resolve(baseUrl, 'src/modules'),
'@pages': path.resolve(baseUrl, 'src/pages'),
'@plugins': path.resolve(baseUrl, 'src/plugins'),
'@router': path.resolve(baseUrl, 'src/router'),
'@services': path.resolve(baseUrl, 'src/services'),
'@settings': path.resolve(baseUrl, 'configs', 'settings'),
'@utils': path.resolve(baseUrl, 'src/utils'),
export const alias = {
"@": resolve(baseUrl, "src"),
"@root": resolve(baseUrl),
"@api": resolve(baseUrl, "src/api"),
"@assets": resolve(baseUrl, "src/assets"),
"@styles": resolve(baseUrl, "src/styles"),
"@components": resolve(baseUrl, "src/components"),
"@composables": resolve(baseUrl, "src/composables"),
"@layouts": resolve(baseUrl, "src/layouts"),
"@modules": resolve(baseUrl, "src/modules"),
"@pages": resolve(baseUrl, "src/pages"),
"@plugins": resolve(baseUrl, "src/plugins"),
"@router": resolve(baseUrl, "src/router"),
"@services": resolve(baseUrl, "src/services"),
"@settings": resolve(baseUrl, "configs", "settings"),
"@utils": resolve(baseUrl, "src/utils"),
};
6 changes: 3 additions & 3 deletions configs/tests/lib.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import * as Library from '@root/dist/lib/core-ui.umd';

describe('Lib Test', () => {
it('builded with correct objects', () => {
expect(Library).toHaveProperty('CoreUI');
expect(Library).toHaveProperty('CoreUIComponents');
expect(Library).toHaveProperty('ExperimentUI');
expect(Library).toHaveProperty('ExperimentUIComponents');
// const { html } = render(Library);
// expect(html()).toMatchSnapshot();
});
Expand All @@ -25,7 +25,7 @@ describe('Lib Test', () => {

const vueInstanceConfig = {
global: {
plugins: [Library.CoreUI],
plugins: [Library.ExperimentUI],
},
container: document.body.appendChild(root),
};
Expand Down
45 changes: 45 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { defineConfig } from 'vitepress'
import { alias } from "../../configs/project/alias-config";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Experiment UI",
description: "Experiment UI - UI Library write for Vue 3",
base: "/experiment-ui/",
head: [
[
'script',
{
src: 'https://kit.fontawesome.com/1e91b4a459.js'
}
],
],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Components', link: '/components/index.md' }
],

sidebar: [
{
text: 'Components',
link: '/components/index.md',
items: [
{ text: 'Atoms', items: [{ text: 'Button', link: '/components/atoms/button.md' }] },
{ text: 'Molecules' },
{ text: 'Organism' },
]
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
]
},
vite: {
resolve: {
alias,
},
}
})
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from 'vitepress/theme'
import '@styles/index.scss'

export default DefaultTheme
Binary file added docs/components/atom-design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1a54929

Please sign in to comment.