@canopycanopycanopy/b-ber-shapes-sequences 3.0.8-nav.0 → 3.0.8-next.96
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 +20 -4
- package/create-build-sequence.js +2 -22
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/package.json +10 -23
- package/sequences.js +2 -0
- package/index.js +0 -21
- package/sequences/index.js +0 -20
package/README.md
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# b-ber-shapes-sequences
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A data package that defines the ordered task sequences for each b-ber build target. It exports a `build` array containing the shared base sequence of task names (clean, container, cover, sass, copy, scripts, render, loi, footnotes, inject, opf) and a `sequences` object that maps each output format (epub, mobi, pdf, web, sample, reader, xml) to the base sequence extended with its format-specific tail tasks. It also exports `createBuildSequence`, a helper that filters a list of desired format names against the known sequences and returns the matched keys (defaulting to all formats if none match).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import {
|
|
9
|
+
sequences,
|
|
10
|
+
createBuildSequence,
|
|
11
|
+
} from '@canopycanopycanopy/b-ber-shapes-sequences'
|
|
12
|
+
|
|
13
|
+
const toRun = createBuildSequence(['epub', 'web'])
|
|
14
|
+
// => ['epub', 'web']
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This package is consumed by the b-ber CLI to determine which task pipeline to execute for a given build command.
|
|
18
|
+
|
|
19
|
+
## Dev
|
|
6
20
|
|
|
7
21
|
```
|
|
8
|
-
|
|
22
|
+
npm test
|
|
9
23
|
```
|
|
24
|
+
|
|
25
|
+
Tests verify that the `build` array and all format-keyed sequences export correctly.
|
package/create-build-sequence.js
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = createBuildSequence;
|
|
9
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
10
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
11
|
-
var _sequences = _interopRequireDefault(require("./sequences"));
|
|
12
|
-
function createBuildSequence(desiredSequences) {
|
|
13
|
-
// Set up an array of build types
|
|
14
|
-
const builds = (0, _keys.default)(_sequences.default);
|
|
15
|
-
|
|
16
|
-
// Filter the desired builds
|
|
17
|
-
const chosen = (0, _filter.default)(desiredSequences).call(desiredSequences, a => _sequences.default[a]);
|
|
18
|
-
|
|
19
|
-
// Get the task sequence
|
|
20
|
-
const sequence = chosen.length < 1 ? builds : chosen;
|
|
21
|
-
return sequence;
|
|
22
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
module.exports = require('./dist/index.js').createBuildSequence;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/create-build-sequence.d.ts
|
|
2
|
+
declare function createBuildSequence(desiredSequences: string[]): string[];
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/sequences/index.d.ts
|
|
5
|
+
declare const sequences: Record<string, string[]>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createBuildSequence, sequences };
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/create-build-sequence.ts","../src/sequences/index.ts"],"mappings":";iBAEwB,mBAAA,CACtB,gBAA0B;;;cCWtB,SAAA,EAAW,MAAM"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/sequences/index.ts
|
|
3
|
+
const build = [
|
|
4
|
+
"clean",
|
|
5
|
+
"container",
|
|
6
|
+
"cover",
|
|
7
|
+
"sass",
|
|
8
|
+
"copy",
|
|
9
|
+
"scripts",
|
|
10
|
+
"render",
|
|
11
|
+
"loi",
|
|
12
|
+
"footnotes",
|
|
13
|
+
"inject",
|
|
14
|
+
"opf"
|
|
15
|
+
];
|
|
16
|
+
const sequences = {
|
|
17
|
+
epub: [...build, "epub"],
|
|
18
|
+
mobi: [
|
|
19
|
+
...build,
|
|
20
|
+
"mobiCSS",
|
|
21
|
+
"mobi"
|
|
22
|
+
],
|
|
23
|
+
pdf: [...build, "pdf"],
|
|
24
|
+
web: [...build, "web"],
|
|
25
|
+
sample: [...build, "sample"],
|
|
26
|
+
reader: [...build, "reader"],
|
|
27
|
+
xml: [...build, "xml"]
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/create-build-sequence.ts
|
|
31
|
+
function createBuildSequence(desiredSequences) {
|
|
32
|
+
const builds = Object.keys(sequences);
|
|
33
|
+
const chosen = desiredSequences.filter((a) => sequences[a]);
|
|
34
|
+
return chosen.length < 1 ? builds : chosen;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.createBuildSequence = createBuildSequence;
|
|
38
|
+
exports.sequences = sequences;
|
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-shapes-sequences",
|
|
3
|
-
"version": "3.0.8-
|
|
3
|
+
"version": "3.0.8-next.96+7446845b",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
"sequences": "sequences"
|
|
8
|
-
},
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
9
7
|
"scripts": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"clean": "rimraf sequences && rimraf index.js && rimraf create-build-sequence.js",
|
|
13
|
-
"build": "npm run prepare",
|
|
14
|
-
"watch": "BABEL_ENV=production babel --config-file ../../babel.config.js -d ./ src/ --watch src",
|
|
8
|
+
"build": "tsdown",
|
|
9
|
+
"typecheck": "tsc --noEmit",
|
|
15
10
|
"test": "jest"
|
|
16
11
|
},
|
|
17
12
|
"author": "Triple Canopy <b-ber@canopycanopycanopy.com> (https://triplecanopy.github.io/)",
|
|
@@ -19,22 +14,14 @@
|
|
|
19
14
|
"publishConfig": {
|
|
20
15
|
"access": "public"
|
|
21
16
|
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@babel/runtime-corejs3": "^7.10.5",
|
|
24
|
-
"lodash": "^4.17.21",
|
|
25
|
-
"tar": "^6.1.11"
|
|
26
|
-
},
|
|
27
17
|
"devDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"@babel/core": "^7.10.5",
|
|
30
|
-
"@babel/preset-env": "^7.10.4",
|
|
31
|
-
"browserslist": "^4.17.4",
|
|
32
|
-
"jest": "^26.6.3",
|
|
18
|
+
"jest": "^29.7.0",
|
|
33
19
|
"rimraf": "^2.7.1"
|
|
34
20
|
},
|
|
35
21
|
"files": [
|
|
36
|
-
"
|
|
37
|
-
"create-build-sequence.js"
|
|
22
|
+
"dist",
|
|
23
|
+
"create-build-sequence.js",
|
|
24
|
+
"sequences.js"
|
|
38
25
|
],
|
|
39
26
|
"repository": {
|
|
40
27
|
"type": "git",
|
|
@@ -50,5 +37,5 @@
|
|
|
50
37
|
"url": "https://maxwellsimmer.com"
|
|
51
38
|
}
|
|
52
39
|
],
|
|
53
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "7446845bcda4337bfbc9f75b55a1e0ca805023eb"
|
|
54
41
|
}
|
package/sequences.js
ADDED
package/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
_Object$defineProperty(exports, "createBuildSequence", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return _createBuildSequence.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
_Object$defineProperty(exports, "sequences", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return _sequences.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
var _sequences = _interopRequireDefault(require("./sequences"));
|
|
21
|
-
var _createBuildSequence = _interopRequireDefault(require("./create-build-sequence"));
|
package/sequences/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.build = void 0;
|
|
8
|
-
const build = ['clean', 'container', 'cover', 'sass', 'copy', 'scripts', 'render', 'loi', 'footnotes', 'inject', 'opf'];
|
|
9
|
-
exports.build = build;
|
|
10
|
-
const sequences = {
|
|
11
|
-
epub: [...build, 'epub'],
|
|
12
|
-
mobi: [...build, 'mobiCSS', 'mobi'],
|
|
13
|
-
pdf: [...build, 'pdf'],
|
|
14
|
-
web: [...build, 'web'],
|
|
15
|
-
sample: [...build, 'sample'],
|
|
16
|
-
reader: [...build, 'reader'],
|
|
17
|
-
xml: [...build, 'xml']
|
|
18
|
-
};
|
|
19
|
-
var _default = sequences;
|
|
20
|
-
exports.default = _default;
|