Skip to content

Commit a997fa1

Browse files
authored
Merge pull request #59 from upsetjs/release/v2.0.0
Release v2.0.0
2 parents dedb118 + 8a091fb commit a997fa1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4781
-6980
lines changed

.eslintrc.js

-9
This file was deleted.

.github/dependabot.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
version: 2
22
updates:
3-
# Maintain dependencies for GitHub Actions
43
- package-ecosystem: 'github-actions'
54
directory: '/'
65
target-branch: develop
76
schedule:
8-
interval: 'daily'
9-
# Maintain dependencies for npm
10-
# - package-ecosystem: 'npm'
11-
# directory: '/'
12-
# target-branch: develop
13-
# schedule:
14-
# interval: 'daily'
7+
interval: 'monthly'
8+
- package-ecosystem: 'npm'
9+
directory: '/'
10+
target-branch: develop
11+
schedule:
12+
interval: 'monthly'

.github/release-drafter.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'enhancement'
7+
- 'feature'
8+
- title: '🐛 Bugs Fixes'
9+
labels:
10+
- 'bug'
11+
- title: 'Documentation'
12+
labels:
13+
- 'documentation'
14+
- title: '🧰 Development'
15+
labels:
16+
- 'chore'
17+
change-template: '- #$NUMBER $TITLE'
18+
change-title-escapes: '\<*_&`#@'
19+
template: |
20+
$CHANGES
21+
22+
Thanks to $CONTRIBUTORS

.github/workflows/ci.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
name: ci
22

3-
on: [push]
3+
on:
4+
- push
5+
- pull_request
46

57
jobs:
68
build:
79
runs-on: ubuntu-latest
810
steps:
9-
- uses: actions/checkout@v3
10-
- uses: actions/setup-node@v3
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
1113
with:
12-
node-version: 16
14+
node-version: 20
1315
- run: npm i -g yarn
1416
- run: yarn config set checksumBehavior ignore
1517
- name: Cache Node.js modules
16-
uses: actions/cache@v2
18+
uses: actions/cache@v4
1719
with:
1820
path: |
1921
./.yarn/cache
2022
./.yarn/unplugged
21-
key: ${{ runner.os }}-yarn2-${{ hashFiles('**/yarn.lock') }}
23+
key: ${{ runner.os }}-yarn2-v5-${{ hashFiles('**/yarn.lock') }}
2224
restore-keys: |
23-
${{ runner.os }}-yarn2-
25+
${{ runner.os }}-yarn2-v5
2426
- run: yarn install
2527
- run: yarn build
2628
- run: yarn lint
2729
- run: yarn test
28-
- uses: actions/upload-artifact@v2
30+
- uses: actions/upload-artifact@v4
2931
if: failure()
3032
with:
3133
name: diff outputs
@@ -39,7 +41,7 @@ jobs:
3941
cp build/venn.js public/build/
4042
- name: Deploy
4143
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
42-
uses: peaceiris/actions-gh-pages@v3.8.0
44+
uses: peaceiris/actions-gh-pages@v4.0.0
4345
with:
4446
github_token: ${{ secrets.GITHUB_TOKEN }}
4547
publish_dir: ./public

.github/workflows/create_release.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Create Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
versionName:
6+
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)'
7+
required: true
8+
default: patch
9+
preid:
10+
description: 'Pre Release Identifier (i.e., alpha, beta)'
11+
required: true
12+
default: alpha
13+
jobs:
14+
create_release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: main
21+
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
22+
- name: Reset main branch
23+
run: |
24+
git fetch origin dev:dev
25+
git reset --hard origin/dev
26+
- name: Change version number
27+
id: version
28+
run: |
29+
echo "next_tag=$(npm version --no-git-tag-version ${{ github.event.inputs.versionName }} --preid ${{ github.event.inputs.preid }})" >> $GITHUB_OUTPUT
30+
- name: Create pull request into main
31+
uses: peter-evans/create-pull-request@v7
32+
with:
33+
branch: release/${{ steps.version.outputs.next_tag }}
34+
commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}'
35+
base: main
36+
title: Release ${{ steps.version.outputs.next_tag }}
37+
labels: chore
38+
assignees: sgratzl
39+
body: |
40+
Releasing ${{ steps.version.outputs.next_tag }}.

.github/workflows/release_helper.yml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Release Helper
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
correct_repository:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: fail on fork
12+
if: github.repository_owner != 'sgratzl'
13+
run: exit 1
14+
15+
create_release:
16+
needs: correct_repository
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
- name: Extract version
25+
id: extract_version
26+
run: |
27+
node -pe "'version=' + require('./package.json').version" >> $GITHUB_OUTPUT
28+
node -pe "'npm_tag=' + (require('./package.json').version.includes('-') ? 'next' : 'latest')" >> $GITHUB_OUTPUT
29+
- name: Print version
30+
run: |
31+
echo "releasing ${{ steps.extract_version.outputs.version }} with tag ${{ steps.extract_version.outputs.npm_tag }}"
32+
- name: Create Release
33+
id: create_release
34+
uses: release-drafter/release-drafter@v6
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
name: v${{ steps.extract_version.outputs.version }}
39+
tag: v${{ steps.extract_version.outputs.version }}
40+
version: ${{ steps.extract_version.outputs.version }}
41+
prerelease: ${{ needs.create_release.outputs.tag_name == 'next' }}
42+
publish: true
43+
outputs:
44+
version: ${{ steps.extract_version.outputs.version }}
45+
npm_tag: ${{ steps.extract_version.outputs.npm_tag }}
46+
upload_url: ${{ steps.create_release.outputs.upload_url }}
47+
tag_name: ${{ steps.create_release.outputs.tag_name }}
48+
49+
build_assets:
50+
needs: create_release
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Check out code
54+
uses: actions/checkout@v4
55+
- uses: actions/setup-node@v4
56+
with:
57+
node-version: 20
58+
- run: npm i -g yarn
59+
- run: yarn config set checksumBehavior ignore
60+
- name: Cache Node.js modules
61+
uses: actions/cache@v4
62+
with:
63+
path: |
64+
./.yarn/cache
65+
./.yarn/unplugged
66+
key: ${{ runner.os }}-yarn2-v5-${{ hashFiles('**/yarn.lock') }}
67+
restore-keys: |
68+
${{ runner.os }}-yarn2-v5
69+
- run: yarn install
70+
- run: yarn build
71+
- run: yarn pack
72+
- name: Upload Release Asset
73+
uses: AButler/[email protected]
74+
with:
75+
files: 'package.tgz'
76+
repo-token: ${{ secrets.GITHUB_TOKEN }}
77+
release-tag: ${{ needs.create_release.outputs.tag_name }}
78+
- name: Pack Publish
79+
run: |
80+
yarn config set npmAuthToken "${{ secrets.NPM_TOKEN }}"
81+
yarn pack
82+
yarn npm publish --tag "${{ needs.create_release.outputs.npm_tag }}"
83+
84+
sync_dev:
85+
needs: correct_repository
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Check out code
89+
uses: actions/checkout@v4
90+
with:
91+
ref: develop
92+
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
93+
- name: Reset dev branch
94+
run: |
95+
git fetch origin main:main
96+
git merge main
97+
git push

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.pnp.js
1+
.pnp.*
22
.yarnrc.yml
33
.yarn
File renamed without changes.

.release-it.json

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/build/fmin.js b/build/fmin.js
2+
index da5504ab16463811c1aff42ac0458ca6b7378d28..506ceefaef866275ea1f48b34384fd99756ba042 100644
3+
--- a/build/fmin.js
4+
+++ b/build/fmin.js
5+
@@ -209,7 +209,7 @@
6+
if (sigma >= 1) break;
7+
8+
// do a reduction
9+
- for (i = 1; i < simplex.length; ++i) {
10+
+ for (let i = 1; i < simplex.length; ++i) {
11+
weightedSum(simplex[i], 1 - sigma, simplex[0], sigma, simplex[i]);
12+
simplex[i].fx = f(simplex[i]);
13+
}
14+
diff --git a/package.json b/package.json
15+
index 9378ea45918a9879f0daf01b5742416cb84fd774..5d9e373425655c66193e5c490b8be5d09349225a 100644
16+
--- a/package.json
17+
+++ b/package.json
18+
@@ -2,7 +2,6 @@
19+
"name": "fmin",
20+
"version": "0.0.4",
21+
"description": "Unconstrained funcion minimization in Javascript",
22+
- "type": "module",
23+
"keywords": [
24+
"fmin",
25+
"optimization",
26+
@@ -11,6 +10,7 @@
27+
],
28+
"license": "BSD-3-Clause",
29+
"main": "build/fmin.js",
30+
+ "module": "index.js",
31+
"jsnext:main": "index",
32+
"homepage": "https://github.com/benfred/fmin",
33+
"repository": {
34+
diff --git a/src/nelderMead.js b/src/nelderMead.js
35+
index fe38e9104920d7cf77156b53f627855796b5a225..1cc99b6ff81c489f622fbea354b40759fe9e8445 100644
36+
--- a/src/nelderMead.js
37+
+++ b/src/nelderMead.js
38+
@@ -129,7 +129,7 @@ export function nelderMead(f, x0, parameters) {
39+
if (sigma >= 1) break;
40+
41+
// do a reduction
42+
- for (i = 1; i < simplex.length; ++i) {
43+
+ for (let i = 1; i < simplex.length; ++i) {
44+
weightedSum(simplex[i], 1 - sigma, simplex[0], sigma, simplex[i]);
45+
simplex[i].fx = f(simplex[i]);
46+
}

.yarn/releases/yarn-3.1.1.cjs

-768
This file was deleted.

0 commit comments

Comments
 (0)