Skip to content

Commit 145673e

Browse files
committed
ci changes, todo style constants
1 parent 7434707 commit 145673e

18 files changed

Lines changed: 4392 additions & 1783 deletions

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
node-version: 18
1919

2020
- name: install dependencies
21-
run: yarn install
21+
run: pnpm install
2222

2323
- name: set development version
2424
run: node .github/version-bump.js "$(git rev-parse --short HEAD)"
2525

2626
- name: build
27-
run: yarn build
27+
run: pnpm run build:prod
2828

2929
- name: upload dist
3030
uses: actions/upload-artifact@v3.1.0
@@ -45,10 +45,10 @@ jobs:
4545
node-version: 18
4646

4747
- name: install dependencies
48-
run: yarn install
48+
run: pnpm install
4949

5050
- name: test
51-
run: yarn test
51+
run: pnpm run test
5252

5353
lint:
5454
runs-on: ubuntu-latest
@@ -61,7 +61,7 @@ jobs:
6161
node-version: 18
6262

6363
- name: install dependencies
64-
run: yarn install
64+
run: pnpm install
6565

6666
- name: lint
67-
run: yarn lint
67+
run: pnpm run lint

.github/workflows/release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
- name: Install
2424
run: |
2525
sudo apt-get -y install moreutils
26-
yarn install
26+
pnpm install
2727
2828
- name: Lint
29-
run: yarn lint
29+
run: pnpm run lint:prod
3030

3131
- name: Test
32-
run: yarn test
32+
run: pnpm run test
3333

3434
- name: Run version-bump
3535
run: node .github/version-bump.js ${{ github.event.release.tag_name }}
@@ -40,7 +40,12 @@ jobs:
4040

4141
# build now, so that no side-effects when build fails and release get deleted
4242
- name: Build
43-
run: yarn build:prod
43+
run: |
44+
pnpm run build:release
45+
mkdir obsidian-functionplot
46+
cp main.js manifest.json styles.css obsidian-functionplot
47+
zip -r obsidian-functionplot.zip obsidian-functionplot
48+
ls
4449
4550
- name: Commit and push changes
4651
run: |
@@ -55,7 +60,7 @@ jobs:
5560
uses: AButler/upload-release-assets@v2.0
5661
with:
5762
repo-token: ${{ github.token }}
58-
files: "main.js;manifest.json"
63+
files: "main.js;manifest.json;obsidian-functionplot.zip"
5964

6065
- uses: actions/github-script@v4
6166
if: failure()

.vscode/settings.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
{
2-
"cSpell.words": ["functionplot"]
2+
"cSpell.words": [
3+
"deepcopy",
4+
"fnplot",
5+
"fplt",
6+
"functionplot",
7+
"gridlines",
8+
"mauriciopoppe",
9+
"nums",
10+
"Xmax",
11+
"Xmin",
12+
"Ymax",
13+
"Ymin",
14+
"zoomable"
15+
]
316
}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Contibutions are always welcome! We appreciate every help with this project, be it just submitting issues or feature requests, picking one up and working on it, making edits to the wiki or opening a pull request with a new feature or a bugfix, as it helps grow the project.
3+
Contributions are always welcome! We appreciate every help with this project, be it just submitting issues or feature requests, picking one up and working on it, making edits to the wiki or opening a pull request with a new feature or a bugfix, as it helps grow the project.
44

55
TL;DR:
66

declaration.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1+
/* eslint-disable no-unused-vars */
12
declare module "*.svelte";
3+
declare module "*.svg" {
4+
const src: string;
5+
export default src;
6+
}
7+
declare module "*.md" {
8+
const src: string;
9+
export default src;
10+
}
11+
12+
declare const BUILD_LINK: string;
13+
declare const BUILD_VERSION: string;
14+
declare const BUILD_DATE: Date;

package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@
77
"license": "MIT",
88
"private": true,
99
"scripts": {
10-
"build:prod": "webpack --env=production",
11-
"build:dev": "webpack",
12-
"build": "npm run build:dev",
13-
"watch": "webpack --watch",
14-
"lint:prod": "npm run eslint -c .eslintrc.prod.json .",
15-
"test": "jest",
16-
"format": "npm run prettier --write .",
17-
"lint": "npm run eslint -c .eslintrc.json .",
18-
"postinstall": "husky install"
10+
"build:release": "pnpm exec webpack --env production --env includeReleaseLink",
11+
"build:prod": "pnpm exec webpack --env production",
12+
"build": "pnpm exec webpack",
13+
"watch": "pnpm exec webpack --watch",
14+
"lint:prod": "pnpm exec -c .eslintrc.prod.json .",
15+
"test": "pnpm exec jest",
16+
"format": "pnpm exec eslint --cache --fix -c .eslintrc.json . && pnpm exec prettier --write .",
17+
"lint": "pnpm exec eslint -c .eslintrc.json .",
18+
"postinstall": "pnpm exec husky install"
1919
},
2020
"devDependencies": {
2121
"@babel/core": "^7.20.12",
2222
"@tsconfig/svelte": "^3.0.0",
23+
"@types/d3": "^7.4.0",
2324
"@types/jest": "^29.2.3",
2425
"@types/node": "*",
2526
"@typescript-eslint/eslint-plugin": "^5.41.0",
@@ -29,6 +30,7 @@
2930
"eslint": "^8.34.0",
3031
"eslint-plugin-svelte3": "^4.0.0",
3132
"husky": "^8.0.3",
33+
"image-minimizer-webpack-plugin": "^3.8.3",
3234
"jest": "^29.2.2",
3335
"jest-environment-jsdom": "^29.4.2",
3436
"lint-staged": "^13.1.1",
@@ -41,22 +43,22 @@
4143
"svelte-loader": "^3.1.4",
4244
"svelte-material-icons": "^2.0.4",
4345
"svelte-preprocess": "^4.10.7",
46+
"svgo": "^3.0.2",
4447
"ts-jest": "^29.0.3",
4548
"ts-loader": "^9.3.1",
4649
"ts-node": "^10.9.1",
47-
"typescript": "^4.7.4",
50+
"typescript": "^4.9.5",
4851
"webpack": "^5.74.0",
4952
"webpack-cli": "^5.0.0",
5053
"yaml": "^2.1.3"
5154
},
5255
"dependencies": {
53-
"@smui/icon-button": "7.0.0-beta.14",
56+
"d3": "^7.8.5",
5457
"function-plot": "^1.23.1",
5558
"html-to-image": "^1.11.3",
5659
"obsidian": "0.16.3"
5760
},
5861
"lint-staged": {
59-
"*.js": "eslint --cache --fix",
60-
"*.{js,css,md,svelte}": "prettier --write"
62+
"*.{js,ts,css,md,svelte}": "pnpm run format"
6163
}
6264
}

0 commit comments

Comments
 (0)