-
Notifications
You must be signed in to change notification settings - Fork 5
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
Deps update #149
Draft
adrianschmidt
wants to merge
55
commits into
main
Choose a base branch
from
deps-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Deps update #149
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
a63268b
chore: rename `typedoc.ts` to `typedoc-generator.ts`
adrianschmidt 8d89205
fix(package.json): update values of `main` and `module` properties
adrianschmidt 48978e5
chore(package): update typedoc from v0.17.8 to v0.18.0
adrianschmidt bb8a4c7
chore(package): downgrade typescript from v4.7.4 to v4.0.8 for compat…
adrianschmidt 8f55b6d
chore(package): update typedoc from v0.18.0 to v0.19.2
adrianschmidt 482b6bf
test(typedoc-generator): add smaller test cases
adrianschmidt 08b22b6
chore(package): update typedoc from v0.19.2 to v0.20.0
adrianschmidt b398113
refactor(typedoc-generator): update typedoc-generator.ts for compatib…
adrianschmidt cfe9b9f
chore(package): update typescript from v4.0.8 to v4.1.6
adrianschmidt bfe7d5c
chore(package): update typedoc from v0.20.0 to v0.20.16
adrianschmidt 997d041
tmp: add logging
adrianschmidt 69c8a1b
style(typedoc-generator): move getDocs and getDocsTags functions for …
adrianschmidt 9dd80b9
chore(package): update typedoc from v0.20.16 to v0.20.17
adrianschmidt dc1cda2
chore(package): update typedoc to v0.23.20 and typescript to v4.8.4
adrianschmidt 85b913c
chore(package): update @stencil/core to v2.22.3 and @stencil/sass to …
adrianschmidt 623680a
refactor(scss): replace "slash as division" with `math.div()`
adrianschmidt 04a74f4
test(fixtures): correct capitalization of `@inheritDoc`
adrianschmidt b9e73df
fix broken build
adrianschmidt 2c803ad
improve logging
adrianschmidt 501ab27
enum test working
adrianschmidt 0b3d504
partway on simple class test
adrianschmidt 14232de
test(typedoc-generator): change value of `@foobar` blockTag to avoid …
adrianschmidt b4187d6
test(typedoc-generator): consecutive line breaks are now conserved
adrianschmidt 4d9bc4f
test(typedoc-generator): typedoc no longer supports decorators
adrianschmidt d4161f5
refactor(typedoc-generator): update typedoc-generator.ts for compatib…
adrianschmidt f8a1bbd
just some logging changes
adrianschmidt 4bd5eb6
chore(package): update typedoc from v0.23.20 to v0.23.28
adrianschmidt ede5b29
chore(package): update typedoc from v0.23.28 to v0.24.8
adrianschmidt 5ccb51f
chore(package): update typedoc from v0.24.8 to v0.25.13
adrianschmidt c489c7b
fixup! chore(package): update typedoc from v0.23.28 to v0.24.8
adrianschmidt e771610
make stuff async as required by typedoc v0.25.13
adrianschmidt 11fc73e
chore(package): update typescript from v4.8.4 to v5.4.5
adrianschmidt 1b2523b
just logging changes
adrianschmidt d82baff
some refactoring to fit typedoc v0.25.13
adrianschmidt 5997a4a
chore(package): update typedoc from v0.25.13 to v0.26.8
adrianschmidt b331a5e
chore(package): update typescript from v5.4.5 to v5.6.3
adrianschmidt f3b6c61
chore(package): update @stencil/core from v2.22.3 to v4.22.1
adrianschmidt 2ed6baa
chore(package): update @stencil/sass from v1.5.2 to v3.0.12
adrianschmidt c887e8d
fixup! chore(package): update @stencil/core from v2.22.3 to v4.22.1
adrianschmidt d76fc04
chore(package): update dependencies on jest, jest-cli, and puppeteer
adrianschmidt e1a19c4
chore(package): get tests to run with updated dependencies
adrianschmidt 1673e09
chore(typedoc-generator): allow `@sourceFile` block tags
adrianschmidt 0be3538
fix getReturns
adrianschmidt 7a4e7bd
almost there
adrianschmidt f64dcf4
version that correctly gets param and return tags for methods using i…
adrianschmidt 07d44c9
fixup! refactor(scss): replace "slash as division" with `math.div()`
adrianschmidt e7eb57b
a bunch of refactoring
adrianschmidt fba585f
increase logging
adrianschmidt ecac99a
all test are PASSING!!!
adrianschmidt 66c3d7d
chore(package): update @stencil/core from v4.22.1 to v4.22.2
adrianschmidt 5bb45f1
chore(package): update typedoc from v0.26.8 to v0.26.11
adrianschmidt ad2e8fa
WIP
jgroth 7a03d39
routing works
adrianschmidt 3666493
docs(code): add descriptions to the code component and its example
adrianschmidt 40aef1d
add some console logging for debugging purposes
adrianschmidt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { Component, FunctionalComponent, h, Prop, State } from '@stencil/core'; | ||
import { URLPattern } from 'urlpattern-polyfill'; | ||
|
||
type MatchedComponent = { | ||
name: string; | ||
props?: Record<string, string | number>; | ||
}; | ||
|
||
type RoutedComponent = { | ||
path: string; | ||
name: string; | ||
props?: Record<string, string | number>; | ||
}; | ||
|
||
const ComponentTemplate: FunctionalComponent<MatchedComponent> = ( | ||
props, | ||
children, | ||
) => { | ||
const Name = props.name; | ||
|
||
return <Name {...props.props}>{children}</Name>; | ||
}; | ||
|
||
@Component({ | ||
tag: 'kompendium-router', | ||
shadow: true, | ||
}) | ||
export class Router { | ||
@Prop() | ||
public routes: RoutedComponent[]; | ||
|
||
@State() | ||
private matchedComponent: MatchedComponent | undefined; | ||
|
||
private hashChangeHandler = () => { | ||
this.setMatchedComponent(window.location); | ||
}; | ||
|
||
public componentWillLoad() { | ||
// Set it once now | ||
this.setMatchedComponent(window.location); | ||
} | ||
|
||
public componentDidLoad() { | ||
// Listen for subsequent changes | ||
window.addEventListener('hashchange', this.hashChangeHandler); | ||
} | ||
|
||
public disconnectedCallback() { | ||
// Clean up | ||
window.removeEventListener('hashchange', this.hashChangeHandler); | ||
} | ||
|
||
public render() { | ||
if (!this.matchedComponent) { | ||
return '404'; | ||
} | ||
|
||
return <ComponentTemplate {...this.matchedComponent} />; | ||
} | ||
|
||
private setMatchedComponent(location: Location) { | ||
const component = this.findComponent(location); | ||
|
||
if (component !== this.matchedComponent) { | ||
this.matchedComponent = component; | ||
} | ||
} | ||
|
||
private findComponent(location: Location): MatchedComponent | undefined { | ||
const matchedRoute = this.routes.find(this.isMatched(location)); | ||
if (!matchedRoute) { | ||
return; | ||
} | ||
|
||
const path = matchedRoute.path; | ||
const pattern = new URLPattern({ hash: path }); | ||
const match = pattern.exec(location.href); | ||
const props = this.parseProps(match?.hash.groups); | ||
|
||
return { | ||
name: matchedRoute.name, | ||
props: { | ||
...props, | ||
...matchedRoute.props, | ||
}, | ||
}; | ||
} | ||
|
||
private isMatched = (location: Location) => (route: RoutedComponent) => { | ||
const pattern = new URLPattern({ hash: route.path }); | ||
|
||
return pattern.test(location.href); | ||
}; | ||
|
||
private parseProps( | ||
groups: Record<string, string | undefined> = {}, | ||
): Record<string, string | number | undefined> { | ||
return Object.fromEntries( | ||
Object.entries(groups).map(([key, value]) => [ | ||
key, | ||
isNaN(Number(value)) ? value : Number(value), | ||
]), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the routing to work, but I'm currently stuck at the code in
markdown.ts
not working correctly. It just returnsundefined
. I've added some logging, to help with debugging the problem, but not gotten any further.