rm one pkg

This commit is contained in:
EthanShoeDev
2025-09-17 17:22:50 -04:00
parent 86ff6762a3
commit 2f5568a6d5
20 changed files with 44 additions and 225 deletions

View File

@@ -1,24 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -1,27 +0,0 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import { globalIgnores, defineConfig } from 'eslint/config';
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
]);

View File

@@ -1,43 +0,0 @@
{
"name": "@fressh/react-native-xtermjs-webview-internal",
"private": true,
"version": "0.0.0",
"type": "module",
"files": [
"dist"
],
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"eslint:check": "eslint . --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint --fix --report-unused-disable-directives --max-warnings 0 .",
"typecheck": "tsc --noEmit",
"preview": "vite preview"
},
"dependencies": {
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"js-base64": "^3.7.8",
"react": "19.1.0",
"react-dom": "19.1.0"
},
"devDependencies": {
"@epic-web/config": "^1.21.3",
"@eslint/js": "^9.35.0",
"@types/react": "~19.1.12",
"@types/react-dom": "^19.1.7",
"@vitejs/plugin-react": "^5.0.2",
"eslint": "^9.35.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.4.0",
"prettier": "^3.6.2",
"prettier-plugin-organize-imports": "^4.2.0",
"typescript": "~5.9.2",
"typescript-eslint": "^8.44.0",
"vite": "6.3.6",
"vite-plugin-singlefile": "^2.3.0"
}
}

View File

@@ -1,14 +0,0 @@
import epicConfig from '@epic-web/config/prettier';
// Sometimes this plugin can remove imports that are being edited.
// As a workaround we will only use this in the cli. (pnpm run fmt)
const sortImports = process.env.SORT_IMPORTS === 'true-never';
/** @type {import("prettier").Options} */
export default {
...epicConfig,
semi: true,
plugins: [
...(sortImports ? ['prettier-plugin-organize-imports'] : []),
...(epicConfig.plugins || []),
],
};

View File

@@ -1,7 +0,0 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

View File

@@ -1,25 +0,0 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2023",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
}

View File

@@ -1,7 +0,0 @@
{
"extends": ["//"],
"tasks": {
"lint": {},
"lint:check": {}
}
}

View File

@@ -9,6 +9,7 @@ lerna-debug.log*
node_modules
dist
dist-internal
dist-ssr
*.local

View File

@@ -8,6 +8,6 @@
id="terminal"
style="margin: 0; padding: 0; width: 100%; height: 100%"
></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="/src-internal/main.tsx"></script>
</body>
</html>

View File

@@ -8,7 +8,8 @@
},
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"build:main": "tsc -b && vite build",
"build:internal": "tsc -b && vite build --config vite.config.internal.ts",
"fmt:check": "cross-env SORT_IMPORTS=true prettier --check .",
"fmt": "cross-env SORT_IMPORTS=true prettier --write .",
"eslint:check": "eslint . --report-unused-disable-directives --max-warnings 0",
@@ -17,7 +18,6 @@
"preview": "vite preview"
},
"dependencies": {
"@fressh/react-native-xtermjs-webview-internal": "workspace:*",
"js-base64": "^3.7.8"
},
"peerDependencies": {
@@ -31,8 +31,12 @@
"@types/react": "~19.1.12",
"@types/react-dom": "^19.1.7",
"@vitejs/plugin-react": "^5.0.2",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"js-base64": "^3.7.8",
"eslint": "^9.35.0",
"eslint-plugin-react-hooks": "^5.2.0",
"vite-plugin-singlefile": "^2.3.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.4.0",
"prettier": "^3.6.2",

View File

@@ -1,6 +1,6 @@
import { useImperativeHandle, useRef, type ComponentProps } from 'react';
import { WebView } from 'react-native-webview';
import htmlString from '@fressh/react-native-xtermjs-webview-internal/dist/index.html?raw';
import htmlString from '../dist-internal/index.html?raw';
import { Base64 } from 'js-base64';
type StrictOmit<T, K extends keyof T> = Omit<T, K>;
@@ -27,7 +27,7 @@ export function XtermJsWebView({
useImperativeHandle(ref, () => {
return {
write: (data) => {
const base64Data = Base64.fromUint8Array(data);
const base64Data = Base64.fromUint8Array(data.slice());
webViewRef.current?.injectJavaScript(`
window?.terminalWriteBase64?.('${base64Data}');
`);
@@ -46,7 +46,7 @@ export function XtermJsWebView({
onMessage?.({ type: 'initialized' });
return;
}
const data = Base64.toUint8Array(message);
const data = Base64.toUint8Array(message.slice());
onMessage?.({ type: 'data', data });
}}
{...props}

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app-internal.tsbuildinfo",
"target": "ES2022",
"useDefineForClassFields": true,
"lib": ["ES2022", "DOM", "DOM.Iterable"],
@@ -23,5 +23,5 @@
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src"]
"include": ["src-internal"]
}

View File

@@ -2,6 +2,7 @@
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.app-internal.json" },
{ "path": "./tsconfig.node.json" }
]
}

View File

@@ -21,5 +21,5 @@
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
"include": ["vite.config.ts", "vite.config.internal.ts"]
}

View File

@@ -1,6 +1,18 @@
{
"extends": ["//"],
"tasks": {
"build": {
"dependsOn": ["build:internal", "build:main"]
},
"build:main": {
"inputs": ["src/**"],
"dependsOn": ["build:internal"],
"outputs": ["dist/**"]
},
"build:internal": {
"inputs": ["src-internal/**"],
"outputs": ["dist-internal/**"]
},
"lint": {},
"lint:check": {}
}

View File

@@ -4,4 +4,7 @@ import { viteSingleFile } from 'vite-plugin-singlefile';
// https://vite.dev/config/
export default defineConfig({
plugins: [viteSingleFile()],
build: {
outDir: 'dist-internal',
},
});