@canopycanopycanopy/b-ber-tasks 1.2.13-react-reader.64 → 1.2.13-react-reader.70

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.
@@ -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: ['last 2 versions', '> 2%'],
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 => _sass.default.render({
186
- // Importer allows use of '~' to denote node_modules directory in SCSS files
187
- importer: (url, _file, done) => {
188
- const file = url[0] === '~' ? resolveImportedModule(url) : url;
189
- return done({
190
- file
191
- });
192
- },
193
- // Add build vars at runtime with the SCSS buffer (which is transformed
194
- // to string in the backticks)
195
- data: `$build: "${_State.default.build}";${scssString}`,
196
- includePaths: [_State.default.src.stylesheets(), _path.default.dirname(_State.default.theme.entry), _path.default.dirname(_path.default.dirname(_State.default.theme.entry))],
197
- outputStyle: _State.default.env === 'production' ? 'compressed' : 'expanded',
198
- errLogToConsole: true
199
- }, (err, result) => {
200
- if (err) throw err;
201
- resolve(result);
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
@@ -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; // getRandomInt(4000, 5000)
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 init = build => new _promise.default(resolve => browserSync.init({
54
- port,
55
- open: false,
56
- // Opens browser programatically below
57
- // reloadDelay: 2000
58
- // reloadDebounce: 2000
59
- // reloadThrottle: 2000
60
- server: {
61
- baseDir: _path.default.resolve(`project-${build}`),
62
- middleware: (req, res, next) => {
63
- // Set headers for XHTML files to allow document.write
64
- if (/\.xhtml$/.test(req.url)) {
65
- res.setHeader('Content-Type', 'text/html; charset=UTF-8');
66
- }
67
-
68
- next();
69
- }
70
- },
71
- plugins: [{
72
- module: 'bs-html-injector',
73
- options: {
74
- files: [{
75
- match: [_path.default.resolve('_project', '**', '*.scss'), _path.default.resolve('_project', '**', '*.js'), _path.default.resolve('_project', '**', '*.md')],
76
- fn: (0, _debounce.default)(() => reload(), debounceSpeed, {
77
- leading: false,
78
- trailing: true
79
- })
80
- }]
81
- }
82
- }]
83
- }, resolve));
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 build_ = build ?? 'reader';
91
- await init(build_);
96
+ const build = buildOption ?? 'reader';
97
+ await init(build);
92
98
  const url = browserSync.getOption('urls').get(location);
93
- update = config(build_)(url);
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.64+d46c0879",
3
+ "version": "1.2.13-react-reader.70+b3ae07bb",
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.15",
23
- "@canopycanopycanopy/b-ber-logger": "1.2.12",
24
- "@canopycanopycanopy/b-ber-markdown-renderer": "1.2.15",
25
- "@canopycanopycanopy/b-ber-reader": "1.2.13-react-reader.64+d46c0879",
26
- "@canopycanopycanopy/b-ber-resources": "1.2.12",
27
- "@canopycanopycanopy/b-ber-shapes-sequences": "1.2.12",
28
- "@canopycanopycanopy/b-ber-templates": "1.2.15",
29
- "@canopycanopycanopy/b-ber-validator": "1.2.12",
22
+ "@canopycanopycanopy/b-ber-lib": "1.2.13-react-reader.70+b3ae07bb",
23
+ "@canopycanopycanopy/b-ber-logger": "1.2.13-react-reader.70+b3ae07bb",
24
+ "@canopycanopycanopy/b-ber-markdown-renderer": "1.2.13-react-reader.70+b3ae07bb",
25
+ "@canopycanopycanopy/b-ber-reader": "1.2.13-react-reader.70+b3ae07bb",
26
+ "@canopycanopycanopy/b-ber-resources": "1.2.13-react-reader.70+b3ae07bb",
27
+ "@canopycanopycanopy/b-ber-shapes-sequences": "1.2.13-react-reader.70+b3ae07bb",
28
+ "@canopycanopycanopy/b-ber-templates": "1.2.13-react-reader.70+b3ae07bb",
29
+ "@canopycanopycanopy/b-ber-validator": "1.2.13-react-reader.70+b3ae07bb",
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": "d46c08797de554f0faf90c3c02300a9079fbb5e6"
79
+ "gitHead": "b3ae07bbd734c38412891b1587c6d05e1057d874"
80
80
  }