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

Migrate to vue 3 + vite / vitest / vitepress for building #3565

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
073491d
Use vite instead of webpack for building the library
susnux Nov 27, 2022
74ae111
Move from jest to vitest for better integration with vite
susnux Nov 27, 2022
bdc5a3d
Move to vue-doc-gen + vitepress instead of styleguide
susnux Nov 27, 2022
8b17cc4
Upgrade cypress to version 11.2.0 to work with vite
susnux Nov 27, 2022
7e8d4b7
Beaking change: Only build one entrypoint
susnux Nov 27, 2022
1223608
Fix lint issues
susnux Dec 4, 2022
0a04055
Fix netlify build until its configuration is updated
susnux Dec 5, 2022
bc230c6
Migrate to vue 3
raimund-schluessler Apr 2, 2022
31117fd
Fix remaining merge issues
susnux Dec 6, 2022
80c4cbd
Fix styleguide + documentation examples for vue3
susnux Dec 6, 2022
6714bd9
Fix eslint errors
raimund-schluessler Dec 12, 2022
d402cd5
Add missing export for NcTimezonePicker
susnux Dec 12, 2022
8afd17b
vue3: Fix `NcColorPicker` for vue 3 compatibility
susnux Dec 12, 2022
8d1f8ff
Fix vue-live layout for NcContent examples
susnux Dec 12, 2022
d72e846
Adjust visual tests CSS import path + Fix assets path
raimund-schluessler Dec 13, 2022
6923e11
Inject process env on build
susnux Dec 14, 2022
387e21c
Fix deprecated title usage in NcAppNavigationItem
raimund-schluessler Jan 11, 2023
a105803
Fix lint warnings
raimund-schluessler Jan 11, 2023
5663c71
fix: vitepress documentation build | update dependencies
susnux Jan 30, 2023
f86181a
Fix NcActions inline action rendering
raimund-schluessler Jan 30, 2023
6127d9e
Run npm install
raimund-schluessler Jan 30, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ coverage

# genereated file
docs/components
docs/.vitepress

# Docs compiled build
styleguide/*
Expand Down
5 changes: 2 additions & 3 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import * as path from "path";
import * as fs from 'fs'
import { fileURLToPath } from "url";
import { defineConfig } from "vitepress";
// Not supported with vite4, wait for next release "vitepress-plugin-search": "^1.0.4-alpha.16",
// import { SearchPlugin } from 'vitepress-plugin-search'
import { SearchPlugin } from 'vitepress-plugin-search'
import PackageJSON from '../../package.json'
import vueLiveMd from './vue-live-md-it.mjs'

Expand Down Expand Up @@ -100,7 +99,7 @@ export default defineConfig({

outDir: '../styleguide',
vite: {
plugins: [vueDocsPlugin /*, SearchPlugin()*/],
plugins: [vueDocsPlugin, SearchPlugin()],
},

markdown: {
Expand Down
6 changes: 3 additions & 3 deletions docs/.vitepress/theme/components/vue-live-with-layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h, onMounted, ref, defineComponent } from "vue"
import { h, onMounted, ref, defineComponent, markRaw } from "vue"
import { VueLive } from "vue-live";
import layout from "./vue-live-layout.vue";

Expand All @@ -9,13 +9,13 @@ export default defineComponent({
const props = {...attrs}
onMounted(async () => {
const NcComponents = (await import('../../../../dist/index.esm.js')).NcComponents
props.components = markRaw({...NcComponents})
if ("requires" in props) {
props.requires = {}
props.requires = markRaw({})
await Promise.allSettled(Object.keys(attrs.requires).map(async (key) => {
props.requires[key] = (await attrs.requires[key]).default
}))
}
props.components = {...NcComponents}
ready.value = true
})
// return the render function
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/vue-live-md-it.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function addVueLive(md, opts) {
// put all requires into a "requires" object
// add this as a prop
const imports = getImports(code)
const requires = imports.map(mod => `'${mod[1]}': import('../../node_modules/${mod[1]}${mod[1].startsWith('vue-material-design') ? '.vue' : ''}')`)
const requires = imports.map(mod => `"${mod[1]}": import("../../node_modules/${mod[1]}${mod[1].startsWith('vue-material-design') ? '.vue' : ''}")`)
const langArray = lang.split(' ')
const langClean = langArray[0]
const codeClean = md.utils.escapeHtml(code).replace(/\`/g, '\\`').replace(/\$/g, '\\$')
Expand All @@ -34,7 +34,7 @@ function addVueLive(md, opts) {
const markdownGenerated = `<vue-live ${jsx}
:layoutProps="{lang:'${langClean}'}"
:code="\`${codeClean}\`"
:requires="{${requires.join(',')}}"
:requires='{${requires.join(',')}}'
${editorProps ? ` :editorProps="${editorProps}"` : ''}
/>`
return markdownGenerated
Expand Down
Loading