Skip to content
This repository was archived by the owner on Feb 17, 2024. It is now read-only.

Commit 8f6324e

Browse files
committed
♻️ rename
1 parent 51142ad commit 8f6324e

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "ui-guide",
2+
"name": "@angularclass/dope-docs",
33
"version": "0.0.1",
44
"description": "Starter to make Angular libs",
5-
"main": "ui-guide.js",
5+
"main": "dope-docs.js",
66
"jsnext:main": "index.js",
77
"module": "index.js",
88
"types": "index.d.ts",
@@ -17,7 +17,7 @@
1717
"release": "rm -rf build && npm run build:esm && npm run build:bundle && npm run build:cli && npm run copy"
1818
},
1919
"bin": {
20-
"ui-guide": "./cli/cli.js"
20+
"acdocs": "./cli/cli.js"
2121
},
2222
"license": "MIT",
2323
"devDependencies": {

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from './interfaces'
2-
export { uiGuideOn, createUIGuideSandbox, UIGuideBuilder } from './ui-guide-builder'
2+
export { docsFor, createDopeDocs, DocsBuilder} from './ui-guide-builder'

src/interfaces.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ export interface ComponentOuput {
9696
}
9797

9898
export interface ComponentAPI {
99-
inputs: ComponentInput[]
100-
outputs: ComponentOuput[]
99+
inputs?: ComponentInput[]
100+
outputs?: ComponentOuput[]
101+
}
102+
103+
export interface DopeDoc extends UIGuide {
104+
example(name: string, config: UIGuideExampleConfig): DopeDoc
105+
xexample(name?: string, config?: UIGuideExampleConfig): DopeDoc
106+
Xexample(name?: string, config?: UIGuideExampleConfig): DopeDoc
107+
}
108+
109+
export declare var DocsBuilder: {
110+
new(name: string, description: string, api: ComponentAPI): DopeDoc
111+
example(name: string, config: UIGuideExampleConfig): DopeDoc
112+
xexample(name?: string, config?: UIGuideExampleConfig): DopeDoc
113+
Xexample(name?: string, config?: UIGuideExampleConfig): DopeDoc
101114
}

src/ui-guide-builder.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { UIGuideSandbox, UIGuide, UIGuideExample, UIGuideExampleConfig, ComponentAPI } from './interfaces'
1+
import { UIGuideSandbox, UIGuide, UIGuideExample, UIGuideExampleConfig, ComponentAPI, DopeDoc } from './interfaces'
22
import { bootstrap } from './boostrap'
33
const slugify = require('slugify')
44

5-
export function createUIGuideSandbox(sandbox: UIGuideSandbox) {
5+
export function createDopeDocs(sandbox: UIGuideSandbox) {
66
bootstrap(sandbox)
77
}
88

99
const GuideIDS: {[id: string]: string[]} = {}
1010

11-
export class UIGuideBuilder implements UIGuide {
11+
export class DocsBuilder implements DopeDoc {
1212
id: string
1313
examples: UIGuideExample[] = []
1414

@@ -23,7 +23,7 @@ export class UIGuideBuilder implements UIGuide {
2323
this.id = id
2424
}
2525

26-
example(name: string, config: UIGuideExampleConfig): this {
26+
example(name: string, config: UIGuideExampleConfig): DopeDoc {
2727
const id = `${this.id}-${slugify(name).toLowerCase()}`
2828

2929
if (GuideIDS[this.id].find(i => i === id)) {
@@ -47,19 +47,19 @@ export class UIGuideBuilder implements UIGuide {
4747
return this
4848
}
4949

50-
xexample(description: string, config: UIGuideExampleConfig){
50+
xexample(description: string, config: UIGuideExampleConfig): DopeDoc {
5151
return this
5252
}
5353

54-
Xexample(description: string, config: UIGuideExampleConfig) {
54+
Xexample(description: string, config: UIGuideExampleConfig): DopeDoc {
5555
return this.xexample(description, config)
5656
}
5757
}
5858

59-
export function uiGuideOn(
59+
export function docsFor(
6060
component: string,
6161
description: string,
6262
api: ComponentAPI
63-
): UIGuideBuilder {
64-
return new UIGuideBuilder(component, description, api)
63+
): DopeDoc {
64+
return new DocsBuilder(component, description, api)
6565
}

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const moduleExternals = require('webpack-node-externals')
88
module.exports = (envOptions = {}) => {
99
return ({
1010
entry: {
11-
'ui-guide': root('./src/index.ts')
11+
'dope-docs': root('./src/index.ts')
1212
},
1313
output: {
1414
path: root('dist'),

0 commit comments

Comments
 (0)