Skip to content

Commit

Permalink
Bugfix/fix wrong home url (#50)
Browse files Browse the repository at this point in the history
* fix security alerts
* upgrade pnpm
* fix home link not returning to home when there is no site root
* refactor slightly the main page.
  • Loading branch information
pelletier197 authored May 6, 2022
1 parent 78beb08 commit da83fed
Show file tree
Hide file tree
Showing 21 changed files with 896 additions and 1,068 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@v2.2.1
with:
version: 6
version: 7
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@v2.2.1
with:
version: 6
version: 7
- name: Cache pnpm modules
uses: actions/cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@v2.2.1
with:
version: 6
version: 7
- name: Cache pnpm modules
uses: actions/cache@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "magidoc",
"version": "0.13.3",
"version": "0.13.4",
"description": "MagiDoc is a documentation website generator for GraphQL based on Svelte and that allows for infinite customization through plugins.",
"repository": "git@github.com:pelletier197/magidocql.git",
"author": "Sunny Pelletier",
Expand All @@ -9,7 +9,7 @@
"type": "module",
"scripts": {
"prepare": "husky install",
"build-ci": "pnpm -r --filter './packages/plugins' build && pnpm -r install --ignore-scripts --frozen-lockfile --strict-peer-dependencies && pnpm -r --filter '!./packages/plugins' build",
"build-ci": "pnpm -r --filter './packages/plugins/**' build && pnpm -r install --ignore-scripts --frozen-lockfile --strict-peer-dependencies && pnpm -r --filter '!./packages/plugins/**' build",
"test": "run-p test:*",
"test-ci": "run-s test:unit test:prettier",
"test:lint": "eslint '**/src/**/*.{ts,svelte}'",
Expand All @@ -25,11 +25,11 @@
"get-version": "echo $npm_package_version"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"archiver": "^5.3.1",
"eslint": "^8.14.0",
"eslint-plugin-svelte3": "^3.4.1",
"eslint-plugin-svelte3": "^4.0.0",
"husky": "^7.0.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
Expand Down
18 changes: 9 additions & 9 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@magidoc/cli",
"description": "Magidoc CLI application responsible for generating GraphQL documentation websites.",
"private": false,
"version": "0.13.3",
"version": "0.13.4",
"type": "module",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -24,9 +24,9 @@
"release": "pnpm publish --no-git-checks --access public"
},
"dependencies": {
"@magidoc/plugin-starter-variables": "workspace:^0.13.3",
"@magidoc/rollup-plugin-fetch-gql-schema": "workspace:^0.13.3",
"@magidoc/rollup-plugin-parse-gql-schema": "workspace:^0.13.3",
"@magidoc/plugin-starter-variables": "workspace:^0.13.4",
"@magidoc/rollup-plugin-fetch-gql-schema": "workspace:^0.13.4",
"@magidoc/rollup-plugin-parse-gql-schema": "workspace:^0.13.4",
"axios": "^0.27.2",
"chalk": "^5.0.1",
"commander": "^9.2.0",
Expand All @@ -35,18 +35,18 @@
"listr2": "^4.0.5",
"lodash": "^4.17.21",
"sirv": "^2.0.2",
"zod": "^3.14.4"
"zod": "^3.15.1"
},
"devDependencies": {
"@rollup/plugin-typescript": "^8.3.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.4.1",
"@types/jest": "^27.5.0",
"@types/lodash": "^4.14.182",
"jest": "^27.5.1",
"jest": "^28.1.0",
"jest-extended": "^2.0.0",
"rollup": "^2.71.1",
"rollup": "^2.72.0",
"rollup-plugin-preserve-shebang": "^1.0.1",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.1",
"tslib": "^2.4.0",
"typescript": "^4.6.4"
}
Expand Down
12 changes: 6 additions & 6 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magidoc/docs",
"version": "0.13.3",
"version": "0.13.4",
"license": "MIT",
"type": "module",
"keywords": [
Expand All @@ -17,11 +17,11 @@
"release": "gh-pages --dist build --dotfiles true"
},
"devDependencies": {
"@magidoc/plugin-svelte-carbon-commons": "workspace:^0.13.3",
"@magidoc/plugin-svelte-prismjs": "workspace:^0.13.3",
"@magidoc/plugin-svelte-carbon-commons": "workspace:^0.13.4",
"@magidoc/plugin-svelte-prismjs": "workspace:^0.13.4",
"@sveltejs/adapter-static": "^1.0.0-next.29",
"@sveltejs/kit": "^1.0.0-next.324",
"carbon-components-svelte": "^0.63.4",
"@sveltejs/kit": "^1.0.0-next.326",
"carbon-components-svelte": "^0.63.7",
"carbon-icons-svelte": "^11.0.1",
"carbon-preprocess-svelte": "^0.9.0",
"front-matter": "^4.0.2",
Expand All @@ -35,6 +35,6 @@
"svelte-preprocess": "^4.10.6",
"tslib": "^2.4.0",
"typescript": "^4.6.4",
"vite": "^2.9.6"
"vite": "^2.9.8"
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lib/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function createPages(

targets.forEach(({ path, contentFetcher: contentFetcher }) => {
const pathRegex = new RegExp(
`^(?:..\/)*(?:lib\/)(?:${PAGES_FOLDER}\/)(?:([0-9]+.[a-zA-Z0-9-]+)\/)*([0-9]+\.[a-zA-Z0-9-\()]+\.md)$`,
`^(?:..\/)*(?:lib\/)(?:${PAGES_FOLDER}\/)(?:([0-9]+.[a-zA-Z0-9-]+)\/)*([0-9]+\\.[a-zA-Z0-9-()]+\\.md)$`,
'g',
)

Expand Down
10 changes: 5 additions & 5 deletions packages/plugins/query-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@magidoc/plugin-query-generator",
"description": "A browser and nodeJS compatible plugin that allows to generate GraphQL Queries and Variables",
"private": false,
"version": "0.13.3",
"version": "0.13.4",
"type": "module",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -27,14 +27,14 @@
"prettier": "^2.6.2"
},
"devDependencies": {
"@types/jest": "^27.4.1",
"@types/jest": "^27.5.0",
"@types/lodash": "^4.14.182",
"@types/prettier": "^2.6.0",
"graphql-query-compress": "^1.2.4",
"jest": "^27.5.1",
"jest": "^28.1.0",
"jest-extended": "^2.0.0",
"rollup": "^2.71.1",
"ts-jest": "^27.1.4",
"rollup": "^2.72.0",
"ts-jest": "^28.0.1",
"typescript": "^4.6.4"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/plugins/reverse-schema-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@magidoc/plugin-reverse-schema-mapper",
"description": "A library that provides the ability to do a reverse lookup on GraphQL types.",
"private": false,
"version": "0.13.3",
"version": "0.13.4",
"type": "module",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -18,11 +18,11 @@
"graphql": "^16.4.0"
},
"devDependencies": {
"@types/jest": "^27.4.1",
"jest": "^27.5.1",
"@types/jest": "^27.5.0",
"jest": "^28.1.0",
"jest-extended": "^2.0.0",
"rollup": "^2.71.1",
"ts-jest": "^27.1.4",
"rollup": "^2.72.0",
"ts-jest": "^28.0.1",
"typescript": "^4.6.4"
},
"peerDependencies": {
Expand Down
11 changes: 6 additions & 5 deletions packages/plugins/rollup-fetch-gql-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@magidoc/rollup-plugin-fetch-gql-schema",
"description": "A Rollup and ViteJS plugin that allows to fetch a GraphQL Schema from a target URL and save it to a target output folder.",
"private": false,
"version": "0.13.3",
"version": "0.13.4",
"type": "module",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -26,13 +26,14 @@
"graphql": "^16.4.0"
},
"devDependencies": {
"@types/jest": "^27.4.1",
"@types/jest": "^27.5.0",
"@types/node": "^17.0.31",
"@types/prettier": "^2.6.0",
"jest": "^27.5.1",
"jest": "^28.1.0",
"jest-extended": "^2.0.0",
"nock": "^13.2.4",
"rollup": "^2.71.1",
"ts-jest": "^27.1.4",
"rollup": "^2.72.0",
"ts-jest": "^28.0.1",
"typescript": "^4.6.4"
}
}
11 changes: 6 additions & 5 deletions packages/plugins/rollup-parse-gql-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@magidoc/rollup-plugin-parse-gql-schema",
"description": "A Rollup and ViteJS plugin that allows to fetch a GraphQL Schema from a target URL and save it to a target output folder.",
"private": false,
"version": "0.13.3",
"version": "0.13.4",
"type": "module",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -26,12 +26,13 @@
"graphql": "^16.4.0"
},
"devDependencies": {
"@types/jest": "^27.4.1",
"@types/jest": "^27.5.0",
"@types/node": "^17.0.31",
"@types/prettier": "^2.6.0",
"jest": "^27.5.1",
"jest": "^28.1.0",
"jest-extended": "^2.0.0",
"rollup": "^2.71.1",
"ts-jest": "^27.1.4",
"rollup": "^2.72.0",
"ts-jest": "^28.0.1",
"typescript": "^4.6.4"
}
}
12 changes: 6 additions & 6 deletions packages/plugins/starter-variables/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@magidoc/plugin-starter-variables",
"description": "A shared library that contains common Magidoc starter environment variables keys.",
"private": false,
"version": "0.13.3",
"version": "0.13.4",
"type": "module",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -21,14 +21,14 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "^8.3.2",
"@types/jest": "^27.4.1",
"jest": "^27.5.1",
"rollup": "^2.71.1",
"ts-jest": "^27.1.4",
"@types/jest": "^27.5.0",
"jest": "^28.1.0",
"rollup": "^2.72.0",
"ts-jest": "^28.0.1",
"tslib": "^2.4.0",
"typescript": "^4.6.4"
},
"optionalDependencies": {
"zod": "^3.14.4"
"zod": "^3.15.1"
}
}
8 changes: 4 additions & 4 deletions packages/plugins/svelte-carbon-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A component library shared between Carbon templates.",
"type": "module",
"license": "MIT",
"version": "0.13.3",
"version": "0.13.4",
"svelte": "index.js",
"private": false,
"keywords": [
Expand All @@ -22,11 +22,11 @@
"release": "cd package && pnpm publish --no-git-checks --access public"
},
"devDependencies": {
"@magidoc/plugin-svelte-prismjs": "workspace:^0.13.3",
"@magidoc/plugin-svelte-prismjs": "workspace:^0.13.4",
"@sveltejs/adapter-auto": "^1.0.0-next.40",
"@sveltejs/kit": "^1.0.0-next.324",
"@sveltejs/kit": "^1.0.0-next.326",
"@types/prismjs": "^1.26.0",
"carbon-components-svelte": "^0.63.4",
"carbon-components-svelte": "^0.63.7",
"prismjs": "^1.28.0",
"svelte": "^3.48.0",
"svelte-check": "^2.7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/svelte-prismjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A Svelte component library providing an easy to use component to display PrismJS code blocks",
"type": "module",
"license": "MIT",
"version": "0.13.3",
"version": "0.13.4",
"svelte": "index.js",
"private": false,
"keywords": [
Expand All @@ -23,7 +23,7 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^1.0.0-next.40",
"@sveltejs/kit": "^1.0.0-next.324",
"@sveltejs/kit": "^1.0.0-next.326",
"@types/prismjs": "^1.26.0",
"prismjs": "^1.28.0",
"svelte": "^3.48.0",
Expand Down
22 changes: 11 additions & 11 deletions packages/starters/carbon-multi-page/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magidoc/starter-carbon-multi-page",
"version": "0.13.3",
"version": "0.13.4",
"license": "MIT",
"type": "module",
"keywords": [
Expand All @@ -19,26 +19,26 @@
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch"
},
"dependencies": {
"@magidoc/plugin-query-generator": "workspace:^0.13.3",
"@magidoc/plugin-svelte-prismjs": "workspace:^0.13.3",
"@magidoc/plugin-query-generator": "workspace:^0.13.4",
"@magidoc/plugin-svelte-prismjs": "workspace:^0.13.4",
"graphql": "^16.4.0",
"lodash": "^4.17.21"
},
"devDependencies": {
"@magidoc/plugin-starter-variables": "workspace:^0.13.3",
"@magidoc/plugin-svelte-carbon-commons": "workspace:^0.13.3",
"@magidoc/rollup-plugin-fetch-gql-schema": "workspace:^0.13.3",
"@magidoc/plugin-starter-variables": "workspace:^0.13.4",
"@magidoc/plugin-svelte-carbon-commons": "workspace:^0.13.4",
"@magidoc/rollup-plugin-fetch-gql-schema": "workspace:^0.13.4",
"@sveltejs/adapter-static": "^1.0.0-next.29",
"@sveltejs/kit": "^1.0.0-next.324",
"@sveltejs/kit": "^1.0.0-next.326",
"@types/lodash": "^4.14.182",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"carbon-components-svelte": "^0.63.4",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"carbon-components-svelte": "^0.63.7",
"carbon-icons-svelte": "^11.0.1",
"carbon-preprocess-svelte": "^0.9.0",
"eslint": "^8.14.0",
"eslint-plugin-svelte3": "^3.4.1",
"eslint-plugin-svelte3": "^4.0.0",
"prismjs": "^1.28.0",
"svelte": "^3.48.0",
"svelte-check": "^2.7.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/starters/carbon-multi-page/src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ type CustomContent = CustomPage | CustomSubMenu
declare global {
declare namespace App {
interface Stuff {
readonly homeUrl: string

readonly schema: GraphQLSchema

readonly content: CustomContent[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
export let isSideNavOpen = true
</script>

<Header href={base} bind:isSideNavOpen>
<Header href={base || '/'} bind:isSideNavOpen>
<div slot="platform" class="header-logo-wrapper">
<AppIcon class="header-logo" />
</div>
Expand Down
Loading

0 comments on commit da83fed

Please sign in to comment.