Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
ignore index.js

remove package-lock

fix scripts

Revert "remove package-lock"

This reverts commit 3756109.

fix

ignore vercel
  • Loading branch information
NgocNhi123 committed Jul 2, 2024
1 parent a949500 commit 2cd3524
Show file tree
Hide file tree
Showing 16 changed files with 10,349 additions and 52 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.DS_Store
/node_modules
.parcel-cache

index.js
.vercel
44 changes: 21 additions & 23 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"name": "samuwrite.com",
"scripts": {
"dev": "sh scripts/dev.sh",
"build": "sh scripts/build.sh",
"mac:build": "sh scripts/mac/build.sh"
},
"name": "@samuwrite/web",
"devDependencies": {
"@parcel/transformer-sass": "2.7.0",
"@types/react": "18.0.21",
"@types/react-dom": "18.0.6",
"@types/wicg-file-system-access": "2020.9.5",
"@typescript-eslint/eslint-plugin": "5.38.0",
"@typescript-eslint/parser": "5.38.0",
"@parcel/transformer-sass": "2.12.0",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/wicg-file-system-access": "2023.10.5",
"@typescript-eslint/eslint-plugin": "7.15.0",
"@typescript-eslint/parser": "7.15.0",
"buffer": "6.0.3",
"eslint": "8.24.0",
"eslint-plugin-react": "7.31.8",
"eslint-plugin-react-hooks": "4.6.0",
"parcel": "2.7.0",
"eslint": "^8.56.0",
"eslint-plugin-react": "7.34.3",
"eslint-plugin-react-hooks": "4.6.2",
"parcel": "2.12.0",
"process": "0.11.10"
},
"dependencies": {
"@primer/octicons-react": "17.5.0",
"@rose-pine/palette": "3.0.1",
"@primer/octicons-react": "19.10.0",
"@rose-pine/palette": "4.0.1",
"@samuwrite/markdown": "^1.0.0",
"@samuwrite/radix": "^1.0.0",
"@samuwrite/tailwind": "^1.0.4",
"monaco-editor": "0.31.0",
"monaco-vim": "0.3.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"tinykeys": "1.4.0"
"monaco-editor": "0.50.0",
"monaco-vim": "0.4.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"tinykeys": "2.1.0"
},
"@parcel/resolver-default": {
"packageExports": true
}
}
6 changes: 0 additions & 6 deletions apps/web/scripts/build.sh

This file was deleted.

3 changes: 0 additions & 3 deletions apps/web/scripts/dev.sh

This file was deleted.

13 changes: 6 additions & 7 deletions apps/web/src/app/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Settings } from "../settings/type";
import { Roles, variants } from "@rose-pine/palette";
import { variants } from "@rose-pine/palette";

interface Props {
settings: Settings;
Expand Down Expand Up @@ -31,13 +31,12 @@ export const AppTheme = (props: Props): JSX.Element => {
const variables: string[] = [];

// Theme colors
Object.keys(variant).map((key) => {
const role = key as keyof Roles<unknown, unknown>;
const color = variant[role];
variables.push(`--color-${role}: ${color.hex}`);
Object.keys(variant.colors).map((key) => {
const role = key as keyof typeof variant.colors;
const {hex, rgb} = variant.colors[role];
variables.push(`--color-${role}: #${hex}`);
// RGB parts for alpha mixing
const rgb = color.rgb.replace("rgb(", "").replace(")", "");
variables.push(`--color-${role}-rgb: ${rgb}`);
variables.push(`--color-${role}-rgb: ${rgb.join(", ")}`);
});

// Other theme details like shadow opacity (dark themes need stronger shadow
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/editor/input/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const OPTIONS: monaco.editor.IStandaloneEditorConstructionOptions = {
contextmenu: false,
copyWithSyntaxHighlighting: false,
cursorBlinking: "smooth",
cursorSmoothCaretAnimation: true,
cursorSmoothCaretAnimation: "on",
cursorSurroundingLines: 3,
cursorWidth: 3,
disableMonospaceOptimizations: true,
Expand All @@ -41,7 +41,7 @@ const OPTIONS: monaco.editor.IStandaloneEditorConstructionOptions = {
language: "markdown",
lineNumbers: "off",
minimap: { enabled: false },
occurrencesHighlight: false,
occurrencesHighlight: "off",
overviewRulerBorder: false,
padding: { top: 96, bottom: 96 },
quickSuggestions: false,
Expand All @@ -53,7 +53,7 @@ const OPTIONS: monaco.editor.IStandaloneEditorConstructionOptions = {
snippetSuggestions: "none",
suggestOnTriggerCharacters: false,
value: "",
wordBasedSuggestions: false,
wordBasedSuggestions: "off",
wordWrap: "bounded",
scrollbar: {
useShadows: false,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/editor/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getMonacoTheme = (params: {
base: vscode.type === "dark" ? "vs-dark" : "vs",
colors: {
...vscode.colors,
"editorCursor.foreground": variant.rose.hex,
"editorCursor.foreground": `#${variant.colors.rose.hex}`,
},
inherit: false,
rules: vscode.tokenColors.flatMap(toMonacoTokens),
Expand Down
13 changes: 9 additions & 4 deletions apps/web/src/settings/theme/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,25 @@ export const ThemeIcon = (props: Props): JSX.Element => {
const { theme } = props;
const variant = variants[theme];

console.log(theme, variant);

return (
<span className={s.container} style={{ backgroundColor: variant.base.hex }}>
<span
className={s.container}
style={{ backgroundColor: `#${variant.colors.base.hex}` }}
>
<svg width="24" height="24" viewBox="0 0 198 187">
<path
fill={variant.pine.hex}
fill={`#${variant.colors.pine.hex}`}
fillOpacity="0.5"
d="M98.983 151.358C94.184 139.832 84.279 130.579 71.287 127.098L14.941 112C7.79401 138.673 23.623 206.09 50.296 173.237L90.543 184.021C93.382 184.782 96.27 183.981 98.298 182.146C100.3 184.672 103.68 185.909 106.99 185.021L147.237 174.237C173.911 167.09 189.74 139.673 182.593 113L126.247 128.098C113.632 131.478 103.928 140.298 98.983 151.358Z"
/>
<path
fill={variant.pine.hex}
fill={`#${variant.colors.pine.hex}`}
d="M99 177.001C94.368 154.178 74.19 137 50 137H0C0 164.614 22.386 187 50 187H98H100H148C175.614 187 198 164.614 198 137H148C123.81 137 103.632 154.178 99 177.001Z"
/>
<path
fill={variant.rose.hex}
fill={`#${variant.colors.rose.hex}`}
d="M95.918 0C105.118 5.312 111.991 13.106 116.181 22.048C128.154 12.575 144.298 8.68599 160.178 12.941L147.237 61.237C142.474 79.013 128.709 91.973 112.16 96.525L112.178 96.593C107.805 97.765 103.411 98.319 99.09 98.309C94.768 98.319 90.374 97.765 86 96.593L86.018 96.525C69.47 91.973 55.704 79.013 50.941 61.237L38 12.941C54.262 8.58399 70.801 12.766 82.853 22.74C83.217 22.036 83.599 21.336 84 20.642L95.918 0Z"
/>
</svg>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/shortcut/shortcut.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from "react";
import tinykeys from "tinykeys";
import { tinykeys } from "tinykeys";

export const useShortcut = (keys: string, callback: () => void) => {
useEffect(() => {
Expand Down
Loading

0 comments on commit 2cd3524

Please sign in to comment.