Skip to content

Commit

Permalink
merge codex dev/v2.0.4
Browse files Browse the repository at this point in the history
merge codex dev/v2.0.4
  • Loading branch information
jcv8000 authored Jan 3, 2024
2 parents 9fa4339 + 31f7186 commit 5264e1e
Show file tree
Hide file tree
Showing 24 changed files with 1,230 additions and 925 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
2 changes: 1 addition & 1 deletion electron-builder.config.js → electron-builder.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = {
},
category: "public.app-category.productivity",
notarize: {
teamId: process.env.APPLE_TEAM_ID
teamId: process.env.APPLE_TEAM_ID || ""
}
},
win: {
Expand Down
115 changes: 57 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "codex",
"private": true,
"version": "2.0.3",
"type": "module",
"main": ".vite/index.cjs",
"version": "2.0.4",
"description": "Note-taking app for programmers and CS students",
"author": {
"name": "Josh Vickery",
Expand All @@ -10,56 +12,55 @@
},
"homepage": "https://codexnotes.com/",
"license": "CC-BY-NC-4.0",
"main": ".vite/index.cjs",
"scripts": {
"build": "pnpm run typecheck && node ./scripts/build.mjs",
"dev": "node ./scripts/dev.mjs",
"dist": "pnpm run build && electron-builder -c electron-builder.config.js --publish=never",
"dir": "pnpm run build && electron-builder -c electron-builder.config.js --dir --publish=never",
"build": "pnpm run typecheck && node ./scripts/build.js",
"dev": "node ./scripts/dev.js",
"dist": "pnpm run build && electron-builder -c electron-builder.config.cjs --publish=never",
"dir": "pnpm run build && electron-builder -c electron-builder.config.cjs --dir --publish=never",
"clean": "rimraf dist/ .vite/",
"test": "pnpm run typecheck && pnpm run lint",
"lint": "pnpm exec eslint --ignore-path .gitignore . --max-warnings 0",
"typecheck": "tsc && tsc -p packages/renderer/tsconfig.json"
},
"dependencies": {
"@electron/remote": "^2.1.0",
"@emotion/react": "^11.11.1",
"@electron/remote": "^2.1.1",
"@emotion/react": "^11.11.3",
"@lukeed/uuid": "^2.0.1",
"@mantine/core": "^6.0.21",
"@mantine/dropzone": "^6.0.21",
"@mantine/form": "^6.0.21",
"@mantine/hooks": "^6.0.21",
"@mantine/modals": "^6.0.21",
"@mantine/notifications": "^6.0.21",
"@tabler/icons": "^2.41.0",
"@tabler/icons-webfont": "^2.41.0",
"@tiptap/core": "^2.1.12",
"@tiptap/extension-code": "^2.1.12",
"@tiptap/extension-code-block": "^2.1.12",
"@tiptap/extension-code-block-lowlight": "^2.1.12",
"@tiptap/extension-color": "^2.1.12",
"@tiptap/extension-focus": "^2.1.12",
"@tiptap/extension-font-family": "^2.1.12",
"@tiptap/extension-heading": "^2.1.12",
"@tiptap/extension-highlight": "^2.1.12",
"@tiptap/extension-image": "^2.1.12",
"@tiptap/extension-link": "^2.1.12",
"@tiptap/extension-placeholder": "^2.1.12",
"@tiptap/extension-subscript": "^2.1.12",
"@tiptap/extension-superscript": "^2.1.12",
"@tiptap/extension-table": "^2.1.12",
"@tiptap/extension-table-cell": "^2.1.12",
"@tiptap/extension-table-header": "^2.1.12",
"@tiptap/extension-table-row": "^2.1.12",
"@tiptap/extension-task-item": "^2.1.12",
"@tiptap/extension-task-list": "^2.1.12",
"@tiptap/extension-text-align": "^2.1.12",
"@tiptap/extension-text-style": "^2.1.12",
"@tiptap/extension-typography": "^2.1.12",
"@tiptap/extension-underline": "^2.1.12",
"@tiptap/pm": "^2.1.12",
"@tiptap/react": "^2.1.12",
"@tiptap/starter-kit": "^2.1.12",
"@tabler/icons": "^2.45.0",
"@tabler/icons-webfont": "^2.45.0",
"@tiptap/core": "^2.1.13",
"@tiptap/extension-code": "^2.1.13",
"@tiptap/extension-code-block": "^2.1.13",
"@tiptap/extension-code-block-lowlight": "^2.1.13",
"@tiptap/extension-color": "^2.1.13",
"@tiptap/extension-focus": "^2.1.13",
"@tiptap/extension-font-family": "^2.1.13",
"@tiptap/extension-heading": "^2.1.13",
"@tiptap/extension-highlight": "^2.1.13",
"@tiptap/extension-image": "^2.1.13",
"@tiptap/extension-link": "^2.1.13",
"@tiptap/extension-placeholder": "^2.1.13",
"@tiptap/extension-subscript": "^2.1.13",
"@tiptap/extension-superscript": "^2.1.13",
"@tiptap/extension-table": "^2.1.13",
"@tiptap/extension-table-cell": "^2.1.13",
"@tiptap/extension-table-header": "^2.1.13",
"@tiptap/extension-table-row": "^2.1.13",
"@tiptap/extension-task-item": "^2.1.13",
"@tiptap/extension-task-list": "^2.1.13",
"@tiptap/extension-text-align": "^2.1.13",
"@tiptap/extension-text-style": "^2.1.13",
"@tiptap/extension-typography": "^2.1.13",
"@tiptap/extension-underline": "^2.1.13",
"@tiptap/pm": "^2.1.13",
"@tiptap/react": "^2.1.13",
"@tiptap/starter-kit": "^2.1.13",
"@treverix/custom-electron-titlebar": "^4.2.0",
"color": "^4.2.3",
"d3": "^7.8.5",
Expand All @@ -81,33 +82,31 @@
"devDependencies": {
"@types/color": "^3.0.6",
"@types/d3": "^7.4.3",
"@types/katex": "^0.16.6",
"@types/node": "^16.18.62",
"@types/node-fetch": "^2.6.9",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/semver": "^7.5.5",
"@types/katex": "^0.16.7",
"@types/node": "^18.19.4",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@types/semver": "^7.5.6",
"@types/validator": "^13.11.7",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vitejs/plugin-react": "^4.2.0",
"electron": "^22.3.27",
"electron-builder": "^24.6.4",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"@vitejs/plugin-react": "^4.2.1",
"electron": "^26.6.3",
"electron-builder": "^24.9.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"node-fetch": "^2.7.0",
"prettier": "^3.1.0",
"eslint-plugin-react-refresh": "^0.4.5",
"prettier": "^3.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"sass": "^1.69.5",
"typescript": "^5.3.2",
"vite": "^4.5.0",
"vite-plugin-static-copy": "^0.17.1",
"vite-tsconfig-paths": "^4.2.1",
"sass": "^1.69.7",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-plugin-static-copy": "^1.0.0",
"vite-tsconfig-paths": "^4.2.3",
"wait-on": "^7.2.0"
}
}
35 changes: 29 additions & 6 deletions packages/common/Locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export type Locale = {
use_typography_extension: string;
use_typography_description: string;
open_pdf_on_export: string;
show_page_saved_notification: string;
saving_section: string;
autosave_page_on_switch: string;
general: string;
editor: string;
save_folder: string;
Expand Down Expand Up @@ -259,6 +260,12 @@ export type Locale = {
};
code_block_collapse: string;
};
unsavedChangesDialog: {
title: (name: string) => string;
cancel: string;
forget: string;
save: string;
};
};

export const supportedLocales = ["en_US", "zh_CN"] as const;
Expand Down Expand Up @@ -309,8 +316,9 @@ export const locales: Record<SupportedLocales, Locale> = {
use_typography_extension: "Use Typography extension in the Editor",
use_typography_description: 'This enables turning things like "(c)" into "©".',
open_pdf_on_export: "Automatically open PDF after exporting",
show_page_saved_notification:
"Show 'Page saved' notification when switching between pages",
saving_section: "Saving Pages",
autosave_page_on_switch:
"Automatically save the current page when switching between pages/exiting the editor",
general: "General",
editor: "Editor",
save_folder: "Save Folder",
Expand Down Expand Up @@ -365,7 +373,8 @@ export const locales: Record<SupportedLocales, Locale> = {
"You can make a page top-level by dragging it to an empty part of the sidebar",
'Edit your save.json and try setting a page\'s "color" property to "rainbow"',
"Contribute your own language to Codex on the GitHub repository (see CONTRIBUTING.md)",
"Open links in your notes by holding Control (or Cmd) and clicking on it"
"Open links in your notes by holding Control (or Cmd) and clicking on it",
"You can Alt+Click a folder to recursively close all subfolders inside it"
],
favorites: "Favorites"
},
Expand Down Expand Up @@ -545,6 +554,12 @@ export const locales: Record<SupportedLocales, Locale> = {
url: "URL"
},
code_block_collapse: "Collapse"
},
unsavedChangesDialog: {
title: (name: string) => `You have unsaved changes to "${name}"`,
cancel: "Cancel",
forget: "Discard Changes",
save: "Save Changes"
}
},
zh_CN: {
Expand Down Expand Up @@ -591,7 +606,8 @@ export const locales: Record<SupportedLocales, Locale> = {
use_typography_extension: "Use Typography extension in the Editor",
use_typography_description: '这将会把类似 "(c)" 的符号更改为 "©".',
open_pdf_on_export: "完成导出后自动打开PDF文件",
show_page_saved_notification: "当切换页面时显示『已保存』通知",
saving_section: "保存页面",
autosave_page_on_switch: "页面切换/退出编辑器时自动保存当前页面",
general: "基础设置",
editor: "编辑器",
save_folder: "保存文件夹",
Expand Down Expand Up @@ -645,7 +661,8 @@ export const locales: Record<SupportedLocales, Locale> = {
"You can make a page top-level by dragging it to an empty part of the sidebar",
'Edit your save.json and try setting a page\'s "color" property to "rainbow"',
"Contribute your own language to Codex on the GitHub repository (see CONTRIBUTING.md)",
"Open links in your notes by holding Control (or Cmd) and clicking on it"
"Open links in your notes by holding Control (or Cmd) and clicking on it",
"You can Alt+Click a folder to recursively close all subfolders inside it"
],
favorites: "收藏"
},
Expand Down Expand Up @@ -824,6 +841,12 @@ export const locales: Record<SupportedLocales, Locale> = {
url: "URL"
},
code_block_collapse: "折叠"
},
unsavedChangesDialog: {
title: (name: string) => `您对 "${name}" 有未保存的更改`,
cancel: "取消",
forget: "放弃更改",
save: "保存更改"
}
}
};
2 changes: 1 addition & 1 deletion packages/common/Prefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class GeneralPrefs {
locale: SupportedLocales = "en_US";
theme: "light" | "dark" = "light";
titlebarStyle: "custom" | "native" = "custom";
showSaveNotifOnPageSwitch = false;
autoSaveOnPageSwitch = true;
}

class EditorPrefs {
Expand Down
3 changes: 1 addition & 2 deletions packages/main/createWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { loadWindowState, saveWindowState } from "./windowState";
import contextMenu from "electron-context-menu";
import { Prefs } from "common/Prefs";
import { locales } from "common/Locales";
import nodeFetch from "node-fetch";
import { lt } from "semver";
import escape from "validator/lib/escape";
import log from "electron-log";
Expand All @@ -16,7 +15,7 @@ async function checkForUpdates(window: BrowserWindow) {
app.commandLine.appendSwitch("disable-http-cache");

try {
const resp = await nodeFetch("https://api.github.com/repos/jcv8000/Codex/releases");
const resp = await fetch("https://api.github.com/repos/jcv8000/Codex/releases");
const body = (await resp.json()) as any[];

const latest = body[0].tag_name as string;
Expand Down
2 changes: 1 addition & 1 deletion packages/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const menu = (window: BrowserWindow, locale: Locale) =>
...((isDev
? [{ role: "reload" }, { role: "forceReload" }]
: []) as MenuItemConstructorOptions[]),
{ role: "toggleDevTools" },
{ role: "toggleDevTools", click: () => window.webContents.openDevTools() },
{ type: "separator" },
{
label: locale.menus.zoom_in_editor,
Expand Down
Loading

0 comments on commit 5264e1e

Please sign in to comment.