-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Sandcastle Reborn #12574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Sandcastle Reborn #12574
Changes from all commits
eb55c7e
793ba88
8a73405
c05ed50
4a2082a
1d8cd04
1522aa7
f775608
c3e3f11
db51183
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/node_modules | ||
packages/sandcastle/node_modules | ||
/ThirdParty | ||
/Tools/** | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,8 @@ | |
"esbuild": "^0.25.0", | ||
"eslint": "^9.1.1", | ||
"eslint-plugin-html": "^8.1.1", | ||
"eslint-plugin-react-hooks": "^5.2.0", | ||
"eslint-plugin-react-refresh": "^0.4.19", | ||
Comment on lines
+66
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these should all go into the dev dependencies for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the nature of eslint after the "single top level flat-config" change these are actually used in the top level |
||
"express": "^4.17.1", | ||
"globals": "^16.0.0", | ||
"globby": "^14.0.0", | ||
|
@@ -101,6 +103,7 @@ | |
"rimraf": "^5.0.0", | ||
"tsd-jsdoc": "^2.5.0", | ||
"typescript": "^5.3.2", | ||
"typescript-eslint": "^8.30.1", | ||
"yargs": "^17.0.1" | ||
}, | ||
"scripts": { | ||
|
@@ -113,12 +116,13 @@ | |
"build-ts": "gulp buildTs", | ||
"build-third-party": "gulp buildThirdParty", | ||
"build-apps": "gulp buildApps", | ||
"build-sandcastle": "npm run build-app --workspace packages/sandcastle", | ||
"clean": "gulp clean", | ||
"cloc": "gulp cloc", | ||
"coverage": "gulp coverage", | ||
"build-docs": "gulp buildDocs", | ||
"build-docs-watch": "gulp buildDocsWatch", | ||
"eslint": "eslint \"./**/*.*js\" \"./**/*.html\" --cache --quiet", | ||
"eslint": "eslint \"./**/*.*js\" \"./**/*.*ts*\" \"./**/*.html\" --cache --quiet", | ||
"make-zip": "gulp makeZip", | ||
"markdownlint": "markdownlint \"**/*.md\"", | ||
"release": "gulp release", | ||
|
@@ -146,7 +150,7 @@ | |
"node": ">=18.18.0" | ||
}, | ||
"lint-staged": { | ||
"*.{js,cjs,mjs,css,html}": [ | ||
"*.{js,cjs,mjs,ts,tsx,css,html}": [ | ||
"eslint --cache --quiet", | ||
"prettier --write" | ||
], | ||
|
@@ -157,6 +161,7 @@ | |
}, | ||
"workspaces": [ | ||
"packages/engine", | ||
"packages/widgets" | ||
"packages/widgets", | ||
"packages/sandcastle" | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# CesiumJS Sandcastle | ||
|
||
This package is the application for Sandcastle. | ||
|
||
## Running/Building | ||
|
||
- `npm run dev`: run the development server | ||
- `npm run build`: build locally with vite defaults | ||
- `npm run preview`: run the production build locally. <!--TODO: I'm not sure if we actually need this for our purposes --> | ||
- `npm run build-app`: build to static files in `/Apps/Sandcastle2` for hosting/access from the root cesium dev server | ||
- `npm run build-ci`: build to static files in `/Apps/Sandcastle2` and configure paths as needed for CI deployment | ||
|
||
Linting and style is managed under the project root's scripts. | ||
|
||
## Expanding the ESLint configuration | ||
|
||
<!-- TODO: this section was auto-generated, should figure out if we want these suggestions then remove this --> | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: | ||
|
||
```js | ||
export default tseslint.config({ | ||
extends: [ | ||
// Remove ...tseslint.configs.recommended and replace with this | ||
...tseslint.configs.recommendedTypeChecked, | ||
// Alternatively, use this for stricter rules | ||
...tseslint.configs.strictTypeChecked, | ||
// Optionally, add this for stylistic rules | ||
...tseslint.configs.stylisticTypeChecked, | ||
], | ||
languageOptions: { | ||
// other options... | ||
parserOptions: { | ||
project: ["./tsconfig.node.json", "./tsconfig.app.json"], | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: | ||
|
||
```js | ||
// eslint.config.js | ||
import reactX from "eslint-plugin-react-x"; | ||
import reactDom from "eslint-plugin-react-dom"; | ||
|
||
export default tseslint.config({ | ||
plugins: { | ||
// Add the react-x and react-dom plugins | ||
"react-x": reactX, | ||
"react-dom": reactDom, | ||
}, | ||
rules: { | ||
// other rules... | ||
// Enable its recommended typescript rules | ||
...reactX.configs["recommended-typescript"].rules, | ||
...reactDom.configs.recommended.rules, | ||
}, | ||
}); | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Sandcastle Reborn</title> | ||
<style> | ||
/* Load fonts for itwin-ui */ | ||
@font-face { | ||
font-family: InterVariable; | ||
font-style: normal; | ||
font-weight: 100 900; | ||
font-display: swap; | ||
src: url("/fonts/InterVariable.woff2") format("woff2"); | ||
} | ||
|
||
@font-face { | ||
font-family: InterVariable; | ||
font-style: italic; | ||
font-weight: 100 900; | ||
font-display: swap; | ||
src: url("/fonts/InterVariable-Italic.woff2") format("woff2"); | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="app-container"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "@cesium/sandcastle", | ||
"private": true, | ||
"version": "0.0.1", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite --config vite.config.dev.ts", | ||
"build": "tsc -b && vite build --config vite.config.dev.ts", | ||
"preview": "vite preview --config vite.config.dev.ts", | ||
"build-app": "tsc -b && vite build --config vite.config.app.ts", | ||
"build-ci": "tsc -b && vite build --config vite.config.ci.ts" | ||
}, | ||
"dependencies": { | ||
"@itwin/itwinui-react": "^5.0.0-alpha.14", | ||
"@monaco-editor/react": "^4.7.0", | ||
"monaco-editor": "^0.52.2", | ||
"pako": "^2.1.0", | ||
"react": "^19.0.0", | ||
"react-dom": "^19.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/pako": "^2.0.3", | ||
"@types/react": "^19.0.10", | ||
"@types/react-dom": "^19.0.4", | ||
"@vitejs/plugin-react": "^4.3.4", | ||
"globals": "^15.15.0", | ||
"typescript": "~5.7.2", | ||
"vite": "^6.2.0", | ||
"vite-plugin-static-copy": "^2.3.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to target workspace which are dependencies to avoid the manual filtering.