Skip to content

Commit

Permalink
refactor(infra): improve dev workspace and server and remove redundan…
Browse files Browse the repository at this point in the history
…t tools (#253)
  • Loading branch information
mimshins authored Nov 13, 2024
1 parent 29c3d4c commit 6db3d2d
Show file tree
Hide file tree
Showing 14 changed files with 135 additions and 44 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ jspm_packages/
.pnp.*

## Editors
.vscode/*
!.vscode/extensions.json
.idea
.vscode
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

## System files
.DS_Store
Expand All @@ -56,7 +63,9 @@ jspm_packages/
# Build output
_site
dist
dist-ssr
out-tsc
*.local

# Storybook
storybook-static
Expand Down
29 changes: 17 additions & 12 deletions index.html → dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/svg+xml"
href="/vite.svg"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
Expand All @@ -21,19 +26,19 @@
/>
<link
rel="stylesheet"
href="./packages/theme/src/index.css"
href="../packages/theme/src/index.css"
/>
<link
rel="stylesheet"
href="./src/index.css"
/>
<script
type="module"
src="/src/index.ts"
></script>
<title>Vite + Lit + TS</title>
</head>
<body dir="rtl">
<div id="root"></div>
<script type="module">
import { html, render } from "lit";

const root = document.getElementById("root");

if (!root) throw new Error("Expects a root element.");

render(html``, root);
</script>
<body>
<h1>Vite + Lit</h1>
</body>
</html>
14 changes: 14 additions & 0 deletions dev/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@tapsioss/dev",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"lit": "^3.2.1"
}
}
1 change: 1 addition & 0 deletions dev/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added dev/src/index.css
Empty file.
2 changes: 2 additions & 0 deletions dev/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Import modules using path aliases
// i.e. `import "@tapsioss/web-components/avatar";`
1 change: 1 addition & 0 deletions dev/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
11 changes: 11 additions & 0 deletions dev/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ES2020",

"moduleResolution": "Bundler",
"allowImportingTsExtensions": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
6 changes: 6 additions & 0 deletions dev/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
plugins: [tsconfigPaths()],
});
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export default config(
parserOptions: {
tsconfigRootDir: import.meta.dirname,
project: true,
projectService: true,
projectService: {
defaultProject: "./tsconfig.json",
allowDefaultProject: ["dev/vite.config.ts"],
},
sourceType: "module",
},
},
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"web-icons:release": "pnpm --filter @tapsioss/web-icons run release",
"react-icons:build": "pnpm --filter @tapsioss/react-icons run build",
"react-icons:release": "pnpm --filter @tapsioss/react-icons run release",
"dev:transpile": "tsc --project tsconfig.dev.json --watch --preserveWatchOutput",
"dev": "pnpm clear:dist && pnpm dev:transpile & wds",
"dev": "pnpm --filter @tapsioss/dev run dev",
"build:packages": "pnpm run -r --parallel build",
"release:packages": "pnpm run -r release",
"test": "pnpm run -r --parallel test",
Expand Down Expand Up @@ -55,8 +54,7 @@
"@types/react-dom": "^18.3.1",
"@types/semver": "^7.5.8",
"@types/sinon": "^17.0.3",
"@web/dev-server": "^0.4.2",
"@web/dev-server-esbuild": "^1.0.2",
"@web/dev-server-esbuild": "^1.0.3",
"@web/test-runner": "^0.18.0",
"cemnama": "0.0.0-alpha-5",
"custom-elements-manifest": "^2.1.0",
Expand Down Expand Up @@ -87,6 +85,8 @@
"tsx": "^4.19.2",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.1",
"vite": "^5.4.11",
"vite-tsconfig-paths": "^5.1.2",
"vitepress": "^1.1.4"
}
}
81 changes: 64 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages:
# all packages in direct subdirs of packages/
- "packages/*"
- "dev"
9 changes: 0 additions & 9 deletions web-dev-server.config.mjs

This file was deleted.

0 comments on commit 6db3d2d

Please sign in to comment.