diff --git a/babel.config.json b/babel.config.json index 73d72ef..4cf66da 100644 --- a/babel.config.json +++ b/babel.config.json @@ -5,7 +5,6 @@ ["@babel/preset-env", { "modules": false }] ], "plugins": [ - "@babel/plugin-proposal-class-properties", "styled-jsx/babel" ] } diff --git a/package.json b/package.json index a571673..9807a47 100644 --- a/package.json +++ b/package.json @@ -14,18 +14,18 @@ "build:rollup": "run-p rollup:*", "build:components": "NODE_ENV=production babel ./src/components --out-dir ./dist/components", "build:helpers": "NODE_ENV=production babel ./src/constants.js -o ./dist/constants.js && NODE_ENV=production babel ./src/utils.js -o ./dist/utils.js && NODE_ENV=production babel ./src/server-utils.js -o ./dist/server-utils.js && NODE_ENV=production babel ./src/fullcalendar-to-ics.js -o ./dist/fullcalendar-to-ics.js", - "rollup:node": "rollup -c", - "rollup:bundle": "rollup -c rollup.config.bundle.js", - "rollup:server": "rollup -c rollup.config.server.js", + "rollup:node": "rollup --bundleConfigAsCjs -c", + "rollup:bundle": "rollup --bundleConfigAsCjs -c rollup.config.bundle.js", + "rollup:server": "rollup --bundleConfigAsCjs -c rollup.config.server.js", "watch": "npm-run-all clean --parallel watch:*", "watch:webpack": "webpack --progress --color --watch --mode development", "watch:rollup": "run-p rollup-watch:*", "watch:components": "NODE_ENV=production babel ./src/components --watch --out-dir ./dist/components", "watch:constants": "NODE_ENV=production babel ./src/constants.js --watch -o ./dist/constants.js", "watch:utils": "NODE_ENV=production babel ./src/utils.js --watch -o ./dist/utils.js", - "rollup-watch:node": "rollup -cw", - "rollup-watch:bundle": "rollup -c rollup.config.bundle.js -w", - "rollup-watch:server": "rollup -c rollup.config.server.js -w", + "rollup-watch:node": "rollup --bundleConfigAsCjs -cw", + "rollup-watch:bundle": "rollup --bundleConfigAsCjs -c rollup.config.bundle.js -w", + "rollup-watch:server": "rollup --bundleConfigAsCjs -c rollup.config.server.js -w", "clean": "rm -rf ./dist ./public ; mkdir -p dist", "lint": "eslint src", "analyze:bundle": "webpack-bundle-analyzer ./public/js/stats.json", @@ -40,12 +40,11 @@ "type": "git" }, "engines": { - "node": ">6.8.1" + "node": ">=22.0.0" }, "browserslist": [ - "> 1%", - "last 2 versions", - "IE 9" + "defaults and fully supports es6-module", + "maintained node versions" ], "author": "Jacob Mischka ", "license": "MIT", @@ -58,11 +57,12 @@ "ical.js": "^2.1.0", "iframe-resizer": "^5.3.2", "jquery": "^3.7.1", + "linkify-html": "^4.2.0", "linkifyjs": "^4.2.0", "localforage": "^1.10.0", "lodash": "^4.17.21", "moment-timezone": "^0.5.46", - "node-fetch": "^3.3.2", + "node-fetch": "^2.7.0", "prop-types": "^15.8.1", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -77,15 +77,19 @@ "@babel/cli": "^7.26.4", "@babel/core": "^7.26.0", "@babel/plugin-external-helpers": "^7.25.9", - "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/preset-env": "^7.26.0", "@babel/preset-flow": "^7.25.9", "@babel/preset-react": "^7.26.3", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-buble": "^1.0.3", + "@rollup/plugin-commonjs": "^28.0.1", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.3.0", "apply-loader": "^2.0.0", "autoprefixer": "^10.4.20", "babel-eslint": "^10.1.0", "babel-loader": "^9.2.1", - "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-class-properties": "^6.10.2", "classlist-polyfill": "^1.2.0", "core-js": "^3.39.0", "css-loader": "^7.1.2", @@ -99,16 +103,12 @@ "html-webpack-plugin": "^5.6.3", "in-publish": "^2.0.1", "mini-css-extract-plugin": "^2.9.2", + "node-polyfill-webpack-plugin": "^4.1.0", "nodemon": "^3.1.7", "npm-run-all": "^4.1.5", "raf": "^3.4.1", "regenerator-runtime": "^0.14.1", "rollup": "^4.28.1", - "rollup-plugin-babel": "^4.4.0", - "rollup-plugin-buble": "^0.19.8", - "rollup-plugin-commonjs": "^10.1.0", - "rollup-plugin-json": "^4.0.0", - "rollup-plugin-node-resolve": "^5.2.0", "style-loader": "^4.0.0", "url-search-params-polyfill": "^8.2.5", "webpack": "^5.97.1", diff --git a/rollup.config.bundle.js b/rollup.config.bundle.js index 4e5ba63..345fb51 100644 --- a/rollup.config.bundle.js +++ b/rollup.config.bundle.js @@ -1,8 +1,8 @@ import * as path from 'path'; -import commonjs from 'rollup-plugin-commonjs'; -import nodeResolve from 'rollup-plugin-node-resolve'; -import json from 'rollup-plugin-json'; -import babel from 'rollup-plugin-babel'; +import commonjs from '@rollup/plugin-commonjs'; +import nodeResolve from '@rollup/plugin-node-resolve'; +import json from '@rollup/plugin-json'; +import babel from '@rollup/plugin-babel'; export default { input: './src/index.js', diff --git a/rollup.config.js b/rollup.config.js index 72376b7..f6537ef 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,6 @@ import * as path from 'path'; -import json from 'rollup-plugin-json'; -import babel from 'rollup-plugin-babel'; +import json from '@rollup/plugin-json'; +import babel from '@rollup/plugin-babel'; export default { input: './src/index.js', @@ -23,6 +23,6 @@ export default { external: [ path.resolve('./.env.json'), 'ical.js' - ], - preferConst: true + ] + //preferConst: true }; diff --git a/rollup.config.server.js b/rollup.config.server.js index 34216d1..5434133 100644 --- a/rollup.config.server.js +++ b/rollup.config.server.js @@ -1,6 +1,6 @@ -import commonjs from 'rollup-plugin-commonjs'; -import json from 'rollup-plugin-json'; -import babel from 'rollup-plugin-babel'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import babel from '@rollup/plugin-babel'; export default { input: './src/server.js', @@ -22,6 +22,6 @@ export default { 'body-parser', 'color-string', 'moment' - ], - preferConst: true + ] + //preferConst: true }; diff --git a/src/components/CalendarEvent.js b/src/components/CalendarEvent.js index 31495e7..e8692aa 100644 --- a/src/components/CalendarEvent.js +++ b/src/components/CalendarEvent.js @@ -4,7 +4,7 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; import Color from "color"; import striptags from "striptags"; -import linkifyHtml from 'linkifyjs/html'; +import linkifyHtml from 'linkify-html'; import MapPin from "react-feather/dist/icons/map-pin.js"; import User from "react-feather/dist/icons/user.js"; diff --git a/src/components/FullCalendar.js b/src/components/FullCalendar.js index 074d4d5..52ca4d7 100644 --- a/src/components/FullCalendar.js +++ b/src/components/FullCalendar.js @@ -5,8 +5,8 @@ import Color from 'color'; import $ from 'jquery'; import 'fullcalendar'; -import 'fullcalendar/dist/gcal.js'; -import 'fullcalendar/dist/fullcalendar.css'; +//import 'fullcalendar/dist/gcal.js'; +//import 'fullcalendar/dist/fullcalendar.css'; import uniqueId from 'lodash/uniqueId'; import CalendarEvent from './CalendarEvent.js'; diff --git a/webpack.config.js b/webpack.config.cjs similarity index 84% rename from webpack.config.js rename to webpack.config.cjs index afac6d8..e85ad7d 100644 --- a/webpack.config.js +++ b/webpack.config.cjs @@ -4,6 +4,7 @@ const webpack = require('webpack'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +const NodePolyfillPlugin = require("node-polyfill-webpack-plugin"); module.exports = (env, argv) => ({ entry: { @@ -64,7 +65,10 @@ module.exports = (env, argv) => ({ ] }, plugins: [ - new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + new webpack.IgnorePlugin({resourceRegExp: /^\.\/locale$/, contextRegExp: /moment$/}), + new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => { + resource.request = resource.request.replace(/^node:/, ""); + }), new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true, @@ -80,7 +84,8 @@ module.exports = (env, argv) => ({ title: 'Calendar', template: './src/index.ejs', xhtml: true - }) + }), + new NodePolyfillPlugin() ], devtool: 'source-map', devServer: {