Skip to content

Commit

Permalink
Merge pull request #454 from MicroPad/next-dev
Browse files Browse the repository at this point in the history
v4.4.0
  • Loading branch information
NickGeek authored Oct 21, 2023
2 parents 1836c55 + cbfc353 commit 039a6c8
Show file tree
Hide file tree
Showing 18 changed files with 95 additions and 14,050 deletions.
41 changes: 9 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,21 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18'
- 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: oven-sh/setup-bun@v1
- name: Install node dependencies
working-directory: app
run: |
yarn
run: bun install
- name: Lint
working-directory: app
run: |
yarn typecheck
yarn lint
bun run typecheck
bun run lint
- name: Build
working-directory: app
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
yarn build
bun run build
tar cfJ micropad.tar.xz build/*
- name: Upload artifact
uses: actions/upload-artifact@v3
Expand All @@ -59,25 +47,15 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18'
- 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: oven-sh/setup-bun@v1
- uses: actions/download-artifact@v3
with:
name: micropad
- name: Install node dependencies
working-directory: app
run: |
yarn
bun install
bun run playwright install
- name: Run Micropad in background for testing
run: |
mkdir micropad
Expand All @@ -86,8 +64,7 @@ jobs:
python3 -m http.server 3000 &
- name: Test
working-directory: app
run: |
yarn test
run: bun run test
deploy:
name: Deploy
runs-on: ubuntu-latest
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:
- [Yarn](https://classic.yarnpkg.com/lang/en/) classic
- [Bun](https://bun.sh/)
- [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
yarn
bun install
```

### Running a dev server
```bash
yarn start
bun run start
```
### Building for production
```bash
yarn build
bun run build
```
12 changes: 12 additions & 0 deletions app/.run/build.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="build" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions app/.run/lint.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="lint" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="lint" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions app/.run/start.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="start" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="start" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions app/.run/typecheck_watch.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="typecheck:watch" type="js.build_tools.npm" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="typecheck:watch" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
541 changes: 0 additions & 541 deletions app/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

873 changes: 0 additions & 873 deletions app/.yarn/releases/yarn-3.5.0.cjs

This file was deleted.

23 changes: 0 additions & 23 deletions app/.yarnrc.yml

This file was deleted.

30 changes: 15 additions & 15 deletions app/_build/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ const esBuildTargets = browserslist().filter(browser => !browser.endsWith('TP'))
(async () => {
process.env.PUBLIC_URL ??= '';

await copyDir('node_modules/timers-browserify', 'node_modules/timers');

await rm(OUT_DIR, { recursive: true, force: true });
await copyDir('public', OUT_DIR);

const sentryPlugin = () => sentryEsbuildPlugin({
org: "nick-webster",
project: "micropad",
release: {
name: packageJson.version,
finalize: false
},
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// and need `project:releases` and `org:read` scopes
authToken: process.env.SENTRY_AUTH_TOKEN,
});
// TODO: re-enable when I update esbuild
// const sentryPlugin = () => sentryEsbuildPlugin({
// org: "nick-webster",
// project: "micropad",
// release: {
// name: packageJson.version,
// finalize: false
// },
// // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// // and need `project:releases` and `org:read` scopes
// authToken: process.env.SENTRY_AUTH_TOKEN,
// });

const { metafile: browserCheckMetafile } = await build({
entryPoints: ['src/unsupported-page/index.ts'],
Expand All @@ -60,7 +63,7 @@ const esBuildTargets = browserslist().filter(browser => !browser.endsWith('TP'))
'process.env.PUBLIC_URL': `"${process.env.PUBLIC_URL}"`
},
assetNames: 'assets/[name].[hash]',
plugins: [sentryPlugin()]
plugins: []
}).catch(() => process.exit(1));

if (!browserCheckMetafile) throw new Error('Missing metafile');
Expand Down Expand Up @@ -101,7 +104,6 @@ const esBuildTargets = browserslist().filter(browser => !browser.endsWith('TP'))
},
plugins: [
esbuildPluginBrowserslist(esBuildTargets),
sentryPlugin()
],
}).catch(() => process.exit(1));

Expand Down Expand Up @@ -187,7 +189,6 @@ const esBuildTargets = browserslist().filter(browser => !browser.endsWith('TP'))
},
plugins: [
esbuildPluginBrowserslist(esBuildTargets),
sentryPlugin()
],
}).catch(() => process.exit(1));

Expand Down Expand Up @@ -237,7 +238,6 @@ const esBuildTargets = browserslist().filter(browser => !browser.endsWith('TP'))
},
plugins: [
esbuildPluginBrowserslist(esBuildTargets),
sentryPlugin()
],
}).catch(() => process.exit(1));

Expand Down
Binary file added app/bun.lockb
Binary file not shown.
9 changes: 5 additions & 4 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "micropad",
"version": "4.3.0",
"version": "4.4.0",
"private": true,
"scripts": {
"preinstall": "python3 ../libs/build-libs.py && ./get_precache_files.py > src/extraPrecacheFiles.ts",
"prestart": "tsc -p _build/tsconfig.json",
"start": "yarn prestart && NODE_ENV='' node --experimental-import-meta-resolve _build/build.mjs",
"start": "NODE_ENV='' node --experimental-import-meta-resolve _build/build.mjs",
"prebuild": "tsc -p _build/tsconfig.json",
"build": "yarn prebuild && NODE_ENV=production node --experimental-import-meta-resolve _build/build.mjs",
"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",
Expand Down Expand Up @@ -158,9 +158,10 @@
"babel-eslint": "^10.1.0",
"browserslist": "^4.21.10",
"esbuild": "~0.16.17",
"esbuild-plugin-browserslist": "~0.7.2",
"esbuild-plugin-browserslist": "~0.6.0",
"esbuild-plugin-manifest": "~0.5.0",
"eslint": "^8.47.0",
"@eslint/eslintrc": "^2.1.2",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.28.0",
Expand Down
1 change: 0 additions & 1 deletion app/src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { DrawMode } from './reducers/EditorReducer';
import { AppInfoMessage } from './reducers/AppInfoReducer';
import { ModalId } from './types/ModalIds';
import { EncryptionStatus } from './reducers/AppReducer';
import { hashtagSearchOrJump$ } from './epics/SearchEpics';

export type MicroPadAction = ActionTypes[keyof ActionTypes];
export type ActionNames = keyof ActionFactories;
Expand Down
16 changes: 11 additions & 5 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 @@ -4,9 +4,6 @@ import { IStoreState } from '../../../../types';
import { actions } from '../../../../actions';
import { IProgressValues } from './TodoListComponent';
import { ModalId } from '../../../../types/ModalIds';
import { store } from '../../../../root';
import { search } from '../../../../services/SearchService';
import { SearchResults } from '../../../../reducers/SearchReducer';

export const MD_START_ATTR = 'data-md-start';
export const MD_END_ATTR = 'data-md-end';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const getHtml = (id: string, theme: ITheme, fontSize: string = '16px'): s
extensions: ['tex2jax.js', 'asciimath2jax.js'],
messageStyle: 'none',
tex2jax: {
inlineMath: [[';;', ';;'], ['$', '$']],
inlineMath: [[';;', ';;']],
displayMath: [['$$', '$$']]
},
asciimath2jax: {
Expand Down
4 changes: 2 additions & 2 deletions app/src/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import './theme-styles/Purple.css';
/* JS Imports */
import React from 'react';
import 'materialize-css/dist/js/materialize.js';
import { IStoreState, MICROPAD_URL } from './types';
import { applyMiddleware, Store } from 'redux';
import { MICROPAD_URL } from './types';
import { applyMiddleware } from 'redux';
import { BaseReducer } from './reducers/BaseReducer';
import { epicMiddleware } from './epics';
import localforage from 'localforage';
Expand Down
Loading

0 comments on commit 039a6c8

Please sign in to comment.