Skip to content

Commit

Permalink
enhancement/Issue-1087: Upgrade Rollup to latest 3.x.x (#1187)
Browse files Browse the repository at this point in the history
* Issue-1087: Initial upgrade of Rollup and @rollup plugins

* Issue-1087: Upgrade plugin dependencies

* upgrade all test cases with new hash matchers

* update all plugin rollup deps and breaking change updates

* fix duplicate imports of eve-container custom element definition

---------

Co-authored-by: Owen Buckley <owenbuckley13@gmail.com>
  • Loading branch information
DevLab2425 and thescientist13 committed May 31, 2024
1 parent c04eb90 commit 4bf08a2
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 123 deletions.
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"access": "public"
},
"dependencies": {
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-terser": "^0.1.0",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"acorn": "^8.0.1",
"acorn-walk": "^8.0.0",
"commander": "^2.20.0",
Expand All @@ -50,7 +50,7 @@
"remark-frontmatter": "^2.0.0",
"remark-parse": "^8.0.3",
"remark-rehype": "^7.0.0",
"rollup": "^2.58.0",
"rollup": "^3.29.4",
"unified": "^9.2.0",
"wc-compiler": "~0.11.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ describe('Build Greenwood With: ', function() {
});

it('should have the expected lit related files in the output directory', async function() {
expect(await glob.promise(path.join(this.context.publicDir, 'lit-element.*.js'))).to.have.lengthOf(1);
expect(await glob.promise(path.join(this.context.publicDir, 'lit*.js'))).to.have.lengthOf(1);
});

it('should have the expected inline node_modules content in the first inline script', async function() {
const inlineScriptTag = Array.from(dom.window.document.querySelectorAll('head > script:not([src])')).filter(tag => !tag.getAttribute('data-gwd'))[0];

expect(inlineScriptTag.textContent.replace(/\n/g, '')).to
.equal('import"/lit-element.ae169679.js";import"/lit-html.7f7a9139.js";//# sourceMappingURL=116321042.6c5eb91c.js.map');
.equal('import"/116321042.262925e6.js";import"/lit-html.71ac31d8.js";//# sourceMappingURL=116321042.f667a8c7.js.map');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Serve Greenwood With: ', function() {
const publicPath = path.join(outputPath, 'public/');
const hostname = 'http://127.0.0.1:8080';
const basePath = '/my-path';
const jsHash = '4bcc801e';
const jsHash = '2ce3f02d';
const cssHash = '1454013616';
let runner;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ describe('Serve Greenwood With: ', function() {
});

describe('Bundled image using new URL and import.meta.url', function() {
const bundledName = 'assets/logo-abb2e884.svg';
const bundledName = 'assets/logo-619de195.svg';
let response = {};
let body;
let usersResponse = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@babel/core": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-babel": "^6.0.4",
"core-js": "^3.4.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-babel/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const greenwoodPluginBabel = (options = {}) => {
type: 'rollup',
name: 'plugin-babel:rollup',
provider: (compilation) => [
rollupBabelPlugin.default({
rollupBabelPlugin({
// https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
babelHelpers: 'bundled',

Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-import-commonjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"@greenwood/cli": "^0.4.0"
},
"dependencies": {
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/stream": "^2.0.0",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/stream": "^3.0.1",
"cjs-module-lexer": "^1.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ describe('Build Greenwood With: ', function() {
it('should have the expected CommonJS contents from main.js (lodash) in the output', async function() {
const contents = fs.readFileSync(scripts[0], 'utf-8');

expect(contents).to.contain('n=e,t=e.exports,function()');
expect(contents).to.contain('document.getElementsByTagName("span")[0].innerHTML=`import from lodash ${i}`;');
expect(contents).to.contain('r=u,e=u.exports,function()');
expect(contents).to.contain('document.getElementsByTagName("span")[0].innerHTML=`import from lodash ${o}`');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ describe('Build Greenwood With: ', function() {

expect(inlineScriptTag.textContent.replace('\n', '')).to
// eslint-disable-next-line max-len
.contain('import"/lit-element.6ff69bae.js";document.getElementsByClassName("output-script-inline")[0].innerHTML="script tag module inline";//# sourceMappingURL=');
.contain('import"/lit-element.76be1f9d.js";document.getElementsByClassName("output-script-inline")[0].innerHTML="script tag module inline";//# sourceMappingURL=1635690801.3e40c728.js.map');
});

it('should have prerendered content from <app-header> component', function() {
Expand Down
1 change: 0 additions & 1 deletion www/components/banner/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { css, html, LitElement, unsafeCSS } from 'lit';
import bannerCss from './banner.css?type=css';
import buttonCss from './button.css?type=css';
import './eve-button.js';
import '@evergreen-wc/eve-container';

class Banner extends LitElement {
constructor() {
Expand Down
1 change: 0 additions & 1 deletion www/components/header/header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css, html, LitElement, unsafeCSS } from 'lit';
import client from '@greenwood/plugin-graphql/src/core/client.js';
import MenuQuery from '@greenwood/plugin-graphql/src/queries/menu.gql';
import '@evergreen-wc/eve-container';
import headerCss from './header.css?type=css';
import '../social-icons/social-icons.js';

Expand Down
Loading

0 comments on commit 4bf08a2

Please sign in to comment.