Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
82d0882
Update ThemeValues.ts
Jan 5, 2025
331d6eb
fix gruvbox
Jan 5, 2025
d91313a
Tweak drawing background
Jan 5, 2025
d6eb620
Merge pull request #463 from worthalex/next-dev
NickGeek Jan 5, 2025
f7cfdea
made gruvbox drawing backgrounds actually transparent
Jan 5, 2025
68de784
Merge pull request #464 from worthalex/next-dev
NickGeek Jan 5, 2025
d1819d0
Updating to v4 artifact actions due to v3 being deprecated
NickGeek Feb 2, 2025
223bf91
Migrating to yarn and fixing build
NickGeek Apr 30, 2025
c7e527a
De-bunning the project
NickGeek Apr 30, 2025
c389fd4
Updating dependencies
NickGeek Aug 9, 2025
ac36f77
Trying out tsgo
NickGeek Aug 9, 2025
7d665c5
Bumping version number
NickGeek Aug 9, 2025
597d85b
Merge branch 'master' into next-dev
NickGeek Aug 9, 2025
9946ffe
Fixing Gruvbox styling
NickGeek Aug 9, 2025
15ddf54
Bumping version further because new theme
NickGeek Aug 9, 2025
652cdb0
Making drawings more visible with Gruvbox
NickGeek Aug 9, 2025
a1642e4
Making Pastel the default theme
NickGeek Aug 9, 2025
aa55bf9
Waiting one frame before watching for pointer moves
NickGeek Aug 9, 2025
a02ecbe
Updated What's New
NickGeek Aug 9, 2025
df7fb6a
Updating to actions/upload-artifact@v4
NickGeek Aug 9, 2025
b80a174
Adding in a playwright install step to get browsers
NickGeek Aug 9, 2025
477cbce
Updating playwright snapshot because the theme it's using is now Pastel
NickGeek Aug 9, 2025
fb6b06b
Updating actions
NickGeek Aug 9, 2025
e7f3813
Updating actions (again lol)
NickGeek Aug 9, 2025
d1dceae
Updating actions (again lol)
NickGeek Aug 9, 2025
d77e377
Updating actions (again lol)
NickGeek Aug 9, 2025
385a422
Dropping dev server logspam
NickGeek Aug 9, 2025
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
53 changes: 38 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,34 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- uses: oven-sh/setup-bun@v1
node-version: '22'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
working-directory: app
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Cache Yarn Packages
id: yarn-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('app/yarn.lock', 'app/.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install node dependencies
working-directory: app
run: bun install
run: |
yarn
- name: Lint
working-directory: app
run: |
bun run typecheck
bun run lint
yarn typecheck
yarn lint
- name: Build
working-directory: app
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
bun run build
yarn build
tar cfJ micropad.tar.xz build/*
- name: Upload artifact
uses: actions/upload-artifact@v3
Expand All @@ -46,16 +58,26 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- uses: oven-sh/setup-bun@v1
- uses: actions/download-artifact@v3
node-version: '22'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
working-directory: app
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Cache Yarn Packages
id: yarn-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('app/yarn.lock', 'app/.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- uses: actions/download-artifact@v4
with:
name: micropad
- name: Install node dependencies
working-directory: app
run: |
bun install
bun run playwright install
yarn
- name: Run Micropad in background for testing
run: |
mkdir micropad
Expand All @@ -64,7 +86,8 @@ jobs:
python3 -m http.server 3000 &
- name: Test
working-directory: app
run: bun run test
run: |
yarn test
deploy:
name: Deploy
runs-on: ubuntu-latest
Expand All @@ -74,7 +97,7 @@ jobs:
needs: [build, test]
if: github.ref == 'refs/heads/master' && github.repository == 'micropad/Micropad-Core'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: micropad
- run: |
Expand All @@ -99,7 +122,7 @@ jobs:
needs: [build, test]
if: github.ref == 'refs/heads/next-dev' && github.repository == 'micropad/Micropad-Core'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: micropad
- run: |
Expand Down Expand Up @@ -127,7 +150,7 @@ jobs:
id: micropad-version
working-directory: app
run: echo "version=v$(npm pkg get version | sed 's/"//g')" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: micropad
- uses: dev-drprasad/delete-tag-and-release@v0.2.1
Expand Down
2 changes: 1 addition & 1 deletion app/.run/build.run.xml → .run/build.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<package-json value="$PROJECT_DIR$/app/package.json" />
<command value="run" />
<scripts>
<script value="build" />
Expand Down
2 changes: 1 addition & 1 deletion app/.run/lint.run.xml → .run/lint.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="lint" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<package-json value="$PROJECT_DIR$/app/package.json" />
<command value="run" />
<scripts>
<script value="lint" />
Expand Down
2 changes: 1 addition & 1 deletion app/.run/start.run.xml → .run/start.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="start" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<package-json value="$PROJECT_DIR$/app/package.json" />
<command value="run" />
<scripts>
<script value="start" />
Expand Down
2 changes: 1 addition & 1 deletion app/.run/typecheck.run.xml → .run/typecheck.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="typecheck" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<package-json value="$PROJECT_DIR$/app/package.json" />
<command value="run" />
<scripts>
<script value="typecheck" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="typecheck:watch" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<package-json value="$PROJECT_DIR$/app/package.json" />
<command value="run" />
<scripts>
<script value="typecheck:watch" />
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ There are a couple [GitHub Project boards](https://github.com/orgs/MicroPad/proj

## Building MicroPad
You will need the following:
- [Bun](https://bun.sh/)
- [Yarn](https://classic.yarnpkg.com/lang/en/) classic
- [Node.js](https://nodejs.org/en/)
- [Python 3](https://www.python.org/)

### Installing dependencies
```bash
git clone https://github.com/MicroPad/MicroPad-Core.git micropad-core
cd micropad-core/app
bun install
yarn install
```

### Running a dev server
```bash
bun run start
yarn typecheck:watch & yarn start
```
### Building for production
```bash
bun run build
yarn build
```
2 changes: 1 addition & 1 deletion app/_build/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import servor from 'servor';
import { getUserAgentRegex } from 'browserslist-useragent-regexp';
import { createHash } from 'crypto';
import { sentryEsbuildPlugin } from '@sentry/esbuild-plugin';
import packageJson from '../package.json' assert { type: 'json' };
import packageJson from '../package.json' with { type: 'json' };
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);

Expand Down
Binary file removed app/bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion app/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const config: Linter.Config[] = [
},
settings: {
react: {
...react.configs.recommended.settings,
version: 'detect'
}
},
Expand Down
75 changes: 10 additions & 65 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "micropad",
"version": "4.5.2",
"version": "4.6.0",
"private": true,
"scripts": {
"preinstall": "python3 ../libs/build-libs.py && ./get_precache_files.py > src/extraPrecacheFiles.ts",
"prestart": "tsc -p _build/tsconfig.json",
"prestart": "tsgo -p _build/tsconfig.json",
"start": "NODE_ENV='' node --experimental-import-meta-resolve _build/build.mjs",
"prebuild": "tsc -p _build/tsconfig.json",
"prebuild": "tsgo -p _build/tsconfig.json",
"build": "NODE_ENV=production node --experimental-import-meta-resolve _build/build.mjs",
"test": "TZ=NZ jest",
"typecheck": "tsc --noEmit --p ./tsconfig.json",
"typecheck:watch": "tsc --noEmit --watch -p ./tsconfig.json",
"typecheck": "tsgo --noEmit --p ./tsconfig.json",
"typecheck:watch": "tsgo --noEmit --watch -p ./tsconfig.json",
"lint": "eslint --flag unstable_ts_config src/",
"lint:fix": "eslint --flag unstable_ts_config --fix src/"
},
Expand Down Expand Up @@ -66,63 +66,6 @@
"workbox-routing": "^6.6.1",
"workbox-strategies": "^6.6.1"
},
"eslintConfig": {
"extends": [
"react-app",
"plugin:jest-playwright/recommended"
],
"ignorePatterns": [
"*.js"
],
"overrides": [
{
"files": [
"**/*.ts?(x)"
],
"rules": {
"@typescript-eslint/no-use-before-define": "off",
"eqeqeq": [
"error",
"smart"
],
"no-multi-spaces": "error",
"array-bracket-spacing": [
"error",
"never"
],
"object-curly-spacing": [
"error",
"always"
],
"key-spacing": "error",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"no-debugger": "error",
"quotes": [
"error",
"single",
{
"allowTemplateLiterals": true
}
],
"jsx-quotes": [
"error",
"prefer-double"
],
"no-script-url": "error",
"no-eval": "error",
"no-console": [
"error",
{
"allow": [
"warn",
"error"
]
}
]
}
}
]
},
"browserslist": {
"production": [
"chrome >= 84",
Expand Down Expand Up @@ -154,7 +97,7 @@
"@types/json-stringify-safe": "^5.0.3",
"@types/mousetrap": "^1.6.15",
"@types/node": "^18.19.44",
"@types/react": "^17.0.80",
"@types/react": "^17",
"@types/react-dom": "^17.0.25",
"@types/semver": "^7.5.8",
"@types/showdown": "^1.9.4",
Expand All @@ -166,6 +109,7 @@
"eslint": "^9.9.0",
"eslint-plugin-react": "^7.35.0",
"expect-playwright": "^0.8.0",
"globals": "^16.0.0",
"html-minifier": "^4.0.0",
"jest": "^27.5.1",
"jest-circus": "^27.5.1",
Expand All @@ -174,12 +118,13 @@
"jest-junit": "^13.2.0",
"jest-playwright-preset": "^1.7.2",
"jest-runner": "^27.5.1",
"jiti": "^1.21.6",
"jiti": "^2.4.2",
"playwright": "^1.46.0",
"servor": "^4.0.2",
"ts-jest": "^27.1.5",
"typescript-eslint": "^8.1.0",
"workbox-build": "^6.6.1"
"workbox-build": "^6.6.1",
"@typescript/native-preview": "7.0.0-dev.20250809.1"
},
"resolutions": {
"@types/react": "^17",
Expand Down
17 changes: 17 additions & 0 deletions app/src/app/ThemeValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ export const ThemeValues: { [K in ThemeName]: ITheme } = {
element: elementInstructionsDark
}
},
Gruvbox: {
background: '#282828',
accent: '#928374',
chrome: '#3c3836',
text: '#ebdbb2',
links: '#ebdbb2',
linkUnderline: true,
explorerContent: '#ebdbb2',
accentContent: '#ebdbb2',
backgroundImage: filledBackground,
drawingBackground: '#ffffff15',
instructionImages: {
notepad: instructionImageDark,
note: noteInstructionsDark,
element: elementInstructionsDark
}
},
Midnight: {
background: '#212121',
accent: '#424242',
Expand Down
8 changes: 6 additions & 2 deletions app/src/app/assets/Help.npx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ export default class DrawingElementComponent extends React.Component<Props> {

const canvasElement = this.canvasElement;
if (!!canvasElement) {

this.initCanvas();

setTimeout(() => this.initCanvas(), 0);
const isNewEditor = this.props.elementEditing !== prevProps?.elementEditing;
if (isNewEditor) {
// Restore saved image to canvas
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-expect-error TS2306
import MathJax from '../../../../assets/MathJax.raw.js';
// @ts-expect-error not a module
import hljs from '../../../../assets/highlight.js/highlight.min.raw.js';
// @ts-expect-error TS2307
import hljsCss from '../../../../assets/highlight.js/default.raw.css';
Expand Down Expand Up @@ -52,7 +53,7 @@ export const getHtml = (id: string, theme: ITheme, fontSize: string = '16px'): s

a {
color: ${theme.links};
text-decoration: none;
text-decoration: ${theme.linkUnderline ? 'underline' : 'none'};
}

h1, h2, h3, h4, h5, h6 {
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/reducers/AppReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class AppReducer extends AbstractReducer<IAppStoreState> {
defaultFontSize: '16px',
zoom: 1,
showHelp: true,
theme: 'Classic',
theme: 'Pastel',
explorerWidth: '270px',
cursorPos: { x: 0, y: 0 },
hasEncryptedNotebooks: {
Expand Down
1 change: 1 addition & 0 deletions app/src/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import './root.css';
import './ScrollbarPatch.css';
/* Themes */
import './theme-styles/Solarized.css';
import './theme-styles/Gruvbox.css';
import './theme-styles/Midnight.css';
import './theme-styles/Void.css';
import './theme-styles/Wellington.css';
Expand Down
5 changes: 3 additions & 2 deletions app/src/app/services/FendService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Observable, of, shareReplay } from 'rxjs';
import { ajax } from 'rxjs/ajax';
import { catchError, map } from 'rxjs/operators';
import { initialise, initialiseWithHandlers } from 'fend-wasm-web';
import { initialiseWithHandlers } from 'fend-wasm-web';

export const START_FEND$: Observable<void> = ajax<string>({
url: 'https://getmicropad.com/cors-proxy/moolah.xml',
Expand All @@ -26,7 +26,8 @@ export const START_FEND$: Observable<void> = ajax<string>({
map(currencyData => initialiseWithHandlers(currencyData)),
catchError(err => {
console.error('Caught an error getting currencies for fend', err);
return of(initialise());
initialiseWithHandlers(new Map());
return of(void 0);
}),
shareReplay(1)
);
Loading
Loading