Skip to content

Commit

Permalink
Merge pull request #57 from upsetjs/sgratzl/upgrade
Browse files Browse the repository at this point in the history
update dependencies + patch and inline fmin
  • Loading branch information
sgratzl authored Nov 17, 2024
2 parents 7fe2f73 + 56f2888 commit 60182ad
Show file tree
Hide file tree
Showing 15 changed files with 3,144 additions and 4,605 deletions.
File renamed without changes.
46 changes: 46 additions & 0 deletions .yarn/patches/fmin-npm-0.0.4-e439f499bd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/build/fmin.js b/build/fmin.js
index da5504ab16463811c1aff42ac0458ca6b7378d28..506ceefaef866275ea1f48b34384fd99756ba042 100644
--- a/build/fmin.js
+++ b/build/fmin.js
@@ -209,7 +209,7 @@
if (sigma >= 1) break;

// do a reduction
- for (i = 1; i < simplex.length; ++i) {
+ for (let i = 1; i < simplex.length; ++i) {
weightedSum(simplex[i], 1 - sigma, simplex[0], sigma, simplex[i]);
simplex[i].fx = f(simplex[i]);
}
diff --git a/package.json b/package.json
index 9378ea45918a9879f0daf01b5742416cb84fd774..5d9e373425655c66193e5c490b8be5d09349225a 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,6 @@
"name": "fmin",
"version": "0.0.4",
"description": "Unconstrained funcion minimization in Javascript",
- "type": "module",
"keywords": [
"fmin",
"optimization",
@@ -11,6 +10,7 @@
],
"license": "BSD-3-Clause",
"main": "build/fmin.js",
+ "module": "index.js",
"jsnext:main": "index",
"homepage": "https://github.com/benfred/fmin",
"repository": {
diff --git a/src/nelderMead.js b/src/nelderMead.js
index fe38e9104920d7cf77156b53f627855796b5a225..1cc99b6ff81c489f622fbea354b40759fe9e8445 100644
--- a/src/nelderMead.js
+++ b/src/nelderMead.js
@@ -129,7 +129,7 @@ export function nelderMead(f, x0, parameters) {
if (sigma >= 1) break;

// do a reduction
- for (i = 1; i < simplex.length; ++i) {
+ for (let i = 1; i < simplex.length; ++i) {
weightedSum(simplex[i], 1 - sigma, simplex[0], sigma, simplex[i]);
simplex[i].fx = f(simplex[i]);
}
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.2.2.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs
16 changes: 0 additions & 16 deletions babel.config.js

This file was deleted.

2 changes: 0 additions & 2 deletions eslint.config.mjs → eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import js from "@eslint/js";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import jest from "eslint-plugin-jest";
import globals from "globals";

export default [
js.configs.recommended,
eslintPluginPrettierRecommended,
jest.configs['flat/recommended'],
{
languageOptions: {
globals: {
Expand Down
4 changes: 0 additions & 4 deletions jest.config.js

This file was deleted.

74 changes: 38 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,21 @@
"example": "examples",
"test": "tests"
},
"main": "build/venn.js",
"type": "module",
"main": "build/venn.esm.js",
"module": "build/venn.esm.js",
"require": "build/venn.js",
"unpkg": "build/venn.min.js",
"jsdelivr": "build/venn.min.js",
"module": "build/venn.esm.js",
"types": "src/index.d.ts",
"exports": {
".": {
"import": "./build/venn.esm.js",
"require": "./build/index.js",
"scripts": "./build/venn.min.js",
"types": "./src/index.d.ts"
}
},
"sideEffects": false,
"files": [
"build",
Expand All @@ -54,50 +64,42 @@
"d3-selection": "^3.0.0",
"d3-transition": "^3.0.1"
},
"dependencies": {
"fmin": "^0.0.2"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@eslint/js": "^9.4.0",
"@babel/core": "^7.26.0",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@eslint/js": "^9.15.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@yarnpkg/sdks": "^3.1.2",
"babel-jest": "^29.7.0",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@yarnpkg/sdks": "^3.2.0",
"canvas": "^2.11.2",
"eslint": "^9.4.0",
"d3-selection": "^3.0.0",
"d3-transition": "^3.0.1",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-prettier": "^5.1.3",
"globals": "^15.4.0",
"jest": "^29.7.0",
"eslint-plugin-prettier": "^5.2.1",
"fmin": "patch:fmin@npm%3A0.0.4#~/.yarn/patches/fmin-npm-0.0.4-e439f499bd.patch",
"globals": "^15.12.0",
"jest-image-snapshot": "^6.4.0",
"prettier": "^3.3.1",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"rollup-plugin-pnp-resolve": "^2.0.0",
"uglify-es": "^3.3.9"
"jsdom": "^25.0.1",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"rollup": "^4.27.2",
"rollup-plugin-terser": "^7.0.2",
"vite": "^5.4.11",
"vitest": "^2.1.5"
},
"scripts": {
"clean": "rimraf build *.tgz",
"clean": "rimraf --glob build *.tgz",
"watch": "rollup -c -w",
"lint": "eslint src",
"test": "jest --passWithNoTests",
"test:watch": "jest --watch",
"test": "vitest --passWithNoTests",
"test:watch": "vitest --watch",
"posttest": "npm run lint",
"build:dev": "rollup -c",
"build:prod": "npm run build:dev && uglifyjs build/venn.js -c -m -o build/venn.min.js",
"prebuild": "npm run clean && npm test",
"build": "npm run build:prod",
"format": "prettier --write examples \"*.{md,json,js,yml}\" \"{.github,src,examples}/**\"",
"preversion": "npm run test",
"prepare": "npm run build:dev",
"prepublishOnly": "npm run build:prod",
"release": "release-it --disable-metrics --npm.skipChecks",
"release:pre": "release-it --disable-metrics --npm.skipChecks --preRelease=alpha --npm.tag=next"
"build": "rollup -c",
"format": "prettier --write examples \"*.{md,json,js,yml}\" \"{.github,src,examples}/**\""
},
"packageManager": "yarn@4.2.2"
"packageManager": "yarn@4.5.1"
}
17 changes: 11 additions & 6 deletions rollup.config.mjs → rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// rollup.config.js
import pnp from 'rollup-plugin-pnp-resolve';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';

import fs from 'fs';

Expand All @@ -11,13 +11,18 @@ const pkg = JSON.parse(fs.readFileSync('./package.json'));
export default [
{
input: 'src/index.js',
output: {
file: pkg.main,
output: [{
file: pkg.require,
name: 'venn',
format: 'umd',
},
}, {
file: pkg.unpkg,
name: 'venn',
format: 'umd',
plugins: [terser()]
}],
external: Object.keys(pkg.peerDependencies || {}),
plugins: [commonjs(), pnp(), resolve(), babel({ babelHelpers: 'runtime' })],
plugins: [commonjs(), resolve(), babel({ babelHelpers: 'bundled' })],
},
{
input: 'src/index.js',
Expand All @@ -26,6 +31,6 @@ export default [
format: 'esm',
},
external: Object.keys(pkg.peerDependencies || {}).concat(Object.keys(pkg.dependencies || {})),
plugins: [commonjs(), pnp(), resolve()],
plugins: [commonjs(), resolve()],
},
];
1 change: 1 addition & 0 deletions src/circleintersection.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { distance, intersectionArea, circleCircleIntersection, circleOverlap, circleArea } from './circleintersection';
import { describe, test, expect } from 'vitest';

describe('circleArea', () => {
test('empty circle test', () => {
Expand Down
1 change: 1 addition & 0 deletions src/diagram.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { computeTextCentre } from './diagram';
import { describe, test, expect } from 'vitest';

describe('computeTextCentre', () => {
test('0', () => {
Expand Down
1 change: 1 addition & 0 deletions src/layout.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { disjointCluster, normalizeSolution, greedyLayout, lossFunction, distanceFromIntersectArea } from './layout';
import { distance, circleOverlap } from './circleintersection';
import { describe, test, expect } from 'vitest';

describe('greedyLayout', () => {
test('0', () => {
Expand Down
9 changes: 9 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="vitest/config" />
import { defineConfig } from 'vite';

export default defineConfig({
test: {
environment: 'jsdom',
root: './src',
}
});
Loading

0 comments on commit 60182ad

Please sign in to comment.