Skip to content

Commit

Permalink
docs(preact): update example (#11608)
Browse files Browse the repository at this point in the history
**Related Issue:** #11176

## Summary

Updates Preact example using `create-preact`.
  • Loading branch information
jcfranco authored Feb 21, 2025
1 parent fd39d9e commit a0b93bf
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 1,972 deletions.
29 changes: 23 additions & 6 deletions examples/components/preact/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
/build
/*.log
src/assets
!src/assets/icons
!src/assets/favicon.ico
!src/assets/preact*
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
14 changes: 14 additions & 0 deletions examples/components/preact/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<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" />
<meta name="color-scheme" content="light dark" />
<title>Vite + Preact</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/index.ts"></script>
</body>
</html>
39 changes: 12 additions & 27 deletions examples/components/preact/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "calcite-preact-starter",
"private": true,
"type": "module",
"homepage": "https://developers.arcgis.com/calcite-design-system/",
"description": "Starter application for @esri/calcite-commponents with Preact and TypeScript",
"repository": {
Expand All @@ -9,13 +10,11 @@
"directory": "examples/components/preact"
},
"scripts": {
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider preact build --no-prerender",
"serve": "sirv build --cors --single",
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider preact watch",
"build": "vite build",
"dev": "vite",
"lint": "eslint src",
"test": "jest",
"postinstall": "npm run copy",
"copy": "ncp ./node_modules/@esri/calcite-components/dist/calcite/assets/ ./src/assets/"
"preview": "vite preview",
"test": "vitest"
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
Expand All @@ -29,33 +28,19 @@
},
"dependencies": {
"@esri/calcite-components": "3.0.3",
"preact": "^10.10.0",
"preact-render-to-string": "^5.2.1",
"preact-router": "^3.2.1"
"preact": "^10.26.2",
"preact-iso": "^2.9.0"
},
"devDependencies": {
"@types/enzyme": "^3.10.12",
"@types/jest": "^27.4.1",
"@preact/preset-vite": "^2.10.1",
"@testing-library/preact": "^3.2.4",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
"cross-env": "^7.0.3",
"enzyme": "^3.11.0",
"enzyme-adapter-preact-pure": "^4.0.1",
"eslint": "^8.20.0",
"eslint-config-preact": "^1.3.0",
"jest": "^27.5.1",
"jest-preset-preact": "^4.0.5",
"ncp": "^2.0.0",
"preact-cli": "^3.4.0",
"sirv-cli": "^2.0.2",
"typescript": "^4.5.2"
},
"jest": {
"preset": "jest-preset-preact",
"setupFiles": [
"<rootDir>/tests/__mocks__/browserMocks.ts",
"<rootDir>/tests/__mocks__/setupTests.ts"
]
"typescript": "^4.5.2",
"vite-plugin-static-copy": "^2.2.0",
"vitest": "^3.0.6"
},
"volta": {
"node": "18.13.0"
Expand Down
Loading

0 comments on commit a0b93bf

Please sign in to comment.