Skip to content

Commit

Permalink
feat: Vue 3 migration (#4)
Browse files Browse the repository at this point in the history
* pinned node version

* removed old project files

* bumped node version

* initial project structure with Vue 3

* export default CarbonBadge

* updated README instructions

* added logic back for user-defined dark mode prop

* added eslint & prettier

* linted CarbonBadge component file

* got rid of generated texts & styles

* linted rest of files

* fixed issue of Vue setting boolean to false if not specified as prop

* use short form of CarbonBadge tag in README instead
  • Loading branch information
niklashaug authored Mar 3, 2024
1 parent 363ee79 commit f19112b
Show file tree
Hide file tree
Showing 24 changed files with 2,407 additions and 26,835 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
env: {
node: true,
},
extends: ["eslint:recommended", "plugin:vue/vue3-recommended"],
};
23 changes: 12 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/extensions.json
!.vscode/extensions.json
.idea
.vscode
.DS_Store
*.suo
*.ntvs*
*.njsproj
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,21 @@ npm install vue-carbonbadge
yarn add vue-carbonbadge
```

## How To Use
**1. Import the package into your main.js file**
```js
import CarbonBadge from 'vue-carbonbadge'
Vue.use(CarbonBadge)
```
**2. Use it in your HTML markup**
```html
<footer>
<CarbonBadge></CarbonBadge>
</footer>
## Usage
```vue
<template>
<CarbonBadge />
</template>
<script setup>
import CarbonBadge from "vue-carbonbadge";
</script>
```
**3. You're done! 🎉**

## Customization
**Toggling dark mode**
```html
<CarbonBadge :dark="true"></CarbonBadge>
<CarbonBadge :dark="true" />
```

If the `dark` property is not specified, dark mode is detected as per user system preferences.
5 changes: 0 additions & 5 deletions babel.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>vue-carbonbadge</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit f19112b

Please sign in to comment.