Skip to content

Commit

Permalink
Bite the bullet and commit build outputs so that they are as accessib…
Browse files Browse the repository at this point in the history
…le as possible for people that may not be able to run the build in some OS or setup. An upside of this is that examples and documentation can be served out of the box without having to build them. Remove package.json 'prepare' scripts because they are no longer needed, as installing from git will already include build outputs.
  • Loading branch information
trusktr committed Sep 8, 2023
1 parent 7d320b3 commit 2aa687d
Show file tree
Hide file tree
Showing 22 changed files with 816 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules
# npmrc already specifies not to use package-lock, but tools like Lerna in the umbrella repo still add it, so ignore it.
package-lock.json
dist/
npm-debug.log
*.log
.vscode
File renamed without changes.
16 changes: 16 additions & 0 deletions dist/Observable.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Constructor } from 'lowclass';
interface ObservableInstance {
on(eventName: string, callback: Function, context?: any): void;
off(eventName: string, callback?: Function): void;
emit(eventName: string, data?: any): void;
trigger(eventName: string, data?: any): void;
triggerEvent(eventName: string, data?: any): void;
}
export declare function ObservableMixin<T extends Constructor>(Base: T): Constructor<ObservableInstance> & T;
export declare const Observable: (new (...a: any[]) => ObservableInstance) & (new (...a: any[]) => object) & {
mixin: typeof ObservableMixin;
};
export interface Observable extends InstanceType<typeof Observable> {
}
export default Observable;
//# sourceMappingURL=Observable.d.ts.map
1 change: 1 addition & 0 deletions dist/Observable.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions dist/Observable.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/Observable.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions dist/ejs/html/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
/*background: white;*/
background: rgb(30,30,30);
padding: 0;
margin: 0;
font-family: sans-serif;
}

a {
text-decoration: none;
}
a:visited {
color: inherit;
}

template {
display: none;
}

/* TODO: use jss for runtime styles. */
a.hash {
color: #800;
}
</style>
<link type="text/css" href="/code.css" />
</head>
<body>
<script type="template" id="content">
<% dox.comments.forEach(function(comment) { %>
<% if (!comment.ignore) { %>

<% // TODO: ignore dox that don't have a ctx. %>
<div>
<h1 id="<%= (comment.ctx? comment.ctx.name: comment.ctx) %>">
<a class="hash" href="#<%= (comment.ctx? comment.ctx.name: comment.ctx) %>"># </a>
<%- (comment.ctx? comment.ctx.name: comment.ctx) %>
</h1>

<%- comment.description.full %>

<pre><code class="javascript"><%= comment.code %></code></pre>
</div>

<% } %>
<% }) %>
</script>

<script>
// place this in a json file next to the template instead of inline here?
window.dox = <%- JSON.stringify(dox) %>
</script>

<script src="/app.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions dist/ejs/js/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=app.d.ts.map
1 change: 1 addition & 0 deletions dist/ejs/js/app.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions dist/ejs/js/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/ejs/js/app.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'regexr'
declare module 'at-at'
declare module 'jsdoctypeparser'
84 changes: 84 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { Observable } from './Observable.js';
export declare class FileScanner extends Observable {
scanFile(file: string, charset?: string): Promise<Array<Comment>>;
}
export declare class FolderScanner extends FileScanner {
scanFolder(folder: string): Promise<FileComments[]>;
}
declare type Comment = {
source: string;
content: CommentContent;
};
declare type CommentContent = Array<Tag | string>;
declare type Tag = {
source: string;
tag: string;
type: JSDocTypeAST | undefined;
name: string | undefined;
description: string | undefined;
};
declare type JSDocTypeAST = Record<string, any>;
declare type FileComments = {
file: string;
comments: Comment[];
};
export declare class CommentAnalyzer {
scanner: FolderScanner;
classes: Map<string, ClassMeta>;
functions: Map<string, FunctionMeta>;
analyze(folder: string, filter?: (path: string) => boolean): Promise<DocsMeta>;
private trackClass;
private trackMethod;
private trackProperty;
}
export declare type PrimaryItemMeta = {
file: string;
};
export declare type ClassMeta = PrimaryItemMeta & {
name: string;
description: string;
extends: string[];
abstract: boolean;
properties: Record<string, PropertyMeta>;
methods: Record<string, MethodMeta>;
};
export declare type ClassElementMeta = {
access: 'public' | 'protected' | 'private';
};
export declare type PropertyMeta = ClassElementMeta & {
name: string;
description?: string;
type?: JSDocTypeAST;
};
export declare type FunctionLikeMeta = {
name: string;
description?: string;
params: Param[];
returns?: JSDocTypeAST;
};
export declare type FunctionMeta = PrimaryItemMeta & FunctionLikeMeta;
export declare type MethodMeta = ClassElementMeta & FunctionLikeMeta;
export declare type Param = {
name: string;
description?: string;
type?: JSDocTypeAST;
};
export declare type DocsMeta = {
sourceFolder: string;
classes: Map<string, ClassMeta>;
functions: Map<string, FunctionMeta>;
};
export declare class MarkdownRenderer {
render(docsMeta: DocsMeta, destination: string): Promise<void>;
private resolveDestination;
renderNav(docsMeta: DocsMeta, options?: {
linePadStart?: string;
basePath?: string;
}): string;
renderClass(className: string, classMeta: ClassMeta, docsMeta: DocsMeta): string;
renderProperty(propertyName: string, propertyMeta: PropertyMeta, _docsMeta: DocsMeta): string;
renderMethod(methodName: string, methodMeta: MethodMeta, _docsMeta: DocsMeta): string;
}
export declare const version = "0.2.7";
export {};
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2aa687d

Please sign in to comment.