@data-visuals/create 7.4.3 → 7.4.5

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 CHANGED
@@ -27,6 +27,8 @@ npm start
27
27
 
28
28
  > While you can install `@data-visuals/create` globally and use the `data-visuals-create` command, we recommend using the `npx` method instead to ensure you are always using the latest version. On `npm` and `npx` versions >= 7.0.0, `@latest` is required to fetch the latest version.
29
29
 
30
+ Note that after July 2023, `data-visuals-create` only supports [Node.js version 17 or later](https://nodejs.org/en). We recommend upgrading to 18 or later, however, because version 17 has reached the end of its life.
31
+
30
32
  ## Table of contents
31
33
 
32
34
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
@@ -251,11 +253,11 @@ By default, Nunjucks has access to every file in our `data/` folder as an object
251
253
  ```json
252
254
  {
253
255
  "text": {
254
- "title": "Phasellus venenatis dapibus ante, vel sodales sem blandit sed.",
256
+ "title": "Phasellus venenatis dapibus ante, vel sodales sem blandit sed."
255
257
  },
256
258
  "data": {
257
259
  "keyvalue_sheet": {
258
- "key1": "value1",
260
+ "key1": "value1"
259
261
  }
260
262
  }
261
263
  }
@@ -309,8 +311,8 @@ Because there's a lot more going on behind the scenes than just adding a `<scrip
309
311
  Set `jsPackName` anywhere in the HTML file to the name of your entrypoint (**without** the extension) to route the right JavaScript files to it.
310
312
 
311
313
  ```html
312
- {% set jsPackName = 'map' %}
313
- {# This is now using the new entrypoint we created above #}
314
+ {% set jsPackName = 'map' %} {# This is now using the new entrypoint we created
315
+ above #}
314
316
  ```
315
317
 
316
318
  Pack entrypoints can be used multiple times across multiple pages, so if your code allows for it feel free to add an entrypoint to multiple pages. (You can also add `jsPackName` to the base `app/templates/base.html` file and have it inserted in every page that inherits from it).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-visuals/create",
3
- "version": "7.4.3",
3
+ "version": "7.4.5",
4
4
  "description": "Create graphics and features the Data Visuals way.",
5
5
  "scripts": {
6
6
  "build:docs": "doctoc README.md --github",
@@ -1 +1,2 @@
1
1
  puppeteer_skip_chromium_download=true
2
+ # engine-strict=true
@@ -4,16 +4,15 @@
4
4
  "scripts": {
5
5
  "assets:pull": "node ./utils/deployment/pull-assets.js",
6
6
  "assets:push": "node ./utils/deployment/push-assets.js",
7
- "build": "NODE_OPTIONS=$npm_package_config_NODE_OPTIONS NODE_ENV=production node ./config/scripts/build.js && npm run parse",
7
+ "build": "node ./config/tasks/check-node-versions.js && NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production node ./config/scripts/build.js && npm run parse",
8
8
  "deploy": "node ./utils/deployment/deploy.js",
9
9
  "data:fetch": "node ./utils/fetch/get-data.js",
10
10
  "git-pre-commit": "precise-commits",
11
- "parse": "npm run set-node-options && NODE_OPTIONS=$npm_package_config_NODE_OPTIONS NODE_ENV=development node config/scripts/parse.js",
11
+ "parse": "node ./config/tasks/check-node-versions.js && NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=development node config/scripts/parse.js",
12
12
  "predeploy": "npm run build && npm run assets:push && npm run workspace:push",
13
13
  "preinstall": "node ./config/build/yarn-check.js",
14
14
  "serve": "npm start",
15
- "set-node-options": "node ./config/tasks/set-node-options.js",
16
- "start": "npm run set-node-options && NODE_OPTIONS=$npm_package_config_NODE_OPTIONS NODE_ENV=development node ./config/scripts/develop.js",
15
+ "start": "node ./config/tasks/check-node-versions.js && NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=development node ./config/scripts/develop.js",
17
16
  "workspace:pull": "node ./utils/deployment/pull-workspace.js",
18
17
  "workspace:push": "node ./utils/deployment/push-workspace.js"
19
18
  },
@@ -64,7 +63,7 @@
64
63
  "postcss": "^8.4.12",
65
64
  "postcss-flexbugs-fixes": "^4.1.0",
66
65
  "prettier": "^1.12.1",
67
- "puppeteer": "^5.5.0",
66
+ "puppeteer": "^19.4.0",
68
67
  "purgecss": "^2.1.2",
69
68
  "quaff": "^4.0.0",
70
69
  "rev-file": "^3.0.0",
@@ -80,7 +79,7 @@
80
79
  "dependencies": {
81
80
  "@babel/runtime": "^7.0.0",
82
81
  "@newswire/frames": "^0.3.1",
83
- "@texastribune/queso-ui": "^9.4.2",
82
+ "@texastribune/queso-ui": "^10.3.2",
84
83
  "classnames": "^2.2.5",
85
84
  "core-js": "^2.5.7",
86
85
  "d3": "^5.0.0",
@@ -100,5 +99,8 @@
100
99
  "tabWidth": 2,
101
100
  "trailingComma": "es5"
102
101
  },
103
- "browserslist": ["> 0.5%", "last 2 versions", "Firefox ESR", "not dead"]
102
+ "browserslist": ["> 0.5%", "last 2 versions", "Firefox ESR", "not dead"],
103
+ "engines": {
104
+ "node": ">=17.0.0"
105
+ }
104
106
  }
@@ -0,0 +1,19 @@
1
+ // packages
2
+ const colors = require('ansi-colors');
3
+
4
+ // get node versions
5
+ const version = process.version;
6
+ const versionNumeric = Number(process.versions.node.split('.')[0]);
7
+
8
+ // show this error message if the node version is 16 or older
9
+ if (versionNumeric <= 16) {
10
+ console.log(
11
+ `\n\n${colors.bgMagenta('ERROR!')} You are using node version ${colors.bold(
12
+ colors.red(version)
13
+ )}.\ndata-visuals-create only supports node versions 18 or later.\nUpdate your node version by running ${colors.bold(
14
+ colors.yellow('nvm install 18')
15
+ )} or ${colors.bold(
16
+ colors.yellow('nvm install node')
17
+ )} in your command line.\n\n`
18
+ );
19
+ }
@@ -281,6 +281,7 @@ module.exports = async localURL => {
281
281
  const browser = await puppeteer
282
282
  .launch({
283
283
  executablePath: process.env.CHROME_INSTALL_PATH || CHROME_INSTALL_PATH,
284
+ headless: 'new',
284
285
  })
285
286
  .catch(err => {
286
287
  logErrorMessage(err);
@@ -1,16 +0,0 @@
1
- // package
2
- const fs = require('fs');
3
-
4
- // internal
5
- const packageJson = require('../../package.json');
6
-
7
- // set package.json config object
8
- packageJson.config = {};
9
-
10
- // get node version in order to update NODE_OPTIONS environment variable
11
- const version = Number(process.versions.node.split('.')[0]);
12
- packageJson.config.NODE_OPTIONS =
13
- version <= 16 ? '' : '--openssl-legacy-provider';
14
-
15
- // update package.json file
16
- fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2));