Skip to content

Commit 4c0a6e7

Browse files
cooper667hrynko
andauthored
Switch to Vite (#153)
* fix: Remove webpack and vue2 support * fix: Remove webpack and vue2 support fix: prettier fix: prettier chore: Update Readme * fix: copy types to package * Update package.json Co-authored-by: Aliaksei Hrynko <[email protected]> * Update package-lock.json Co-authored-by: Aliaksei Hrynko <[email protected]> * fix: tidy up build and versions * chore: move some bits around * chore: apply patch * [PATCH] Merge remote-tracking branch 'upstream/develop' * [PATCH] Merge remote-tracking branch 'upstream/develop' * fix: apply patch * chore: fix readme --------- Co-authored-by: Aliaksei Hrynko <[email protected]>
1 parent 4430386 commit 4c0a6e7

25 files changed

+3279
-11668
lines changed

.babelrc

-3
This file was deleted.

.eslintrc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"env": {
3-
"node": true
2+
"extends": ["eslint:recommended", "plugin:vue/vue3-essential", "prettier"],
3+
"parserOptions": {
4+
"ecmaVersion": "latest"
45
},
5-
"extends": ["eslint:recommended", "plugin:vue/essential", "prettier"],
66
"plugins": ["prettier"],
77
"rules": {
88
"prettier/prettier": "warn"

.github/workflows/publish-to-npm.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v2
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
1414
with:
15-
node-version: 14
15+
node-version: 18
1616
registry-url: https://registry.npmjs.org/
1717
- run: npm ci
1818
- run: npm publish

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.DS_Store
22
node_modules
3-
/dist
3+
dist
44

55
# Local env files
66
.env.local

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
npx lint-staged --concurrent false

.lintstagedrc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"*.{js,vue}": [
3-
"npm run lint"
4-
]
2+
"*.{js,vue}": "eslint --fix",
3+
"*": "prettier --write"
54
}

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ We use [GitHub issues](https://github.com/hrynko/vue-pdf-embed/issues) to report
1111
All code changes happen through [pull requests](https://github.com/hrynko/vue-pdf-embed/pulls). We actively welcome your features and fixes. Please provide a detailed description of the changes made and link them to [issues](https://github.com/hrynko/vue-pdf-embed/issues), if any.
1212

1313
## License
14+
1415
By contributing, you agree that your contribution will be licensed under the [MIT License](LICENSE).

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 📄 vue-pdf-embed
22

3-
PDF embed component for Vue 2 and Vue 3
3+
PDF embed component for Vue 3 and Vue 2 (see [Compatibility](#compatibility))
44

55
[![Awesome](https://raw.githubusercontent.com/sindresorhus/awesome/main/media/mentioned-badge.svg)](https://github.com/vuejs/awesome-vue)
66
[![npm](https://img.shields.io/npm/v/vue-pdf-embed)](https://npmjs.com/package/vue-pdf-embed)
@@ -19,22 +19,22 @@ PDF embed component for Vue 2 and Vue 3
1919

2020
## Compatibility
2121

22-
This package is compatible with both Vue 2 and Vue 3, but consists of two separate builds. The default exported build is for Vue 3, for Vue 2 import `dist/vue2-pdf-embed.js` (see [Usage](#usage)).
22+
This package is only compatible with Vue 3, to support Vue 2 install `vue-pdf-embed@1` and discover [the v1 docs](https://github.com/hrynko/vue-pdf-embed/tree/v1).
2323

2424
## Installation
2525

2626
Depending on the environment, the package can be installed in one of the following ways:
2727

2828
```shell
29-
npm install vue-pdf-embed@1
29+
npm install vue-pdf-embed
3030
```
3131

3232
```shell
33-
yarn add vue-pdf-embed@1
33+
yarn add vue-pdf-embed
3434
```
3535

3636
```html
37-
<script src="https://unpkg.com/vue-pdf-embed@1"></script>
37+
<script src="https://unpkg.com/vue-pdf-embed"></script>
3838
```
3939

4040
## Usage
@@ -53,9 +53,6 @@ yarn add vue-pdf-embed@1
5353
<script>
5454
import VuePdfEmbed from 'vue-pdf-embed'
5555
56-
// OR THE FOLLOWING IMPORT FOR VUE 2
57-
// import VuePdfEmbed from 'vue-pdf-embed/dist/vue2-pdf-embed'
58-
5956
export default {
6057
components: {
6158
VuePdfEmbed,

demo/main.js

-8
This file was deleted.

demo/App.vue renamed to dev/App.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<template>
2-
<div>
3-
<vue-pdf-embed
4-
:image-resources-path="annotationIconsPath"
5-
:source="pdfSource"
6-
/>
7-
</div>
2+
<VuePdfEmbed
3+
:image-resources-path="annotationIconsPath"
4+
:source="pdfSource"
5+
/>
86
</template>
97

108
<script>
@@ -16,7 +14,7 @@ export default {
1614
},
1715
data() {
1816
return {
19-
annotationIconsPath: '/node_modules/pdfjs-dist/web/images/',
17+
annotationIconsPath: '../node_modules/pdfjs-dist/web/images/',
2018
pdfSource:
2119
'data:application/pdf;base64,' +
2220
'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxv' +
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
6-
<title>vue-pdf-embed demo</title>
5+
<meta name="viewport" content="width=device-width,initial-scale=1" />
6+
<title>vue-pdf-embed</title>
77
</head>
88
<body>
99
<div id="app"></div>
10+
<script type="module" src="./main.js"></script>
1011
</body>
1112
</html>

dev/main.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { createApp } from 'vue'
2+
3+
import App from './App.vue'
4+
5+
createApp(App).mount('#app')

jest.config.json

-6
This file was deleted.

0 commit comments

Comments
 (0)