Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(update): replaced examples with packages #79

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
},
"extends": [
"@nuxtjs",
"plugin:nuxt/recommended"
"plugin:nuxt/recommended",
"prettier"
],
"plugins": [
"prettier"
],
"plugins": [],
"rules": {
"prettier/prettier": "error",
"semi": [
2,
"always"
],
"vue/multi-word-component-names": "off"
}
}
}
70 changes: 18 additions & 52 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:

jobs:
install:
if: "!contains(github.event.head_commit.message, 'skip ci')"
if: contains(github.event.head_commit.message, 'skip ci') == false
name: Install
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]
node: [19]

steps:
- uses: actions/setup-node@v3
Expand All @@ -27,14 +27,12 @@ jobs:
with:
path: |
node_modules
~/.cache/ms-playwright/
~\AppData\Local\ms-playwright\
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Test
run: npm run test
run: npm run test --workspaces

semantic-version:
name: Semantic Release
Expand All @@ -44,7 +42,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [16]
node: [19]

steps:
- uses: actions/setup-node@v3
Expand All @@ -68,7 +66,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [16]
node: [19]

steps:
- uses: actions/setup-node@v3
Expand All @@ -82,70 +80,38 @@ jobs:
with:
path: |
node_modules
~/.cache/ms-playwright/
~\AppData\Local\ms-playwright\
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
- name: Build

- name: BuildDefault
run: |
npm run generate -- examples/default
touch dist/.nojekyll
npm run generate --workspace=@nuxt-custom-elements-example/default
env:
BASE_URL: /nuxt-custom-elements-example/
DIST_PATH: ../../dist

# tailwind-css
- name: BuildTailwindCss
- name: BuildTailwindCSS
run: |
npm run generate -- examples/tailwind-css
unlink dist/tailwind-css/.nojekyll
npm run generate --workspace=@nuxt-custom-elements-example/tailwindcss
env:
BASE_URL: /nuxt-custom-elements-example/tailwind-css/
DIST_PATH: ../../dist/tailwind-css
BASE_URL: /nuxt-custom-elements-example/tailwindcss/
DIST_PATH: ../../dist/tailwindcss

# vuetify
- name: BuildVuetify
run: |
npm run generate -- examples/vuetify
unlink dist/vuetify/.nojekyll
npm run generate --workspace=@nuxt-custom-elements-example/vuetify
env:
BASE_URL: /nuxt-custom-elements-example/vuetify/
DIST_PATH: ../../dist/vuetify

# vue-i18n
- name: BuildVueI18n
run: |
npm run generate -- examples/vue-i18n
unlink dist/vue-i18n/.nojekyll
env:
BASE_URL: /nuxt-custom-elements-example/vue-i18n/
DIST_PATH: ../../dist/vue-i18n

# vue-router
- name: BuildVueRouter
run: |
npm run generate -- examples/vue-router
unlink dist/vue-router/.nojekyll
env:
BASE_URL: /nuxt-custom-elements-example/vue-router/
DIST_PATH: ../../dist/vue-router

# vuex
- name: BuildVuex
# pinia
- name: BuildPinia
run: |
npm run generate -- examples/vuex
unlink dist/vuex/.nojekyll
npm run generate --workspace=@nuxt-custom-elements-example/pinia
env:
BASE_URL: /nuxt-custom-elements-example/vuex/
DIST_PATH: ../../dist/vuex

# external
- name: BuildExternal
run: |
npm run generate -- examples/external
unlink dist/external/.nojekyll
env:
BASE_URL: /nuxt-custom-elements-example/external/
DIST_PATH: ../../dist/external
DIST_PATH: ../../dist/pinia

- name: Archive Production Artifact
uses: actions/upload-artifact@master
Expand All @@ -160,7 +126,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [16]
node: [19]
steps:
- name: Download Artifact
uses: actions/download-artifact@master
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [14, 16]
node: [19]

steps:
- uses: actions/setup-node@v3
Expand All @@ -27,13 +27,11 @@ jobs:
with:
path: |
node_modules
~/.cache/ms-playwright/
~\AppData\Local\ms-playwright\
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: Test
run: npm run test
run: npm run test --workspaces
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ sw.*
*.swp

.history
.output
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"*.(js|vue)": [
"npm run lint:es"
"npm run test --workspaces"
]
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
19.9.0
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"trailingComma": "none",
"singleQuote": true,
"semi": true,
"printWidth": 80
}
9 changes: 9 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Common
node_modules
dist
.nuxt
coverage
.reports

# Files
**/*.js
20 changes: 11 additions & 9 deletions .stylelintrc.json → .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
"stylelint-config-recess-order"
],
"customSyntax": "postcss-html",
"ignoreFiles": [
"./**/*.js"
],
"plugins": [
"stylelint-prettier"
],
"rules": {
"max-line-length": null,
"prettier/prettier": true,
"value-keyword-case": [
"lower",
{
"camelCaseSvgKeywords": true
}
],
"at-rule-no-unknown": [
"selector-pseudo-class-no-unknown": [
true,
{
"ignoreAtRules": [
"tailwind",
"apply",
"variants",
"responsive",
"screen"
"ignorePseudoClasses": [
"deep"
]
}
]
}
}
}
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Nuxt Custom-Elements Example

This is an example project for using [Nuxt Custom-Elements](https://github.com/GrabarzUndPartner/nuxt-custom-elements) with [Nuxt.js](https://nuxtjs.org) and plugins ([VueI18n](https://kazupon.github.io/vue-i18n/), [Vuetify](https://vuetifyjs.com/), ...).
This is an example project for using [Nuxt Custom-Elements](https://github.com/GrabarzUndPartner/nuxt-custom-elements) with [Nuxt.js](https://nuxtjs.org) and plugins ([VueI18n](https://kazupon.github.io/vue-i18n/), [Vuetify](https://vuetifyjs.com/), ...).

For more information, see the [Usage section](https://nuxt-custom-elements.grabarzundpartner.dev/usage/) in the documentation.


- [👁   **Preview**](https://grabarzundpartner.github.io/nuxt-custom-elements-example/)
- [📖   **Documentation**](http://nuxt-custom-elements.grabarzundpartner.dev/)

Expand All @@ -13,38 +12,38 @@ For more information, see the [Usage section](https://nuxt-custom-elements.graba
First of all, the repository must be cloned and install dependencies with

```bash
$ npm install
npm install
```

Each example can be started in `dev`, `server` and `ssr`.
For this the path to the example must be given as argument (e.g. `npm run dev -- examples/default`).
For this the path to the example must be given as workspace (e.g. `npm run dev --workspace=@nuxt-custom-elements-example/default`).

The path specification must be specified in `dev`, `build`, `generate` and `start`.

**Available examples:**

| Path | |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `examples/tailwind-css` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/tailwind-css/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/examples/tailwind-css) |
| `examples/vue-i18n` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/vue-i18n/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/examples/vue-i18n) |
| `examples/vue-router` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/vue-router/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/examples/vue-router) |
| `examples/vuetify` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/vuetify/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/examples#:~:text=last%20month-,vuetify,-fix(update)%3A%20update) |
| `examples/vuex` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/vuex/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/examples/vuex) |
| `examples/external` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/external/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/examples/external) |
| Path | |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pinia` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/pinia/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/packages/pinia) |
| `tailwindcss` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/tailwindcss/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/packages/tailwindcss) |
| `vuetify` | [Preview](https://grabarzundpartner.github.io/nuxt-custom-elements-example/vuetify/) - [Source](https://github.com/GrabarzUndPartner/nuxt-custom-elements-example/tree/main/packages/vuetify) |

### Development

```
$ npm run dev -- examples/default
npm run dev --workspace=@nuxt-custom-elements-example/default
```

### Server

```
$ npm run build -- examples/default && npm run start -- examples/default
npm run build --workspace=@nuxt-custom-elements-example/default && npm run start --workspace=@nuxt-custom-elements-example/default
```

### Static

```
$ npm run generate -- examples/default --target static && npm run start -- examples/default --target static
npm run generate --workspace=@nuxt-custom-elements-example/default --target static && npm run start --workspace=@nuxt-custom-elements-example/default --target static
```

Finally, the example can be opened in the browser via [http://localhost:3000/]( http://localhost:3000/).
Expand Down
4 changes: 1 addition & 3 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
extends: [
'@commitlint/config-conventional'
]
extends: ['@commitlint/config-conventional']
};
Binary file removed examples/default/assets/icons/i18n.png
Binary file not shown.
Binary file removed examples/default/assets/icons/vue.png
Binary file not shown.
60 changes: 0 additions & 60 deletions examples/default/nuxt.config.js

This file was deleted.

Loading