Skip to content

Commit

Permalink
Merge pull request #9 from leviosa42/feat-refactor
Browse files Browse the repository at this point in the history
Feat refactor
  • Loading branch information
leviosa42 authored Sep 15, 2024
2 parents d6a6d0c + 2080f23 commit 17ce326
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as rpn from './core/index.ts';
import * as rpn from './core/mod.ts';

import { parseArgs } from 'https://deno.land/std/cli/parse_args.ts';

Expand Down
2 changes: 1 addition & 1 deletion src/core/index.ts → src/core/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ export * from './evaluate.ts';
export * from './interpreter.ts';
export * from './parser.ts';
export * from './TOKENS.ts';
export * from './types.d.ts';
export * from './error.ts';
export type * from './types.d.ts';
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Key.tsx → src/webapp/components/Key.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { FC } from 'react';
import { useSound } from 'use-sound';

const SOUND_ONCLICK = new URL('../../public/keyboard_1.mp3', import.meta.url).href;
const SOUND_ONCLICK = new URL('../public/keyboard_1.mp3', import.meta.url).href;

export type KeyAction = {
type: 'insert' | 'delete' | 'clear' | 'enter' | 'modifier' | 'noop' | 'keypad_mode' | 'cursor.move';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { FC } from 'react';
import type { State } from '../index.tsx';
import type { KeyAction, Props } from './Key.tsx';
import * as rpn from '../core/index.ts';
import * as rpn from '../../core/mod.ts';

export const Verbose = ({ dispatch, state }: {
dispatch: (action: KeyAction) => void;
Expand Down
12 changes: 12 additions & 0 deletions src/webapp/import_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"imports": {
"rpn": "../core/mod.ts",
"@types/react": "npm:@types/react@^18.3.4",
"@types/react-dom": "npm:@types/react-dom@^18.3.0",
"@vitejs/plugin-react": "npm:@vitejs/plugin-react@^4.3.1",
"react": "npm:react@^18.3.1",
"react-dom": "npm:react-dom@^18.3.1",
"use-sound": "npm:use-sound@^4.0.3",
"vite": "npm:vite@^5.4.2"
}
}
2 changes: 1 addition & 1 deletion index.html → src/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

<body>
<div id="app"></div>
<script type="module" src="./src/index.tsx"></script>
<script type="module" src="./index.tsx"></script>

</html>
2 changes: 1 addition & 1 deletion src/index.tsx → src/webapp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useEffect, useReducer, useState } from 'react';
// @ts-types="@types/react-dom/client"
import { createRoot } from 'react-dom/client';

import * as rpn from './core/index.ts';
import * as rpn from '../core/mod.ts';

import './styles/index.css';
import { KeyAction } from './components/Key.tsx';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@ import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
root: './src/webapp',
base: './',
publicDir: './public',
// dist
build: {
outDir: '../../dist',
emptyOutDir: true,
},
});

0 comments on commit 17ce326

Please sign in to comment.