@md-plugins/quasar-app-extension-q-press 0.1.0-beta.0 → 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,9 @@ The Ultimate Markdown Solution for the Quasar Framework.
4
4
 
5
5
  See the [documentation](https://md-plugins.netlify.app/quasar-app-extensions/qpress/overview) for more information.
6
6
 
7
- > Q-Press currently targets Quasar Vite projects using `@quasar/app-vite` `^3.0.0-beta.12`. TypeScript processing is required.
7
+ > Current beta release: `0.1.0-beta.1`.
8
+ >
9
+ > Q-Press currently targets Quasar Vite projects using `@quasar/app-vite` `>=3.0.0-beta.14`. TypeScript processing is required.
8
10
 
9
11
  ## Features
10
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@md-plugins/quasar-app-extension-q-press",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.0-beta.1",
4
4
  "description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
5
5
  "keywords": [
6
6
  "markdown",
@@ -21,6 +21,7 @@
21
21
  "url": "git+https://github.com/md-plugins/md-plugins.git"
22
22
  },
23
23
  "type": "module",
24
+ "main": "src/index.ts",
24
25
  "publishConfig": {
25
26
  "access": "public"
26
27
  },
@@ -28,29 +29,32 @@
28
29
  "@types/markdown-it": "^14.1.2",
29
30
  "fs-extra": "^11.3.4",
30
31
  "markdown-it": "^14.1.1",
31
- "@md-plugins/md-plugin-blockquote": "0.1.0-beta.0",
32
- "@md-plugins/md-plugin-containers": "0.1.0-beta.0",
33
- "@md-plugins/md-plugin-codeblocks": "0.1.0-beta.0",
34
- "@md-plugins/md-plugin-frontmatter": "0.1.0-beta.0",
35
- "@md-plugins/md-plugin-image": "0.1.0-beta.0",
36
- "@md-plugins/md-plugin-headers": "0.1.0-beta.0",
37
- "@md-plugins/md-plugin-imports": "0.1.0-beta.0",
38
- "@md-plugins/md-plugin-link": "0.1.0-beta.0",
39
- "@md-plugins/md-plugin-inlinecode": "0.1.0-beta.0",
40
- "@md-plugins/md-plugin-table": "0.1.0-beta.0",
41
- "@md-plugins/md-plugin-title": "0.1.0-beta.0",
42
- "@md-plugins/shared": "0.1.0-beta.0",
43
- "@md-plugins/vite-md-plugin": "0.1.0-beta.0"
32
+ "@md-plugins/md-plugin-blockquote": "0.1.0-beta.1",
33
+ "@md-plugins/md-plugin-codeblocks": "0.1.0-beta.1",
34
+ "@md-plugins/md-plugin-frontmatter": "0.1.0-beta.1",
35
+ "@md-plugins/md-plugin-image": "0.1.0-beta.1",
36
+ "@md-plugins/md-plugin-imports": "0.1.0-beta.1",
37
+ "@md-plugins/md-plugin-headers": "0.1.0-beta.1",
38
+ "@md-plugins/md-plugin-inlinecode": "0.1.0-beta.1",
39
+ "@md-plugins/md-plugin-containers": "0.1.0-beta.1",
40
+ "@md-plugins/md-plugin-table": "0.1.0-beta.1",
41
+ "@md-plugins/md-plugin-link": "0.1.0-beta.1",
42
+ "@md-plugins/shared": "0.1.0-beta.1",
43
+ "@md-plugins/md-plugin-title": "0.1.0-beta.1",
44
+ "@md-plugins/vite-md-plugin": "0.1.0-beta.1"
44
45
  },
45
46
  "devDependencies": {
47
+ "@quasar/app-vite": "3.0.0-beta.14",
46
48
  "@types/markdown-it": "^14.1.2",
47
49
  "vite": "^8.0.3"
48
50
  },
49
51
  "peerDependencies": {
52
+ "@quasar/app-vite": ">=3.0.0-beta.14",
50
53
  "markdown-it": "^14.1.0"
51
54
  },
52
55
  "engines": {
53
- "node": ">=20"
56
+ "node": ">=22.13",
57
+ "pnpm": ">=11.1.0"
54
58
  },
55
59
  "scripts": {
56
60
  "build": "node ./scripts/build.js",
package/src/index.ts ADDED
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Quasar App Extension index/runner script
3
+ * (runs on each dev/build)
4
+ *
5
+ * Docs: https://quasar.dev/app-extensions/development-guide/index-api
6
+ */
7
+
8
+ import { defineIndexScript } from '@quasar/app-vite'
9
+
10
+ // import fse from 'fs-extra'
11
+ // import { viteMdPlugin } from '@md-plugins/vite-md-plugin'
12
+
13
+ export default defineIndexScript((api) => {
14
+ // verify this is a Vite project
15
+ if (!api.hasVite) {
16
+ throw new Error('This extension requires Vite')
17
+ }
18
+
19
+ api.compatibleWith('quasar', '^2.0.0')
20
+ api.compatibleWith('@quasar/app-vite', '>=3.0.0-beta.14')
21
+
22
+ // here we extend /quasar.config, so we can add some Vite/Vue stuff
23
+ api.extendQuasarConf(async (config) => {
24
+ config.build ??= {}
25
+ config.build.viteVuePluginOptions ??= {}
26
+ config.framework ??= {}
27
+
28
+ // make sure 'vueRouterMode' has 'history' mode
29
+ if (config.build.vueRouterMode !== 'history') {
30
+ console.warn('Changing vueRouterMode to "history" - required for hash links to work correctly')
31
+ config.build.vueRouterMode = 'history'
32
+ }
33
+
34
+ // let Vite know to transpile md files
35
+ const include = config.build.viteVuePluginOptions.include
36
+ if (Array.isArray(include)) {
37
+ include.push(/\.(vue|md)$/)
38
+ }
39
+ else if (include !== void 0) {
40
+ config.build.viteVuePluginOptions.include = [include, /\.(vue|md)$/]
41
+ }
42
+ else {
43
+ config.build.viteVuePluginOptions.include = [/\.(vue|md)$/]
44
+ }
45
+
46
+ // let Vue know to auto import md files
47
+ const extensions = new Set(config.framework.autoImportVueExtensions || [])
48
+ extensions.add('md')
49
+ extensions.add('vue')
50
+ config.framework.autoImportVueExtensions = Array.from(extensions)
51
+
52
+ // add the appropriate plugins
53
+ const plugins = new Set(config.framework.plugins || [])
54
+ plugins.add('Cookies')
55
+ plugins.add('Dark')
56
+ plugins.add('Meta')
57
+ plugins.add('Notify')
58
+ config.framework.plugins = Array.from(plugins)
59
+
60
+ // const markdownPath = api.resolve.src('markdown')
61
+ // const path = api.resolve.src('siteConfig')
62
+ // if (fse.pathExistsSync(path) && fse.pathExistsSync(markdownPath)) {
63
+ // const siteConfig = await import(path)
64
+ // const { sidebar } = siteConfig.default || siteConfig
65
+
66
+ // // add vite-md-plugin to quasar.config.js
67
+ // config.vite.plugins.push(viteMdPlugin({ path: markdownPath, menu: sidebar }))
68
+ // }
69
+ })
70
+ })
@@ -4,16 +4,17 @@
4
4
  * Docs: https://quasar.dev/app-extensions/development-guide/install-api
5
5
  */
6
6
 
7
- import fse from 'fs-extra'
7
+ import { defineInstallScript } from '@quasar/app-vite'
8
+ import { existsSync } from 'node:fs'
8
9
 
9
- export default async function (api) {
10
+ export default defineInstallScript(async (api) => {
10
11
  // verify this is a Vite project
11
12
  if (!api.hasVite) {
12
13
  throw new Error('This extension requires Vite')
13
14
  }
14
15
 
15
16
  api.compatibleWith('quasar', '^2.0.0')
16
- api.compatibleWith('@quasar/app-vite', '^3.0.0-beta.12')
17
+ api.compatibleWith('@quasar/app-vite', '>=3.0.0-beta.14')
17
18
 
18
19
  // project must have pinia installed
19
20
  if ((await api.getStorePackageName()) !== 'pinia') {
@@ -32,17 +33,18 @@ export default async function (api) {
32
33
  }
33
34
 
34
35
  const path = api.resolve.src('siteConfig')
35
- if (fse.pathExistsSync(path)) {
36
+ if (existsSync(path)) {
36
37
  // this is an update scenario
37
38
  console.warn('-------------------------------------')
38
39
  console.warn("Update only for 'src/.q-press' folder")
39
40
  console.warn('-------------------------------------')
40
41
  api.render('./templates/update')
41
- } else {
42
+ }
43
+ else {
42
44
  // this is a project initial setup
43
45
  console.warn('--------------------------------------------')
44
46
  console.warn('Initial setup. Be sure to read the\ndocumentation on the manual set up required.')
45
47
  console.warn('--------------------------------------------')
46
48
  api.render('./templates/init')
47
49
  }
48
- }
50
+ })
@@ -20,12 +20,16 @@ const internal = computed(
20
20
 
21
21
  <style lang="scss">
22
22
  .markdown-link {
23
- color: $brand-primary;
23
+ color: scale-color($brand-primary, $lightness: -35%);
24
24
  text-decoration: none;
25
25
  border-bottom: 1px dotted currentColor;
26
26
  outline: 0;
27
27
  transition: color $header-quick-transition;
28
28
 
29
+ body.body--dark & {
30
+ color: $brand-primary;
31
+ }
32
+
29
33
  &:hover {
30
34
  color: inherit !important;
31
35
  }
@@ -82,7 +82,7 @@ ul {
82
82
  line-height: $font-size;
83
83
  border-radius: $generic-border-radius;
84
84
  font-family: inherit;
85
- color: $brand-primary;
85
+ color: scale-color($brand-primary, $lightness: -35%);
86
86
  vertical-align: baseline;
87
87
  border: 1px solid currentColor;
88
88
  }
@@ -107,14 +107,14 @@ ul {
107
107
  // .markdown-note__title,
108
108
  .markdown-link,
109
109
  .markdown-token {
110
- color: $brand-primary;
110
+ color: scale-color($brand-primary, $lightness: -35%);
111
111
  }
112
112
  .markdown-token {
113
- border-color: $brand-primary;
113
+ border-color: scale-color($brand-primary, $lightness: -35%);
114
114
  }
115
115
  & strong {
116
116
  font-weight: 700;
117
- color: scale-color($brand-light-text, $lightness: 90%);
117
+ color: inherit;
118
118
  }
119
119
  }
120
120
 
@@ -132,7 +132,7 @@ ul {
132
132
  }
133
133
  & strong {
134
134
  font-weight: 700;
135
- color: scale-color($positive, $lightness: 90%);
135
+ color: inherit;
136
136
  }
137
137
  }
138
138
 
@@ -150,7 +150,7 @@ ul {
150
150
  }
151
151
  & strong {
152
152
  font-weight: 700;
153
- color: scale-color($warning, $lightness: 90%);
153
+ color: inherit;
154
154
  }
155
155
  }
156
156
 
@@ -169,7 +169,7 @@ ul {
169
169
 
170
170
  & strong {
171
171
  font-weight: 700;
172
- color: scale-color($negative, $lightness: 90%);
172
+ color: inherit;
173
173
  }
174
174
  }
175
175
 
@@ -598,6 +598,9 @@ body.body--dark {
598
598
  border-color: #ddd;
599
599
  color: #ddd;
600
600
  }
601
+ .markdown-link {
602
+ color: $brand-primary;
603
+ }
601
604
  }
602
605
 
603
606
  &--tip {
@@ -7,17 +7,19 @@ related:
7
7
  - vite-plugins/vite-md-plugin/overview
8
8
  ---
9
9
 
10
- The `0.1.0` beta line moves MD-Plugins and Q-Press to the Quasar CLI Vite 3 beta toolchain. It is the right version to use when your Quasar application is being upgraded to `@quasar/app-vite` `^3.0.0-beta.12`.
10
+ The `0.1.0` beta line moves MD-Plugins and Q-Press to the Quasar CLI Vite 3 beta toolchain. It is the right version to use when your Quasar application is being upgraded to `@quasar/app-vite` `>=3.0.0-beta.14`.
11
11
 
12
12
  ::: warning
13
- Q-Press and the Quasar app extensions now target Quasar Vite projects using `@quasar/app-vite` `^3.0.0-beta.12`. They are not intended for Webpack projects or JavaScript-only Quasar projects.
13
+ Q-Press and the Quasar app extensions now target Quasar Vite projects using `@quasar/app-vite` `>=3.0.0-beta.14`. They are not intended for Webpack projects or JavaScript-only Quasar projects.
14
14
  :::
15
15
 
16
16
  ## Before You Upgrade
17
17
 
18
18
  - Make sure your app is already on a Quasar Vite setup.
19
- - Upgrade the app to `@quasar/app-vite` `^3.0.0-beta.12` or newer in the same beta line.
19
+ - Upgrade the app to `@quasar/app-vite` `>=3.0.0-beta.14`.
20
20
  - Use TypeScript in the consuming Quasar project.
21
+ - Import `defineConfig` in `quasar.config.ts` directly from `@quasar/app-vite`.
22
+ - Use `/// <reference types="@quasar/app-vite/client" />` in `src/env.d.ts`.
21
23
  - Commit or stash local changes before invoking Q-Press, because the update flow can overwrite files in `src/.q-press`.
22
24
 
23
25
  ## Update Packages
@@ -6,7 +6,7 @@ desc: Q-Press App-Extension for Quasar.
6
6
  The Q-Press App Extension is a powerful tool for Quasar developers that simplifies the integration of Markdown content into Quasar applications. It leverages the capabilities of Vite and various Markdown plugins to transform Markdown files into Vue components, enabling a seamless and efficient workflow for content management.
7
7
 
8
8
  ::: warning
9
- Q-Press is for Quasar Vite projects using `@quasar/app-vite` `^3.0.0-beta.12` at this time. TypeScript processing is also required. Do not use if you are using Webpack or have a JavaScript-only project.
9
+ Q-Press is for Quasar Vite projects using `@quasar/app-vite` `>=3.0.0-beta.14` at this time. TypeScript processing is also required. Do not use if you are using Webpack or have a JavaScript-only project.
10
10
  :::
11
11
 
12
12
  ::: tip
@@ -68,15 +68,9 @@ npm i prismjs
68
68
 
69
69
  ## Configuration
70
70
 
71
- ### Modify `tsconfig.json`
71
+ ### Verify `tsconfig.json`
72
72
 
73
- Add the `resolveJsonModule: true` to your `tsconfig.json` file in your root folder:
74
-
75
- ```json
76
- "compilerOptions": {
77
- "resolveJsonModule": true
78
- }
79
- ```
73
+ Quasar CLI Vite 3 already generates a `tsconfig.json` with JSON module support. If you are migrating an older app, run `quasar prepare` after upgrading so the generated TypeScript config is refreshed.
80
74
 
81
75
  ### Modify `src/css/quasar.variables.scss`
82
76
 
@@ -99,7 +93,7 @@ Import Q-Press styles:
99
93
  ### Modify `quasar.config.ts`
100
94
 
101
95
  ```ts [maxheight=400px]
102
- import { defineConfig } from '#q-app'
96
+ import { defineConfig } from '@quasar/app-vite'
103
97
  import type { Plugin } from 'vite'
104
98
  import { viteMdPlugin, type MenuItem, type MarkdownOptions } from '@md-plugins/vite-md-plugin'
105
99
 
@@ -9,7 +9,7 @@ related:
9
9
  The `viteMdPluginAppExt` is a [Quasar App Extension](https://quasar.dev/app-extensions/introduction) that integrates the `viteMdPlugin` into your Quasar project. This extension allows you to use Markdown files as Vue components, enabling a seamless integration of Markdown content into your Quasar application.
10
10
 
11
11
  ::: warning
12
- This app extension targets Quasar Vite projects using `@quasar/app-vite` `^3.0.0-beta.12`.
12
+ This app extension targets Quasar Vite projects using `@quasar/app-vite` `>=3.0.0-beta.14`.
13
13
  :::
14
14
 
15
15
  ## Key Features
@@ -20,12 +20,16 @@ const internal = computed(
20
20
 
21
21
  <style lang="scss">
22
22
  .markdown-link {
23
- color: $brand-primary;
23
+ color: scale-color($brand-primary, $lightness: -35%);
24
24
  text-decoration: none;
25
25
  border-bottom: 1px dotted currentColor;
26
26
  outline: 0;
27
27
  transition: color $header-quick-transition;
28
28
 
29
+ body.body--dark & {
30
+ color: $brand-primary;
31
+ }
32
+
29
33
  &:hover {
30
34
  color: inherit !important;
31
35
  }
@@ -82,7 +82,7 @@ ul {
82
82
  line-height: $font-size;
83
83
  border-radius: $generic-border-radius;
84
84
  font-family: inherit;
85
- color: $brand-primary;
85
+ color: scale-color($brand-primary, $lightness: -35%);
86
86
  vertical-align: baseline;
87
87
  border: 1px solid currentColor;
88
88
  }
@@ -107,14 +107,14 @@ ul {
107
107
  // .markdown-note__title,
108
108
  .markdown-link,
109
109
  .markdown-token {
110
- color: $brand-primary;
110
+ color: scale-color($brand-primary, $lightness: -35%);
111
111
  }
112
112
  .markdown-token {
113
- border-color: $brand-primary;
113
+ border-color: scale-color($brand-primary, $lightness: -35%);
114
114
  }
115
115
  & strong {
116
116
  font-weight: 700;
117
- color: scale-color($brand-light-text, $lightness: 90%);
117
+ color: inherit;
118
118
  }
119
119
  }
120
120
 
@@ -132,7 +132,7 @@ ul {
132
132
  }
133
133
  & strong {
134
134
  font-weight: 700;
135
- color: scale-color($positive, $lightness: 90%);
135
+ color: inherit;
136
136
  }
137
137
  }
138
138
 
@@ -150,7 +150,7 @@ ul {
150
150
  }
151
151
  & strong {
152
152
  font-weight: 700;
153
- color: scale-color($warning, $lightness: 90%);
153
+ color: inherit;
154
154
  }
155
155
  }
156
156
 
@@ -169,7 +169,7 @@ ul {
169
169
 
170
170
  & strong {
171
171
  font-weight: 700;
172
- color: scale-color($negative, $lightness: 90%);
172
+ color: inherit;
173
173
  }
174
174
  }
175
175
 
@@ -598,6 +598,9 @@ body.body--dark {
598
598
  border-color: #ddd;
599
599
  color: #ddd;
600
600
  }
601
+ .markdown-link {
602
+ color: $brand-primary;
603
+ }
601
604
  }
602
605
 
603
606
  &--tip {
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "../../tsconfig.base.json",
4
+ "compilerOptions": {
5
+ "esModuleInterop": true,
6
+ "lib": ["esnext", "dom", "dom.iterable"],
7
+ "module": "preserve",
8
+ "moduleDetection": "force",
9
+ "moduleResolution": "bundler",
10
+ "noEmit": true,
11
+ "skipLibCheck": true,
12
+ "target": "esnext"
13
+ },
14
+ "include": ["./src/index.ts", "./src/install.ts"],
15
+ "exclude": ["./node_modules"]
16
+ }
package/src/index.js DELETED
@@ -1,61 +0,0 @@
1
- /**
2
- * Quasar App Extension index/runner script
3
- * (runs on each dev/build)
4
- *
5
- * Docs: https://quasar.dev/app-extensions/development-guide/index-api
6
- */
7
-
8
- // import fse from 'fs-extra'
9
- // import { viteMdPlugin } from '@md-plugins/vite-md-plugin'
10
-
11
- async function extendConfig(config /*, api*/) {
12
- // console.log('config', config)
13
- // console.log('api', api)
14
-
15
- // make sure 'vueRouterMode' has 'history' mode
16
- if (config.build.vueRouterMode !== 'history') {
17
- console.warn('Changing vueRouterMode to "history" - required for hash links to work correctly')
18
- config.build.vueRouterMode = 'history'
19
- }
20
-
21
- // let Vite know to transpile md files
22
- config.build.viteVuePluginOptions.include = config.build.viteVuePluginOptions.include || []
23
- config.build.viteVuePluginOptions.include.push(/\.(vue|md)$/)
24
-
25
- // let Vue know to auto import md files
26
- const extensions = new Set(config.framework.autoImportVueExtensions || [])
27
- extensions.add('md')
28
- extensions.add('vue')
29
- config.framework.autoImportVueExtensions = Array.from(extensions)
30
-
31
- // add the appropriate plugins
32
- const plugins = new Set(config.framework.plugins || [])
33
- plugins.add('Cookies')
34
- plugins.add('Dark')
35
- plugins.add('Meta')
36
- plugins.add('Notify')
37
- config.framework.plugins = Array.from(plugins)
38
-
39
- // const markdownPath = api.resolve.src('markdown')
40
- // const path = api.resolve.src('siteConfig')
41
- // if (fse.pathExistsSync(path) && fse.pathExistsSync(markdownPath)) {
42
- // const siteConfig = await import(path)
43
- // const { sidebar } = siteConfig.default || siteConfig
44
-
45
- // // add vite-md-plugin to quasar.config.js
46
- // config.vite.plugins.push(viteMdPlugin({ path: markdownPath, menu: sidebar }))
47
- // }
48
- }
49
-
50
- export default function (api) {
51
- // verify this is a Vite project
52
- if (!api.hasVite) {
53
- throw new Error('This extension requires Vite')
54
- }
55
-
56
- api.compatibleWith('quasar', '^2.0.0')
57
- api.compatibleWith('@quasar/app-vite', '^3.0.0-beta.12')
58
-
59
- // here we extend /quasar.config, so we can add some Vite/Vue stuff
60
- api.extendQuasarConf(extendConfig)
61
- }