Skip to content

Commit

Permalink
Use relative paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
GirlBossRush committed Oct 15, 2023
1 parent d184ac7 commit 1738498
Show file tree
Hide file tree
Showing 103 changed files with 231 additions and 234 deletions.
16 changes: 8 additions & 8 deletions cli/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { KeyworkResourceError, Status } from 'keywork/errors'
import { KeyworkLogger } from 'keywork/logging'
import * as http from 'node:http'
import { Socket } from 'node:net'
import * as path from 'node:path'
import type { Argv } from 'yargs'
import { KeyworkResourceError, Status } from '../errors/index.js'
import { KeyworkLogger } from '../logging/index.js'
import {
NodeStaticFileRouter,
applyNodeKeyworkPolyfills,
createNodeServerHandler,
projectRootPathBuilder,
} from 'keywork/node'
import { FetcherModuleExports, RequestRouter } from 'keywork/router'
import * as http from 'node:http'
import { Socket } from 'node:net'
import * as path from 'node:path'
import type { Argv } from 'yargs'
} from '../node/index.js'
import { FetcherModuleExports, RequestRouter } from '../router/index.js'
import type { StrictYargsOptionsToInterface } from './yargs.js'

await applyNodeKeyworkPolyfills()
Expand Down
6 changes: 3 additions & 3 deletions client/BrowserRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { FetchEventProvider, IsomorphicFetchEvent } from 'keywork/events'
import { DEFAULT_LOG_LEVEL, DEFAULT_LOG_PREFIX, KeyworkLogLevel, KeyworkLogger } from 'keywork/logging'
import { RoutePatternsProps, URLContext } from 'keywork/uri'
import { createContext, useContext, useMemo } from 'react'
import { FetchEventProvider, IsomorphicFetchEvent } from '../events/index.js'
import { DEFAULT_LOG_LEVEL, DEFAULT_LOG_PREFIX, KeyworkLogLevel, KeyworkLogger } from '../logging/index.js'
import { RoutePatternsProps, URLContext } from '../uri/index.js'
import { KeyworkPatternToPageComponent } from './KeyworkPatternToPageComponent.js'
import { SSRPropsByPath, SSRPropsProvider } from './SSRPropsProvider.js'
import { pluckNavigatorURL } from './dom.js'
Expand Down
2 changes: 1 addition & 1 deletion client/KeyworkPatternToPageComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { PatternRouteComponentMap, RoutePatternsProps, URLPatternResultContext } from 'keywork/uri'
import { useMemo } from 'react'
import { PatternRouteComponentMap, RoutePatternsProps, URLPatternResultContext } from '../uri/index.js'
import { useSSRPropsByPath } from './SSRPropsProvider.js'
import { useLocation } from './hooks.js'

Expand Down
4 changes: 2 additions & 2 deletions client/SSRPropsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { useKeyworkLogger } from 'keywork/logging'
import { KEYWORK_STATIC_PROPS_QUERY_KEY } from 'keywork/uri'
import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'
import { useKeyworkLogger } from '../logging/index.js'
import { KEYWORK_STATIC_PROPS_QUERY_KEY } from '../uri/index.js'
import { useLocation } from './hooks.js'

/**
Expand Down
2 changes: 1 addition & 1 deletion client/SSRRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @see LICENSE.md in the project root for further licensing information.
*/
import { normalizeURLPattern, normalizeURLPatternInit, useURLPatternResult } from 'keywork/uri'
import { normalizeURLPattern, normalizeURLPatternInit, useURLPatternResult } from '../uri/index.js'
import { useSSRPropsByPath } from './SSRPropsProvider.js'

interface RouteDataFetcherProps {
Expand Down
2 changes: 1 addition & 1 deletion client/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { readGlobalScope } from 'keywork/utils'
import { readGlobalScope } from '../utils/index.js'

/** @internal */
type FrameRequestCallbackFn = (timestamp: number) => unknown
Expand Down
4 changes: 2 additions & 2 deletions client/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { KeyworkResourceError } from 'keywork/errors'
import { KEYWORK_APP_ROOT, readGlobalScope } from 'keywork/utils'
import { KeyworkResourceError } from '../errors/index.js'
import { KEYWORK_APP_ROOT, readGlobalScope } from '../utils/index.js'

/// <reference lib="dom" />

Expand Down
6 changes: 3 additions & 3 deletions client/embedded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { KeyworkResourceError } from 'keywork/errors'
import { IsomorphicFetchEventInit } from 'keywork/events'
import { KEYWORK_SSR_INIT_KEY, KEYWORK_SSR_PROPS_KEY, readGlobalScope } from 'keywork/utils'
import { KeyworkResourceError } from '../errors/index.js'
import { IsomorphicFetchEventInit } from '../events/index.js'
import { KEYWORK_SSR_INIT_KEY, KEYWORK_SSR_PROPS_KEY, readGlobalScope } from '../utils/index.js'

/**
* The global scope with embedded Keywork SSR props.
Expand Down
6 changes: 3 additions & 3 deletions client/hydrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
*
* @see LICENSE.md in the project root for further licensing information.
*/
import { KeyworkResourceError } from 'keywork/errors'
import { KeyworkLogLevel, KeyworkLogger } from 'keywork/logging'
import { isKeyworkClientModule } from 'keywork/uri'
import { hydrateRoot } from 'react-dom/client'
import { KeyworkResourceError } from '../errors/index.js'
import { KeyworkLogLevel, KeyworkLogger } from '../logging/index.js'
import { isKeyworkClientModule } from '../uri/index.js'
import { pluckKeyworkHydrationElement, waitUntilDOMReady } from './dom.js'

export interface KeyworkHydrationOptions {
Expand Down
2 changes: 1 addition & 1 deletion cloudflare/CloudflarePagesAssetRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { ServiceBindingRouter } from 'keywork/middleware'
import { ServiceBindingRouter } from '../middleware/index.js'

/**
* An asset environment binding available within Cloudflare Pages.
Expand Down
2 changes: 1 addition & 1 deletion cloudflare/EnvironmentBindingKinds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

import type { DurableObjectNamespace, KVNamespace } from '@cloudflare/workers-types'
import type { WorkerEnvFetchBinding } from 'keywork/router'
import type { WorkerEnvFetchBinding } from '../router/index.js'

/**
* Either:
Expand Down
4 changes: 2 additions & 2 deletions docgen/DocusaurusTypeDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* @see LICENSE.md in the project root for further licensing information.
*/

import { load as loadMarkdownPlugin, MarkdownTheme, MarkdownThemeOptions } from 'keywork/docgen/theme'
import { projectRootPathBuilder } from 'keywork/node'
import * as TypeDoc from 'typedoc'
import { Logger, LogLevel } from 'typedoc'
import * as ts from 'typescript'
import { projectRootPathBuilder } from '../node/index.js'
import { load as loadMarkdownPlugin, MarkdownTheme, MarkdownThemeOptions } from './theme/index.js'

export class DocusaurusTypeDoc extends TypeDoc.Application {
constructor(public program: ts.Program) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/attemptExternalResolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import type { ReferenceType } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'

export function attemptExternalResolutionHelper(theme: MarkdownTheme) {
Handlebars.registerHelper('attemptExternalResolution', function (type: ReferenceType) {
Expand Down
4 changes: 2 additions & 2 deletions docgen/helpers/breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
*/

import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { escapeChars } from 'keywork/docgen/utils'
import { PageEvent } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'
import { escapeChars } from '../utils/index.js'

export function breadcrumbsHelper(theme: MarkdownTheme) {
Handlebars.registerHelper('breadcrumbs', function (this: PageEvent) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import type { CommentDisplayPart } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'

export function commentHelper(_theme: MarkdownTheme) {
Handlebars.registerHelper('comment', function (parts: CommentDisplayPart[]) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import { camelToTitleCase } from 'keywork/docgen/utils'
import { Comment } from 'typedoc'
import { camelToTitleCase } from '../utils/index.js'

export function commentsHelper() {
Handlebars.registerHelper('comments', function (comment: Comment, includeHTMLWrappers = true) {
Expand Down
4 changes: 2 additions & 2 deletions docgen/helpers/declaration-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { stripComments, stripLineBreaks } from 'keywork/docgen/utils'
import type { ParameterReflection, ReflectionType } from 'typedoc'
import { DeclarationReflection, LiteralType, ReflectionKind } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'
import { stripComments, stripLineBreaks } from '../utils/index.js'

function getType(reflection: ParameterReflection | DeclarationReflection) {
const reflectionType = reflection.type as ReflectionType
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/escape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import { escapeChars } from 'keywork/docgen/utils'
import { escapeChars } from '../utils/index.js'

export function escapeHelper() {
Handlebars.registerHelper('escape', function (str: string) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/frontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import { SourceReferenceWithGit, parseModel } from 'keywork/docgen/utils'
import type { ContainerReflection, PageEvent } from 'typedoc'
import { SourceReferenceWithGit, parseModel } from '../utils/index.js'

export function frontmatterHelper() {
/**
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/hierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import { spaces } from 'keywork/docgen/utils'
import { DeclarationHierarchy } from 'typedoc'
import { spaces } from '../utils/index.js'

export function hierarchyHelper() {
Handlebars.registerHelper('hierarchy', function (this: DeclarationHierarchy, level: number) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/humanizeReflectionName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import dashify from 'dashify'
import Handlebars from 'handlebars'
import { escapeChars } from 'keywork/docgen/utils'
import { ReferenceReflection, ReflectionKind } from 'typedoc'
import { escapeChars } from '../utils/index.js'

export function humanizeReflectionName() {
Handlebars.registerHelper('humanizeReflectionName', function (this: ReferenceReflection) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/if-named-anchors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import type { PageEvent } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'

export function ifNamedAnchors(theme: MarkdownTheme) {
Handlebars.registerHelper('ifNamedAnchors', function (this: PageEvent, options: Handlebars.HelperOptions) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/if-show-breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { PageEvent } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'

export function ifShowBreadcrumbsHelper(theme: MarkdownTheme) {
Handlebars.registerHelper('ifShowBreadcrumbs', function (this: PageEvent, options: Handlebars.HelperOptions) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/if-show-named-anchors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { PageEvent } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'

export function ifShowNamedAnchorsHelper(theme: MarkdownTheme) {
Handlebars.registerHelper('ifShowNamedAnchors', function (this: PageEvent, options: Handlebars.HelperOptions) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/if-show-page-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { PageEvent } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'

export function ifShowPageTitleHelper(theme: MarkdownTheme) {
Handlebars.registerHelper('ifShowPageTitle', function (this: PageEvent, options: Handlebars.HelperOptions) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/parameter-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import { stripLineBreaks } from 'keywork/docgen/utils'
import { ParameterReflection, ReflectionKind } from 'typedoc'
import { stripLineBreaks } from '../utils/index.js'
import { getReflectionType } from './type.js'

export function parameterTableHelper() {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/property-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import { escapeChars, stripLineBreaks } from 'keywork/docgen/utils'
import { DeclarationReflection, ReflectionType } from 'typedoc'
import { escapeChars, stripLineBreaks } from '../utils/index.js'

export function propertyTableHelper() {
Handlebars.registerHelper('propertyTable', function (this: DeclarationReflection[]) {
Expand Down
4 changes: 2 additions & 2 deletions docgen/helpers/reflection-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
*/
import dashify from 'dashify'
import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { escapeChars, parseModel } from 'keywork/docgen/utils'
import { PageEvent, SignatureReflection } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'
import { escapeChars, parseModel } from '../utils/index.js'

export function reflectionTitleHelper(_theme: MarkdownTheme) {
Handlebars.registerHelper('reflectionTitle', function <
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/relative-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import Handlebars from 'handlebars'

import type { MarkdownTheme } from 'keywork/docgen/theme'
import type { MarkdownTheme } from '../theme/index.js'

export function relativeURLHelper(theme: MarkdownTheme) {
Handlebars.registerHelper('relativeURL', function (url: string) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/signature-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { ParameterReflection, ReflectionKind, SignatureReflection } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'

export function signatureTitleHelper(_theme: MarkdownTheme) {
Handlebars.registerHelper(
Expand Down
4 changes: 2 additions & 2 deletions docgen/helpers/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import type { MarkdownTheme } from 'keywork/docgen/theme'
import { escapeChars } from 'keywork/docgen/utils'
import type { DeclarationReflection, ProjectReflection, ReflectionGroup } from 'typedoc'
import type { MarkdownTheme } from '../theme/index.js'
import { escapeChars } from '../utils/index.js'

export function tocHelper(theme: MarkdownTheme) {
Handlebars.registerHelper('toc', function (this: ProjectReflection | DeclarationReflection) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/type-parameter-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/

import Handlebars from 'handlebars'
import { stripLineBreaks } from 'keywork/docgen/utils'
import { TypeParameterReflection } from 'typedoc'
import { stripLineBreaks } from '../utils/index.js'

export function typeParameterTableHelper() {
Handlebars.registerHelper('typeParameterTable', function (this: TypeParameterReflection[]) {
Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/

import Handlebars from 'handlebars'
import { escapeChars } from 'keywork/docgen/utils'
import {
ArrayType,
ConditionalType,
Expand All @@ -33,6 +32,7 @@ import {
UnionType,
UnknownType,
} from 'typedoc'
import { escapeChars } from '../utils/index.js'

type Collapse = 'object' | 'function' | 'all' | 'none'

Expand Down
2 changes: 1 addition & 1 deletion docgen/helpers/usage-tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @see LICENSE.md in the project root for further licensing information.
*/
import Handlebars from 'handlebars'
import { createUsageMap, parseModel, renderBrowserDemo, renderUsageTabs } from 'keywork/docgen/utils'
import { PageEvent, SignatureReflection } from 'typedoc'
import { createUsageMap, parseModel, renderBrowserDemo, renderUsageTabs } from '../utils/index.js'

export function usageTabsHelper() {
Handlebars.registerHelper('usageTabs', function <T extends SignatureReflection>(this: PageEvent<T>) {
Expand Down
Loading

0 comments on commit 1738498

Please sign in to comment.