@canopycanopycanopy/b-ber-tasks 3.0.8-nav-memo.2 → 3.0.8-next.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -4
- package/dist/index.d.ts +144 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2109 -176
- package/dist/web/search.js +1 -1
- package/dist/web/worker.js +1 -1
- package/package.json +22 -23
- package/dist/clean/index.js +0 -25
- package/dist/container/index.js +0 -48
- package/dist/copy/index.js +0 -60
- package/dist/cover/index.js +0 -217
- package/dist/deploy/index.js +0 -188
- package/dist/epub/index.js +0 -24
- package/dist/footnotes/index.js +0 -56
- package/dist/generate/index.js +0 -79
- package/dist/init/index.js +0 -73
- package/dist/inject/index.js +0 -80
- package/dist/loi/index.js +0 -130
- package/dist/mobi/index.js +0 -39
- package/dist/mobi/mobi-css.js +0 -85
- package/dist/opf/ManifestAndMetadata.js +0 -96
- package/dist/opf/Navigation.js +0 -199
- package/dist/opf/Opf.js +0 -56
- package/dist/opf/helpers.js +0 -57
- package/dist/opf/index.js +0 -31
- package/dist/pdf/index.js +0 -59
- package/dist/reader/index.js +0 -205
- package/dist/render/index.js +0 -53
- package/dist/sample/index.js +0 -11
- package/dist/sass/index.js +0 -185
- package/dist/scripts/index.js +0 -54
- package/dist/serialize.js +0 -57
- package/dist/serve/index.js +0 -83
- package/dist/validate/index.js +0 -51
- package/dist/web/Template.js +0 -171
- package/dist/web/index.js +0 -371
- package/dist/xml/index.js +0 -57
package/README.md
CHANGED
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
# `@canopycanopycanopy/b-ber-tasks`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`b-ber-tasks` defines every individual build step in the b-ber pipeline. Each task is an async function (Promise-based) that reads from and writes to the shared `State` object in `b-ber-lib`. `b-ber-cli` composes these tasks into ordered sequences to produce EPUB, Mobi, PDF, web, reader, and XML builds. The package also includes tasks for serving the output locally via browser-sync, deploying to remote hosts, and generating the full-text Lunr search index.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Key exports
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
| Export | Purpose |
|
|
8
|
+
| ----------- | ---------------------------------------------------------- |
|
|
9
|
+
| `render` | Converts Markdown source files to XHTML pages |
|
|
10
|
+
| `opf` | Generates the EPUB OPF (manifest, metadata, spine, guide) |
|
|
11
|
+
| `container` | Creates the EPUB `META-INF/container.xml` |
|
|
12
|
+
| `epub` | Zips the OPS directory into a `.epub` archive |
|
|
13
|
+
| `sass` | Compiles SCSS to CSS with autoprefixer |
|
|
14
|
+
| `scripts` | Bundles and minifies JavaScript assets |
|
|
15
|
+
| `copy` | Copies static assets (images, fonts, media) into the build |
|
|
16
|
+
| `cover` | Generates the EPUB cover image entry |
|
|
17
|
+
| `footnotes` | Collects and renders footnote pages |
|
|
18
|
+
| `loi` | Generates the List of Illustrations page |
|
|
19
|
+
| `generate` | Generates placeholder XHTML files for non-Markdown content |
|
|
20
|
+
| `inject` | Injects navigation and UI elements into rendered HTML |
|
|
21
|
+
| `init` | Scaffolds a new b-ber project directory |
|
|
22
|
+
| `clean` | Removes build output directories |
|
|
23
|
+
| `mobi` | Runs Calibre conversion to produce `.mobi` |
|
|
24
|
+
| `pdf` | Produces PDF output |
|
|
25
|
+
| `web` | Builds the static website output |
|
|
26
|
+
| `reader` | Builds the reader-compatible output |
|
|
27
|
+
| `xml` | Builds the InDesign XML output |
|
|
28
|
+
| `sample` | Builds the sample (excerpt) output |
|
|
29
|
+
| `serve` | Starts a browser-sync dev server |
|
|
30
|
+
| `deploy` | Deploys build output to a remote host |
|
|
31
|
+
| `validate` | Validates directive syntax in Markdown source |
|
|
32
|
+
| `serialize` | Serialises the spine/TOC data structure |
|
|
33
|
+
|
|
34
|
+
## Dev
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm test # jest
|
|
38
|
+
npm run build
|
|
9
39
|
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
//#region src/clean/index.d.ts
|
|
2
|
+
declare const _default: () => Promise<void>;
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/container/index.d.ts
|
|
5
|
+
declare const _default$1: () => Promise<void | void[]>;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/copy/index.d.ts
|
|
8
|
+
declare const copy: () => Promise<void | void[]>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/cover/index.d.ts
|
|
11
|
+
declare const _default$2: () => Promise<void>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/deploy/index.d.ts
|
|
14
|
+
declare function main({
|
|
15
|
+
builds,
|
|
16
|
+
yes
|
|
17
|
+
}: {
|
|
18
|
+
builds?: string[];
|
|
19
|
+
yes?: boolean;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/epub/index.d.ts
|
|
23
|
+
declare const epub: () => any;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/footnotes/index.d.ts
|
|
26
|
+
declare const _default$3: () => Promise<any>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/generate/index.d.ts
|
|
29
|
+
declare const generate: (metadata: Record<string, string>) => Promise<void>;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/init/index.d.ts
|
|
32
|
+
declare class Initializer {
|
|
33
|
+
src: string;
|
|
34
|
+
dist: string;
|
|
35
|
+
name: string;
|
|
36
|
+
config: Record<string, any>;
|
|
37
|
+
path: string;
|
|
38
|
+
builds: string[];
|
|
39
|
+
constructor({
|
|
40
|
+
name,
|
|
41
|
+
config
|
|
42
|
+
}?: {
|
|
43
|
+
name?: string;
|
|
44
|
+
config?: Record<string, any>;
|
|
45
|
+
});
|
|
46
|
+
createAssets: () => any;
|
|
47
|
+
copyImages(): Promise<void[]>;
|
|
48
|
+
setTheme(): any;
|
|
49
|
+
start(): void;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/inject/index.d.ts
|
|
53
|
+
declare const inject: () => Promise<void | void[]>;
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/loi/index.d.ts
|
|
56
|
+
declare const loi: () => Promise<any>;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/mobi/index.d.ts
|
|
59
|
+
declare const mobi: () => any;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/mobi/mobi-css.d.ts
|
|
62
|
+
declare const mobiCSS: () => Promise<void | void[]>;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/opf/Opf.d.ts
|
|
65
|
+
declare class Opf {
|
|
66
|
+
static createOpf(): Promise<void>;
|
|
67
|
+
static writeOPF(contents: string): Promise<void>;
|
|
68
|
+
static createOpfPackageString([manifestAndMetadataXML, navigationXML]: [any, any]): any;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/opf/index.d.ts
|
|
72
|
+
declare const opf: typeof Opf.createOpf;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/pdf/index.d.ts
|
|
75
|
+
declare const pdf: () => Promise<any>;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/reader/index.d.ts
|
|
78
|
+
declare class Reader {
|
|
79
|
+
outputDirName: string;
|
|
80
|
+
outputDir: string;
|
|
81
|
+
apiDir: string;
|
|
82
|
+
epubAssets: string[];
|
|
83
|
+
readerModuleName: string;
|
|
84
|
+
readerModuleDistDir: string;
|
|
85
|
+
readerAppPath: string | null;
|
|
86
|
+
constructor();
|
|
87
|
+
get remoteURL(): any;
|
|
88
|
+
createDirname(s: string): string;
|
|
89
|
+
ensureReaderModuleExists(): void;
|
|
90
|
+
createOutputDirs(): Promise<void>;
|
|
91
|
+
copyEpubToOutputDir(): Promise<void[]>;
|
|
92
|
+
getBookMetadata(term?: any): any;
|
|
93
|
+
getProjectConfig(term?: string): any;
|
|
94
|
+
writeBookManifest(): Promise<void>;
|
|
95
|
+
writeWebpubManifest(): Promise<void>;
|
|
96
|
+
injectWebpubManifestLink(): Promise<void>;
|
|
97
|
+
copyReaderAppToOutputDir(): Promise<void[]>;
|
|
98
|
+
injectServerDataIntoTemplate(): Promise<void>;
|
|
99
|
+
updateLinkedResourcesWithAbsolutePaths(): Promise<void>;
|
|
100
|
+
updateAssetURLsWithAbsolutePaths(): Promise<void>;
|
|
101
|
+
}
|
|
102
|
+
declare const main$1: () => Reader;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/render/index.d.ts
|
|
105
|
+
declare function render(): Promise<void>;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/sample/index.d.ts
|
|
108
|
+
declare const sample: () => Promise<void>;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/sass/index.d.ts
|
|
111
|
+
declare const sass: () => Promise<void>;
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/scripts/index.d.ts
|
|
114
|
+
declare const scripts: () => Promise<void>;
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/serialize.d.ts
|
|
117
|
+
type TaskFn = (resp?: unknown) => Promise<unknown>;
|
|
118
|
+
type TaskEntry = string | TaskFn;
|
|
119
|
+
declare const serialize: (sequence: TaskEntry[]) => Promise<unknown>;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/serve/index.d.ts
|
|
122
|
+
declare const serve: ({
|
|
123
|
+
build: buildOption,
|
|
124
|
+
external
|
|
125
|
+
}: {
|
|
126
|
+
build?: string;
|
|
127
|
+
external?: boolean;
|
|
128
|
+
}) => Promise<void>;
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/validate/index.d.ts
|
|
131
|
+
declare const validate: ({
|
|
132
|
+
project
|
|
133
|
+
}: {
|
|
134
|
+
project: string;
|
|
135
|
+
}) => Promise<void>;
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/web/index.d.ts
|
|
138
|
+
declare const web: () => Promise<void>;
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/xml/index.d.ts
|
|
141
|
+
declare const xml: () => Promise<void>;
|
|
142
|
+
//#endregion
|
|
143
|
+
export { _default as clean, _default$1 as container, copy, _default$2 as cover, main as deploy, epub, _default$3 as footnotes, generate, Initializer as init, inject, loi, mobi, mobiCSS, opf, pdf, main$1 as reader, render, sample, sass, scripts, serialize, serve, validate, web, xml };
|
|
144
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/clean/index.ts","../src/container/index.ts","../src/copy/index.ts","../src/cover/index.ts","../src/deploy/index.ts","../src/epub/index.ts","../src/footnotes/index.ts","../src/generate/index.ts","../src/init/index.ts","../src/inject/index.ts","../src/loi/index.ts","../src/mobi/index.ts","../src/mobi/mobi-css.ts","../src/opf/Opf.ts","../src/opf/index.ts","../src/pdf/index.ts","../src/reader/index.ts","../src/render/index.ts","../src/sample/index.ts","../src/sass/index.ts","../src/scripts/index.ts","../src/serialize.ts","../src/serve/index.ts","../src/validate/index.ts","../src/web/index.ts","../src/xml/index.ts"],"mappings":";;;;;;;cEUM,IAAA,QAAI,OAAA;;;;;;iBE8MD,IAAA;EAAO,MAAA;EAAQ;AAAA;EAAS,MAAA;EAAmB,GAAA;AAAA,IAAe,OAAA;;;cCnN7D,IAAA;;;;;;cEwEA,QAAA,GAAQ,QAAA,EAZG,MAAA,qBAAsB,OAAA;;;cCvDjC,WAAA;EACJ,GAAA;EACA,IAAA;EACA,IAAA;EACA,MAAA,EAAS,MAAA;EACT,IAAA;EACA,MAAA;;IAGE,IAAA;IACA;EAAA;IACG,IAAA;IAAe,MAAA,GAAS,MAAA;EAAA;EAa7B,YAAA;EAiBA,UAAA,IAAU,OAAA;EAkBV,QAAA;EAOA,KAAA;AAAA;;;cC4DI,MAAA,QAAM,OAAA;;;cCzCN,GAAA,QAAG,OAAA;;;cC9EH,IAAA;;;cCmEA,OAAA,QAAO,OAAA;;;cCzEP,GAAA;EAAA,OACG,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