diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 944be3c93..5b96d573c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: ['12', '14', '16'] + node-version: ['16', '18'] os: [ubuntu-latest] steps: - name: Checkout diff --git a/gridsome/lib/pages/pages.js b/gridsome/lib/pages/pages.js index dee11e5c8..6831cdf75 100644 --- a/gridsome/lib/pages/pages.js +++ b/gridsome/lib/pages/pages.js @@ -457,7 +457,7 @@ class Route { this.internal = options.internal this.options = options - this.createPath = compile(options.path) + this.createPath = compile(options.path, { encode: encodeURIComponent }) Object.defineProperty(this, '_factory', { value: factory }) Object.defineProperty(this, '_pages', { value: factory._pages }) diff --git a/gridsome/lib/plugins/TemplatesPlugin.js b/gridsome/lib/plugins/TemplatesPlugin.js index 0303ce212..c88011129 100644 --- a/gridsome/lib/plugins/TemplatesPlugin.js +++ b/gridsome/lib/plugins/TemplatesPlugin.js @@ -82,7 +82,7 @@ const createTemplateOptions = (options, trailingSlash) => { templatePath = trimEnd(templatePath, '/') + '/' } - createPath = compile(templatePath) + createPath = compile(templatePath, { encode: encodeURIComponent }) pathToRegexp(templatePath, routeKeys) } diff --git a/gridsome/lib/serve.js b/gridsome/lib/serve.js index e03140f75..1932f61e8 100644 --- a/gridsome/lib/serve.js +++ b/gridsome/lib/serve.js @@ -54,7 +54,7 @@ function createRoutes (app) { return pages.map(page => { const keys = [] const regex = pathToRegexp(page.route, keys) - const toPath = compile(page.route) + const toPath = compile(page.route, { encode: encodeURIComponent }) return { regex, diff --git a/gridsome/package.json b/gridsome/package.json index 51814f1ea..14ec988e2 100644 --- a/gridsome/package.json +++ b/gridsome/package.json @@ -1,5 +1,5 @@ { - "version": "0.9.0", + "version": "0.9.1", "name": "@kriya/gridsome", "description": "A JAMstack framework for building blazing fast websites with Vue.js", "homepage": "https://gridsome.org", @@ -69,7 +69,7 @@ "mini-css-extract-plugin": "~1.6.2", "moment": "^2.29.4", "p-map": "~4.0.0", - "path-to-regexp": "^6.2.1", + "path-to-regexp": "~5.0.0", "physical-cpu-count": "^2.0.0", "portfinder": "^1.0.32", "postcss": "^8.4.32", diff --git a/packages/vue-remark/index.js b/packages/vue-remark/index.js index e9a7f3534..c63f7c6c9 100644 --- a/packages/vue-remark/index.js +++ b/packages/vue-remark/index.js @@ -124,7 +124,7 @@ class VueRemark { const routeKeys = [] pathToRegexp(this.route.path, routeKeys) - this.route.createPath = compile(this.route.path) + this.route.createPath = compile(this.route.path, { encode: encodeURIComponent }) this.route.routeKeys = normalizeRouteKeys(routeKeys) } diff --git a/packages/vue-remark/package.json b/packages/vue-remark/package.json index 9ad72be2f..f27fb6442 100644 --- a/packages/vue-remark/package.json +++ b/packages/vue-remark/package.json @@ -1,5 +1,5 @@ { - "version": "0.3.0", + "version": "0.3.1", "name": "@kriya/gridsome-vue-remark", "description": "Use Vue Components in Markdown", "homepage": "https://github.com/gridsome/gridsome/tree/master/packages/vue-remark#readme", @@ -30,13 +30,13 @@ "lru-cache": "^10.1.0", "mdast-util-to-hast": "~10.2.0", "moment": "^2.29.4", - "path-to-regexp": "^6.2.1", + "path-to-regexp": "~5.0.0", "unist-builder": "~2.0.3", "unist-util-visit": "~2.0.3", "vue-loader": "~15.11.1" }, "peerDependencies": { - "@kriya/gridsome": "^0.9.0" + "@kriya/gridsome": "^0.9.1" }, "publishConfig": { "access": "public" diff --git a/yarn.lock b/yarn.lock index a5c315428..d8ffbe229 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13803,10 +13803,10 @@ path-to-regexp@^2.4.0: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== -path-to-regexp@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.1.tgz#d54934d6798eb9e5ef14e7af7962c945906918e5" - integrity sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw== +path-to-regexp@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-5.0.0.tgz#e56dd58778b9dc06e76f0f3e39e741bbddc0bd26" + integrity sha512-VOQVA+0mivusQfaveeWlrW7ddXKuStHMTdovn/1epf7cEpUL4dpzGl7eq8ho96H9w90/q66yJLsqn84jSCfkmQ== path-type@^1.0.0: version "1.1.0"