Skip to content

Commit

Permalink
Merge pull request #131 from TaTo30/monorepo
Browse files Browse the repository at this point in the history
Monorepo
  • Loading branch information
TaTo30 authored Jul 23, 2024
2 parents d1fea8b + 6026625 commit 043fd01
Show file tree
Hide file tree
Showing 82 changed files with 5,777 additions and 10,834 deletions.
11 changes: 8 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
process.env.ESLINT_TSCONFIG = 'tsconfig.json'
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution")

module.exports = {
extends: '@antfu',
}
extends: [
'eslint:recommended',
'plugin:vue/vue3-essential',
'@vue/eslint-config-typescript'
]
}
4 changes: 1 addition & 3 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ jobs:
node-version: 18

- name: Install packages
working-directory: docs
run: npm install

- name: Build VitePress site
working-directory: docs
run: npm run docs:build
run: npm run build:docs

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
run: npm run build

- name: Publish packages
working-directory: packages/vue-pdf
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ node_modules
.ghpages
cache
temp
.vscode
playground/pdf/*
playground/samples/*
cjs
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img width=250 src="./docs/public/logo.png" />
<img width=250 src="./samples/logo.png" />
<h1>VuePDF</h1>
</div>

Expand Down Expand Up @@ -92,7 +92,7 @@ import { VuePDF, usePDF } from '@tato30/vue-pdf'
import '@tato30/vue-pdf/style.css'
const { pdf } = usePDF({
url: '/example_xfa.pdf',
url: '/xfa.pdf',
enableXfa: true,
})
</script>
Expand Down
193 changes: 100 additions & 93 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -1,218 +1,225 @@
import { version } from '../package.json'
import { resolve } from "node:path";
import { version } from '../../packages/vue-pdf/package.json';


export default {
vite: {
optimizeDeps: {
esbuildOptions: {
supported: {
'top-level-await': true,
"top-level-await": true,
},
},
},
build: {
target: 'esnext',
target: 'esnext'
},
resolve: {
alias: {
"@tato30/vue-pdf": resolve(__dirname, "../../packages/vue-pdf/dist")
},
},
},
title: 'VuePDF',
description: 'PDF component for Vue 3',
base: '/vue-pdf/',
title: "VuePDF",
description: "PDF component for Vue 3",
base: "/vue-pdf/",
lastUpdated: true,
head: [['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }]],
head: [["link", { rel: "icon", type: "image/png", href: "/logo.png" }]],
themeConfig: {
logo: '/logo.png',
logo: "/logo.png",
editLink: {
pattern: 'https://github.com/TaTo30/vue-pdf/edit/master/docs/:path',
pattern: "https://github.com/TaTo30/vue-pdf/edit/master/docs/:path",
},
socialLinks: [
{
icon: 'github',
link: 'https://github.com/TaTo30/vue-pdf',
icon: "github",
link: "https://github.com/TaTo30/vue-pdf",
},
],
search: {
provider: 'local',
provider: "local",
},
nav: [
{
text: 'Guide',
link: '/guide/introduction.md',
text: "Guide",
link: "/guide/introduction.md",
},
{
text: 'Examples',
text: "Examples",
items: [
{
text: 'Basic usages',
link: '/examples/basic/one_page.md',
text: "Basic usages",
link: "/examples/basic/one_page.md",
},
{
text: 'Advanced usages',
link: '/examples/advanced/watermark.md',
text: "Advanced usages",
link: "/examples/advanced/watermark.md",
},
{
text: 'Events',
link: '/examples/loaded_events/loaded.md',
text: "Events",
link: "/examples/loaded_events/loaded.md",
},
],
},
{
text: `v${version}`,
items: [
{
text: 'Changelog',
link: 'https://github.com/TaTo30/vue-pdf/releases',
text: "Changelog",
link: "https://github.com/TaTo30/vue-pdf/releases",
},
{
text: 'Contributing',
link: 'https://github.com/TaTo30/vue-pdf#contributing',
text: "Contributing",
link: "https://github.com/TaTo30/vue-pdf#contributing",
},
],
},
],
sidebar: {
'/guide/': {
base: '/guide/',
"/guide/": {
base: "/guide/",
items: [
{
text: 'Guide',
text: "Guide",
items: [
{
text: 'Introduction',
link: 'introduction',
text: "Introduction",
link: "introduction",
},
{
text: 'Composables',
link: 'composables',
text: "Composables",
link: "composables",
},
],
},
{
text: 'Reference',
text: "Reference",
items: [
{
text: 'Props',
link: 'props',
text: "Props",
link: "props",
},
{
text: 'Events',
link: 'events',
text: "Events",
link: "events",
},
{
text: 'Methods',
link: 'methods',
text: "Methods",
link: "methods",
},
{
text: 'Slots',
link: 'slots',
text: "Slots",
link: "slots",
},
],
},
],
},
'/examples/': {
"/examples/": {
items: [
{
text: 'Basic usages',
base: '/examples/basic/',
text: "Basic usages",
base: "/examples/basic/",
items: [
{
text: 'One Page',
link: 'one_page',
text: "One Page",
link: "one_page",
},
{
text: 'All Pages',
link: 'all_pages',
text: "All Pages",
link: "all_pages",
},
{
text: 'Scale',
link: 'scale',
text: "Scale",
link: "scale",
},
{
text: 'Rotation',
link: 'rotation',
text: "Rotation",
link: "rotation",
},
{
text: 'Text Layer',
link: 'text_layer',
text: "Text Layer",
link: "text_layer",
},
{
text: 'Annotation Layer',
link: 'annotation_layer',
text: "Annotation Layer",
link: "annotation_layer",
},
{
text: 'XFA Layer',
link: 'xfa_layer',
text: "XFA Layer",
link: "xfa_layer",
},
],
},
{
text: 'Advanced usages',
base: '/examples/advanced/',
text: "Advanced usages",
base: "/examples/advanced/",
items: [
{
text: 'Watermark',
link: 'watermark',
text: "Watermark",
link: "watermark",
},
{
text: 'Fit Parent',
link: 'fit_parent',
text: "Fit Parent",
link: "fit_parent",
},
{
text: 'Highlight Text',
link: 'highlight_text',
text: "Highlight Text",
link: "highlight_text",
},
{
text: 'Annotation Filter',
link: 'annotation_filter',
text: "Annotation Filter",
link: "annotation_filter",
},
{
text: 'Multiple PDF',
link: 'multiple_pdf',
text: "Multiple PDF",
link: "multiple_pdf",
},
{
text: 'Table of Content',
link: 'toc',
text: "Table of Content",
link: "toc",
},
],
},
{
text: 'Events',
base: '/examples/',
text: "Events",
base: "/examples/",
items: [
{
text: 'Loaded Event',
link: '/loaded_events/loaded',
text: "Loaded Event",
link: "/loaded_events/loaded",
},
{
text: 'Text Loaded Event',
link: '/loaded_events/text_loaded',
text: "Text Loaded Event",
link: "/loaded_events/text_loaded",
},
{
text: 'Annotation Loaded Event',
link: '/loaded_events/annotation_loaded',
text: "Annotation Loaded Event",
link: "/loaded_events/annotation_loaded",
},
{
text: 'XFA Loaded Event',
link: '/loaded_events/xfa_loaded',
text: "XFA Loaded Event",
link: "/loaded_events/xfa_loaded",
},
{
text: 'Highlight Event',
link: '/text_events/text_highlight',
text: "Highlight Event",
link: "/text_events/text_highlight",
},
{
text: 'Annotation Events',
base: '/examples/annotation_events/',
text: "Annotation Events",
base: "/examples/annotation_events/",
items: [
{
text: 'Form fields',
link: 'annotation_forms',
text: "Form fields",
link: "annotation_forms",
},
{
text: 'Links',
link: 'annotation_links',
text: "Links",
link: "annotation_links",
},
{
text: 'Attachment',
link: 'annotation_attachment',
text: "Attachment",
link: "annotation_attachment",
},
],
},
Expand All @@ -222,4 +229,4 @@ export default {
},
},
},
}
};
2 changes: 1 addition & 1 deletion docs/components/AnnoAttachment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { VuePDF, usePDF } from '@tato30/vue-pdf';
import { withBase } from 'vitepress/client';
import { ref } from 'vue';
const { pdf } = usePDF(withBase('/example_041.pdf'))
const { pdf } = usePDF(withBase('/41.pdf'))
const eventValue = ref({})
function onAnnotation(value) {
console.log(value)
Expand Down
Loading

0 comments on commit 043fd01

Please sign in to comment.