@canopycanopycanopy/b-ber-tasks 1.2.13-react-reader.66 → 1.2.13-react-reader.71
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/dist/sass/index.js +21 -19
- package/dist/serve/index.js +43 -37
- package/package.json +10 -10
package/dist/sass/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var _State = _interopRequireDefault(require("@canopycanopycanopy/b-ber-lib/State
|
|
|
42
42
|
// running the sass task
|
|
43
43
|
const ASSET_DIRNAMES = ['fonts', 'images'];
|
|
44
44
|
const autoprefixerOptions = _State.default.config.autoprefixer_options || {
|
|
45
|
-
overrideBrowserslist: ['
|
|
45
|
+
overrideBrowserslist: ['defaults', '> 1%', 'not dead', 'not IE 11'],
|
|
46
46
|
flexbox: 'no-2009'
|
|
47
47
|
}; // Check to see if there's an `application.scss` in `_stylesheets`, and if so
|
|
48
48
|
// load that; else verify that a theme is selected in `config`, and that the
|
|
@@ -182,24 +182,26 @@ function resolveImportedModule(importPath) {
|
|
|
182
182
|
return importedModule;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
const renderCSS = scssString => new _promise.default(resolve =>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
185
|
+
const renderCSS = scssString => new _promise.default(resolve => {
|
|
186
|
+
_sass.default.render({
|
|
187
|
+
// Importer allows use of '~' to denote node_modules directory in SCSS files
|
|
188
|
+
importer: (url, _file, done) => {
|
|
189
|
+
const file = url[0] === '~' ? resolveImportedModule(url) : url;
|
|
190
|
+
return done({
|
|
191
|
+
file
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
|
+
// Add build vars at runtime with the SCSS buffer (which is transformed
|
|
195
|
+
// to string in the backticks)
|
|
196
|
+
data: `$build: "${_State.default.build}";${scssString}`,
|
|
197
|
+
includePaths: [_State.default.src.stylesheets(), _path.default.dirname(_State.default.theme.entry), _path.default.dirname(_path.default.dirname(_State.default.theme.entry))],
|
|
198
|
+
outputStyle: _State.default.env === 'production' ? 'compressed' : 'expanded',
|
|
199
|
+
errLogToConsole: true
|
|
200
|
+
}, (err, result) => {
|
|
201
|
+
if (err) throw err;
|
|
202
|
+
resolve(result);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
203
205
|
|
|
204
206
|
const applyPostProcessing = ({
|
|
205
207
|
css
|
package/dist/serve/index.js
CHANGED
|
@@ -25,8 +25,7 @@ var _browserSync = require("browser-sync");
|
|
|
25
25
|
var _ = require("..");
|
|
26
26
|
|
|
27
27
|
const browserSync = (0, _browserSync.create)();
|
|
28
|
-
const port = 4000;
|
|
29
|
-
|
|
28
|
+
const port = 4000;
|
|
30
29
|
const debounceSpeed = 500;
|
|
31
30
|
|
|
32
31
|
const config = build => url => () => {
|
|
@@ -50,47 +49,54 @@ let update = async () => {};
|
|
|
50
49
|
|
|
51
50
|
const reload = () => update().then(browserSync.reload);
|
|
52
51
|
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
52
|
+
const browserSyncPlugins = [{
|
|
53
|
+
module: 'bs-html-injector',
|
|
54
|
+
options: {
|
|
55
|
+
files: [{
|
|
56
|
+
match: [_path.default.resolve('_project', '**', '*.scss'), _path.default.resolve('_project', '**', '*.js'), _path.default.resolve('_project', '**', '*.md')],
|
|
57
|
+
fn: (0, _debounce.default)(() => reload(), debounceSpeed, {
|
|
58
|
+
leading: false,
|
|
59
|
+
trailing: true
|
|
60
|
+
})
|
|
61
|
+
}]
|
|
62
|
+
}
|
|
63
|
+
}];
|
|
64
|
+
|
|
65
|
+
const browserSyncMiddleware = (req, res, next) => {
|
|
66
|
+
// Set headers for XHTML files to allow document.write
|
|
67
|
+
if (/\.xhtml$/.test(req.url)) {
|
|
68
|
+
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
next();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const init = build => new _promise.default(resolve => {
|
|
75
|
+
const options = {
|
|
76
|
+
port,
|
|
77
|
+
open: false,
|
|
78
|
+
// Opens browser programatically below
|
|
79
|
+
// reloadDelay: 2000
|
|
80
|
+
// reloadDebounce: 2000
|
|
81
|
+
// reloadThrottle: 2000
|
|
82
|
+
server: {
|
|
83
|
+
baseDir: _path.default.resolve(`project-${build}`),
|
|
84
|
+
middleware: browserSyncMiddleware
|
|
85
|
+
},
|
|
86
|
+
plugins: browserSyncPlugins
|
|
87
|
+
};
|
|
88
|
+
browserSync.init(options, resolve);
|
|
89
|
+
});
|
|
84
90
|
|
|
85
91
|
const serve = async ({
|
|
86
|
-
build,
|
|
92
|
+
build: buildOption,
|
|
87
93
|
external
|
|
88
94
|
}) => {
|
|
89
95
|
const location = external ? 'external' : 'local';
|
|
90
|
-
const
|
|
91
|
-
await init(
|
|
96
|
+
const build = buildOption ?? 'reader';
|
|
97
|
+
await init(build);
|
|
92
98
|
const url = browserSync.getOption('urls').get(location);
|
|
93
|
-
update = config(
|
|
99
|
+
update = config(build)(url);
|
|
94
100
|
await update(); // Update the location in the config object so that a call can be made
|
|
95
101
|
// to openBrowser once the project has been built
|
|
96
102
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-tasks",
|
|
3
|
-
"version": "1.2.13-react-reader.
|
|
3
|
+
"version": "1.2.13-react-reader.71+e04d2b4b",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime-corejs3": "^7.10.5",
|
|
22
|
-
"@canopycanopycanopy/b-ber-lib": "1.2.
|
|
23
|
-
"@canopycanopycanopy/b-ber-logger": "1.2.
|
|
24
|
-
"@canopycanopycanopy/b-ber-markdown-renderer": "1.2.
|
|
25
|
-
"@canopycanopycanopy/b-ber-reader": "1.2.13-react-reader.
|
|
26
|
-
"@canopycanopycanopy/b-ber-resources": "1.2.
|
|
27
|
-
"@canopycanopycanopy/b-ber-shapes-sequences": "1.2.
|
|
28
|
-
"@canopycanopycanopy/b-ber-templates": "1.2.
|
|
29
|
-
"@canopycanopycanopy/b-ber-validator": "1.2.
|
|
22
|
+
"@canopycanopycanopy/b-ber-lib": "1.2.13-react-reader.71+e04d2b4b",
|
|
23
|
+
"@canopycanopycanopy/b-ber-logger": "1.2.13-react-reader.71+e04d2b4b",
|
|
24
|
+
"@canopycanopycanopy/b-ber-markdown-renderer": "1.2.13-react-reader.71+e04d2b4b",
|
|
25
|
+
"@canopycanopycanopy/b-ber-reader": "1.2.13-react-reader.71+e04d2b4b",
|
|
26
|
+
"@canopycanopycanopy/b-ber-resources": "1.2.13-react-reader.71+e04d2b4b",
|
|
27
|
+
"@canopycanopycanopy/b-ber-shapes-sequences": "1.2.13-react-reader.71+e04d2b4b",
|
|
28
|
+
"@canopycanopycanopy/b-ber-templates": "1.2.13-react-reader.71+e04d2b4b",
|
|
29
|
+
"@canopycanopycanopy/b-ber-validator": "1.2.13-react-reader.71+e04d2b4b",
|
|
30
30
|
"autoprefixer": "^9.6.1",
|
|
31
31
|
"browser-sync": "^2.27.7",
|
|
32
32
|
"bs-html-injector": "^3.0.3",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"url": "https://maxwellsimmer.com"
|
|
77
77
|
}
|
|
78
78
|
],
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "e04d2b4bfe7d4553e6c2fc90128ae4ae91715d4d"
|
|
80
80
|
}
|