Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
logustra committed Mar 24, 2022
1 parent 2b7080e commit 52e94fa
Show file tree
Hide file tree
Showing 25 changed files with 5,071 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
'extends': [
'@antfu'
],
ignorePatterns: [
'node_modules/',
'dist/',
'coverage/',
'pnpm-lock.yaml',
'*.js'
]
}
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.1.0
with:
version: latest

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14.*
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint
45 changes: 45 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
push:
tags:
- v*

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.1.0
with:
version: latest

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14.*
registry-url: https://registry.npmjs.org/
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Generate a new github release
run: npx conventional-github-releaser -p angular
continue-on-error: true
env:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GIT_TOKEN }}

- name: Build package
run: pnpm build

- name: Publish package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.1.0
with:
version: latest

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14.*
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Generate code coverage
run: pnpm test

- name: Upload code coverage
uses: codecov/codecov-action@v2
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
coverage
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && npx cz --hook || true
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# vivu-npm
🧩 Simple starter template to build your own component library
## vivu-npm
[![Licence](https://img.shields.io/npm/l/@logustra/vountdown)](https://www.npmjs.com/package/@logustra/vountdown)
[![Code Style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli)

> Simple starter template to build component library for vue.js 2-3
18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [1, 'always', [
'feat',
'fix',
'docs',
'style',
'refactor',
'perf',
'test',
'build',
'ci',
'chore',
'revert'
]]
}
}
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vivu-npm</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion LICENSE → license.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Faizal Andyka
Copyright © 2022 Faizal Andyka

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
85 changes: 85 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"name": "@logustra/vivu-npm",
"version": "0.0.1",
"description": "Simple starter template to build component library for vue.js 2-3",
"keywords": [
"starter",
"boilerplate",
"vue",
"vue3",
"component",
"ui",
"frontend"
],
"license": "MIT",
"author": "Faizal Andyka",
"repository": {
"type": "git",
"url": "https://github.com/logustra/vivu-npm"
},
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"types": "./dist/types/index.d.ts",
"unpkg": "./dist/index.umd.js",
"jsdelivr": "./dist/index.umd.js",
"exports": {
".": {
"import": "./dist/index.es.js",
"require": "./dist/index.umd.js"
}
},
"files": [
"dist"
],
"bugs": "https://github.com/logustra/vivu-npm/issues",
"scripts": {
"prepare": "husky install",
"clean:dist": "rimraf dist",
"clean:coverage": "rimraf coverage",
"dev": "vite --mode dev",
"build": "pnpm clean:dist && vite build --mode prod && vue-tsc --emitDeclarationOnly",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "pnpm clean:coverage && vitest --coverage --mode test"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"peerDependencies": {
"@vue/composition-api": "^1.4.9",
"vue": "^2.0.0 || >=3.0.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
},
"dependencies": {
"vue-demi": "^0.12.1"
},
"devDependencies": {
"@antfu/eslint-config": "^0.18.9",
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@types/node": "^17.0.21",
"@vitejs/plugin-vue": "^2.2.0",
"c8": "^7.11.0",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.11.0",
"happy-dom": "^2.49.0",
"husky": "^7.0.4",
"rimraf": "^3.0.2",
"typescript": "^4.5.4",
"vite": "^2.8.0",
"vitest": "^0.7.6",
"vue": "^3.2.31",
"vue-tsc": "^0.29.8"
},
"volta": {
"node": "14.19.1"
}
}
Loading

0 comments on commit 52e94fa

Please sign in to comment.