-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-missing-dynamic-tailwind-margins-in-the-…
…CSS-bundle
- Loading branch information
Showing
11 changed files
with
177 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react-hooks/recommended", | ||
"prettier", | ||
"../../configuration/eslint-rules/best-practices.cjs", | ||
"../../configuration/eslint-rules/possible-errors.cjs", | ||
"../../configuration/eslint-rules/variables.cjs", | ||
], | ||
ignorePatterns: ["dist", ".eslintrc.cjs"], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["react-refresh", "simple-import-sort"], | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"react-refresh/only-export-components": [ | ||
"warn", | ||
{ allowConstantExport: true }, | ||
], | ||
"simple-import-sort/imports": "error", | ||
"simple-import-sort/exports": "error", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#64748b"> | ||
<link rel="icon" type="image/png" href="/favicon.ico?v=2"> | ||
|
||
<title>UI Components</title> | ||
|
||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@versini/bundlesize", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"author": "Arno Versini", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"bundlesize": "bundlemon", | ||
"clean": "rimraf dist", | ||
"build": "yarn run clean && vite build", | ||
"test": "echo \"WARNING: no test specified\" && exit 0", | ||
"test:coverage": "echo \"WARNING: no test specified\" && exit 0" | ||
}, | ||
"dependencies": { | ||
"@versini/ui-components": "*", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import "@versini/ui-components/dist/style.css"; | ||
|
||
import * as UI from "@versini/ui-components"; | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
|
||
Object.keys(UI).forEach(() => { | ||
/** | ||
* This is simply to loop through all components | ||
* and trick rollup into bundling them (instead of | ||
* simply tree-shaking anything that is imported but | ||
* not used...) | ||
*/ | ||
}); | ||
|
||
ReactDOM.createRoot(document.getElementById("root")!).render( | ||
<React.StrictMode>hello</React.StrictMode>, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "ESNext", | ||
"skipLibCheck": true, | ||
"types": ["vitest/globals", "@testing-library/jest-dom"], | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"skipLibCheck": true, | ||
"module": "ESNext", | ||
"moduleResolution": "bundler", | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"include": ["./vite.config.ts", "./vitest.setup.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import fs from "fs-extra"; | ||
import { defineConfig } from "vite"; | ||
|
||
const packageJson = fs.readJSONSync("package.json"); | ||
|
||
const buildTime = new Date() | ||
.toLocaleString("en-US", { | ||
timeZone: "America/New_York", | ||
timeZoneName: "short", | ||
year: "numeric", | ||
month: "2-digit", | ||
day: "2-digit", | ||
hour: "2-digit", | ||
minute: "2-digit", | ||
}) | ||
.replace(/,/g, ""); | ||
|
||
export default defineConfig({ | ||
esbuild: { | ||
supported: { | ||
"top-level-await": true, //browsers can handle top-level-await features | ||
}, | ||
}, | ||
build: { | ||
rollupOptions: { | ||
external: [ | ||
"@floating-ui/react", | ||
"@tailwindcss/typography", | ||
"react", | ||
"react/jsx-runtime", | ||
"react-dom", | ||
"tailwindcss", | ||
], | ||
output: { | ||
assetFileNames: "assets/style[extname]", | ||
entryFileNames: "assets/[name].js", | ||
}, | ||
}, | ||
}, | ||
define: { | ||
"import.meta.env.BUILDTIME": JSON.stringify(buildTime), | ||
"import.meta.env.BUILDVERSION": JSON.stringify(packageJson.version), | ||
}, | ||
plugins: [], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters