Browse Source

Update rollup plugins, fix json import and license url

update_rollup_plugins
Fred Chasen 2 years ago
parent
commit
927fb83825
  1. 2
      Dockerfile
  2. 8918
      package-lock.json
  3. 43
      package.json
  4. 8
      rollup.config.js
  5. 6
      specs/jest_helpers/pdf_snapshot.js
  6. 4
      specs/jest_helpers/puppeteer_environment.js
  7. 4
      specs/jest_helpers/teardown.js

2
Dockerfile

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.31.1-focal
FROM mcr.microsoft.com/playwright:v1.32.3-focal
# Application parameters and variables
ENV NODE_ENV=development

8918
package-lock.json generated

File diff suppressed because it is too large Load Diff

43
package.json

@ -17,34 +17,35 @@
},
"dependencies": {
"@babel/polyfill": "^7.10.1",
"@babel/runtime": "^7.17.8",
"@babel/runtime": "^7.21.0",
"clear-cut": "^2.0.2",
"css-tree": "^1.1.3",
"event-emitter": "^0.3.5",
"rollup-plugin-terser": "^7.0.2"
"event-emitter": "^0.3.5"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/plugin-proposal-async-generator-functions": "^7.16.8",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.18.2",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@babel/cli": "^7.21.0",
"@babel/core": "^7.21.4",
"@babel/plugin-proposal-async-generator-functions": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-terser": "^0.4.1",
"babel-plugin-replace-import-extension": "^1.1.3",
"chalk": "^5.0.1",
"eslint": "^8.12.0",
"express": "^4.17.3",
"jest": "^27.5.1",
"jest-image-snapshot": "^4.5.1",
"playwright-core": "^1.31.1",
"rimraf": "^3.0.2",
"rollup": "^2.70.1",
"rollup-plugin-license": "^2.6.1",
"chalk": "^5.2.0",
"eslint": "^8.38.0",
"express": "^4.18.2",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-image-snapshot": "^6.1.0",
"playwright-core": "^1.32.3",
"rimraf": "^5.0.0",
"rollup": "^3.20.6",
"rollup-plugin-license": "^3.0.1",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-serve": "^1.1.0"
"rollup-plugin-serve": "^2.0.2"
},
"scripts": {
"build": "rollup -c",

8
rollup.config.js

@ -1,10 +1,12 @@
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import { terser } from "rollup-plugin-terser";
import terser from "@rollup/plugin-terser";
import license from "rollup-plugin-license";
import pkg from "./package.json";
import pkg from "./package.json" assert {
type: 'json'
};
const plugins = [
nodeResolve({
@ -15,7 +17,7 @@ const plugins = [
}),
json(),
license({
banner: "@license Paged.js v<%= pkg.version %> | MIT | https://gitlab.pagedmedia.org/tools/pagedjs",
banner: "@license Paged.js v<%= pkg.version %> | MIT | https://gitlab.coko.foundation/pagedjs/pagedjs",
})
];

6
specs/jest_helpers/pdf_snapshot.js

@ -2,7 +2,7 @@ import { toMatchImageSnapshot } from "jest-image-snapshot";
import path from "path";
import gs from "ghostscript4js";
import fs from "fs";
import rimraf from "rimraf";
import { rimrafSync } from "rimraf";
import { DEBUG } from "./constants.js";
function toMatchPDFSnapshot(received, page=1) {
@ -22,8 +22,8 @@ function toMatchPDFSnapshot(received, page=1) {
pdfImage = fs.readFileSync(imagePath);
// remove output
if (!DEBUG) {
rimraf.sync(imagePath);
// rimraf.sync(pdfPath);
rimrafSync(imagePath);
// rimrafSync(pdfPath);
}
const config = {};

4
specs/jest_helpers/puppeteer_environment.js

@ -1,11 +1,11 @@
import chalk from "chalk";
import NodeEnvironment from "jest-environment-node";
import { TestEnvironment } from "jest-environment-node";
// import puppeteer from "puppeteer";
import { chromium } from "playwright-core";
import fs from "fs";
import { WS_ENDPOINT_PATH, DEBUG, ORIGIN, PDF_SETTINGS } from "./constants.js";
class PuppeteerEnvironment extends NodeEnvironment {
class PuppeteerEnvironment extends TestEnvironment {
constructor(config) {
super(config);
}

4
specs/jest_helpers/teardown.js

@ -3,7 +3,7 @@
// const { DIR, DEBUG } = require("./constants");
import chalk from "chalk";
import rimraf from "rimraf";
import { rimrafSync } from "rimraf";
import { DIR, DEBUG } from "./constants.js";
export default async function() {
@ -13,5 +13,5 @@ export default async function() {
await global.browser.close();
global.server.close();
}
rimraf.sync(DIR);
rimrafSync(DIR);
}

Loading…
Cancel
Save