Skip to content

[p5.js 2.0] Update dependencies and fix package.json 'exports' field #7762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev-2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@vitest/browser": "^2.1.5",
"all-contributors-cli": "^6.19.0",
"concurrently": "^8.2.2",
"dayjs": "^1.11.10",
"documentation": "^14.0.3",
"eslint": "^8.54.0",
"husky": "^4.2.3",
Expand All @@ -68,7 +67,7 @@
"license": "LGPL-2.1",
"browser": "./lib/p5.min.js",
"exports": {
"./": "./src/app.js",
".": "./src/app.js",
"./core": "./src/core/main.js",
"./shape": "./src/shape/index.js",
"./accessibility": "./src/accessibility/index.js",
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { string } from 'rollup-plugin-string';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import pkg from './package.json' with { type: 'json' };
import dayjs from 'dayjs';
import { visualizer } from 'rollup-plugin-visualizer';
import replace from '@rollup/plugin-replace';
import alias from '@rollup/plugin-alias';
import { createBanner } from './utils/banner.mjs';

const plugins = [
commonjs(),
Expand All @@ -23,7 +23,7 @@ const plugins = [
preventAssignment: true
})
];
const banner = `/*! p5.js v${pkg.version} ${dayjs().format('MMMM D, YYYY')} */`;
const banner = createBanner(pkg.version);
const bundleSize = (name, sourcemap) => {
return visualizer({
filename: `analyzer/${name}.html`,
Expand Down Expand Up @@ -76,7 +76,7 @@ const generateModuleBuild = () => {
plugins: [
...plugins
]
}
};
});
};

Expand Down
19 changes: 19 additions & 0 deletions utils/banner.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const months = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
];

export const createBanner = (version) => {
const date = new Date();
return `/*! p5.js v${version} ${months[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()} */`;
};