create-swdg-frontend 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -13
- package/bin/index.js +3 -244
- package/lib/argv.js +43 -0
- package/lib/cli.js +141 -0
- package/lib/constants.js +24 -0
- package/lib/gis.js +92 -0
- package/lib/manifest.js +23 -0
- package/lib/prompts.js +55 -0
- package/lib/scaffold.js +118 -0
- package/package.json +6 -2
- package/scripts/sync-template.js +120 -0
- package/scripts/validate-template.mjs +74 -0
- package/stubs/tsconfig.node.json +11 -0
- package/stubs/types-env.d.ts +9 -0
- package/stubs/vite.config.ts +64 -0
- package/template/.env.example +6 -0
- package/template/.github/workflows/ci.yml +23 -0
- package/template/.github/workflows/release.yml +69 -0
- package/template/.husky/commit-msg +42 -42
- package/template/.husky/pre-commit +2 -2
- package/template/.husky/prepare-commit-msg +0 -0
- package/template/.lintstagedrc +5 -5
- package/template/.prettierignore +26 -26
- package/template/.prettierrc.cjs +10 -10
- package/template/.stylelintignore +1 -1
- package/template/.stylelintrc.json +12 -6
- package/template/README.md +99 -36
- package/template/auto-imports.d.ts +10 -0
- package/template/commitlint.config.cjs +64 -64
- package/template/docs/MAINTAINER.md +77 -0
- package/template/docs/ONBOARDING.md +284 -0
- package/template/docs/TESTING.md +104 -0
- package/template/eslint.config.js +97 -96
- package/template/index.html +17 -17
- package/template/interface/user.ts +5 -5
- package/template/package.json +88 -86
- package/template/pnpm-lock.yaml +6360 -0
- package/template/postcss.config.js +5 -0
- package/template/scripts/gen-api.cjs +280 -230
- package/template/scripts/release.mjs +53 -59
- package/template/scripts/set-release-version.mjs +46 -0
- package/template/scripts/test-pipeline.mjs +85 -0
- package/template/scripts/test-scaffold.mjs +197 -0
- package/template/scripts/test-template.mjs +52 -0
- package/template/scripts/verify.mjs +28 -0
- package/template/scripts/vite-plugin-cesium-dev.ts +56 -0
- package/template/src/App.vue +6 -6
- package/template/src/api/README.md +7 -3
- package/template/src/assets/favicon.svg +49 -49
- package/template/src/components/Body/index.vue +80 -16
- package/template/src/components/CesiumViewer/index.vue +36 -0
- package/template/src/components/Header/index.vue +19 -8
- package/template/src/components/OnboardingDeck/index.vue +449 -0
- package/template/src/data/onboardingSlides.ts +208 -0
- package/template/src/directive/focus.ts +9 -9
- package/template/src/layout/BasicLayout.vue +28 -28
- package/template/src/main.ts +25 -33
- package/template/src/router/index.ts +30 -24
- package/template/src/router/routeUtils.ts +13 -0
- package/template/src/stores/README.md +3 -3
- package/template/src/stores/useCounter.ts +12 -12
- package/template/src/styles/alerts.less +85 -85
- package/template/src/styles/global.css +326 -326
- package/template/src/styles/shell.css +232 -0
- package/template/src/utils/alert.ts +58 -58
- package/template/src/utils/axios-middleware.js +180 -0
- package/template/src/utils/cesium/index.ts +71 -0
- package/template/src/utils/components.ts +21 -21
- package/template/src/utils/composables/useAlert.ts +14 -14
- package/template/src/utils/composables/useFeatureGis.ts +24 -0
- package/template/src/utils/http.ts +5 -0
- package/template/src/views/examples/cesium/index.vue +85 -0
- package/template/src/views/examples/guide/index.vue +42 -0
- package/template/src/views/examples/test/index.vue +63 -0
- package/template/src/views/index.vue +8 -9
- package/template/src/vite-env.d.ts +1 -1
- package/template/tests/README.md +7 -6
- package/template/tests/e2e/README.md +3 -3
- package/template/tests/setup.ts +1 -1
- package/template/tests/unit/onboardingSlides.test.ts +20 -0
- package/template/tests/unit/router.utils.test.ts +21 -0
- package/template/tests/unit/scaffold.lib.test.ts +44 -0
- package/template/tests/unit/useFeatureGis.test.ts +14 -0
- package/template/tests/utils/helpers.ts +1 -1
- package/template/tsconfig.json +51 -51
- package/template/tsconfig.node.json +11 -11
- package/template/types/README.md +3 -3
- package/template/types/env.d.ts +13 -0
- package/template/types/global.d.ts +9 -9
- package/template/vite.config.ts +89 -75
- package/template/vitest.config.ts +22 -9
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -438
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1012
- package/template/public/Cesium1.119/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1012
- package/template/public/Cesium1.119/Assets/Images/bing_maps_credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Images/cesium_credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Images/google_earth_credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Images/ion-credit.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/airfield.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/airport.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/america-football.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/art-gallery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bakery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bank.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bar.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/baseball.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/basketball.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/beer.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bicycle.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/building.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/bus.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cafe.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/camera.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/campsite.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/car.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cemetery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cesium.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/chemist.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cinema.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/circle-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/circle.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/city.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/clothing-store.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/college.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/commercial.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cricket.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/cross.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/dam.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/danger.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/disability.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/dog-park.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/embassy.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/entrance.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/farm.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/fast-food.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/ferry.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/fire-station.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/fuel.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/garden.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/gift.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/golf.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/grocery.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/hairdresser.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/harbor.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/heart.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/heliport.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/hospital.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/ice-cream.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/industrial.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/land-use.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/laundry.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/library.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/lighthouse.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/lodging.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/logging.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/london-underground.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/marker-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/marker.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/minefield.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/mobilephone.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/monument.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/museum.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/music.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/oil-well.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/park.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/park2.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/parking-garage.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/parking.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/pharmacy.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/pitch.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/place-of-worship.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/playground.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/police.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/polling-place.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/post.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/prison.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-above.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-light.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-metro.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail-underground.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rail.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/religious-christian.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/religious-jewish.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/religious-muslim.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/restaurant.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/roadblock.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/rocket.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/school.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/scooter.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/shop.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/skiing.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/soccer.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/square-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/square.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/star-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/star.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/suitcase.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/swimming.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/telephone.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/tennis.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/theatre.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/toilets.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/town-hall.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/town.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/triangle.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/village.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/warehouse.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/waste-basket.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/water.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/wetland.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/maki/zoo.png +0 -0
- package/template/public/Cesium1.119/Assets/Textures/moonSmall.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/pin.svg +0 -1
- package/template/public/Cesium1.119/Assets/Textures/waterNormals.jpg +0 -0
- package/template/public/Cesium1.119/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/template/public/Cesium1.119/Assets/approximateTerrainHeights.json +0 -10924
- package/template/public/Cesium1.119/Cesium.js +0 -185772
- package/template/public/Cesium1.119/ThirdParty/Workers/package.json +0 -3
- package/template/public/Cesium1.119/ThirdParty/Workers/pako_deflate.min.js +0 -1681
- package/template/public/Cesium1.119/ThirdParty/Workers/pako_inflate.min.js +0 -1489
- package/template/public/Cesium1.119/ThirdParty/Workers/z-worker-pako.js +0 -1070
- package/template/public/Cesium1.119/ThirdParty/basis_transcoder.wasm +0 -0
- package/template/public/Cesium1.119/ThirdParty/draco_decoder.wasm +0 -0
- package/template/public/Cesium1.119/ThirdParty/google-earth-dbroot-parser.js +0 -11424
- package/template/public/Cesium1.119/Widgets/Animation/Animation.css +0 -127
- package/template/public/Cesium1.119/Widgets/Animation/lighter.css +0 -78
- package/template/public/Cesium1.119/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -112
- package/template/public/Cesium1.119/Widgets/BaseLayerPicker/lighter.css +0 -28
- package/template/public/Cesium1.119/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -104
- package/template/public/Cesium1.119/Widgets/CesiumInspector/CesiumInspector.css +0 -115
- package/template/public/Cesium1.119/Widgets/CesiumWidget/CesiumWidget.css +0 -119
- package/template/public/Cesium1.119/Widgets/CesiumWidget/lighter.css +0 -14
- package/template/public/Cesium1.119/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/template/public/Cesium1.119/Widgets/Geocoder/Geocoder.css +0 -72
- package/template/public/Cesium1.119/Widgets/Geocoder/lighter.css +0 -17
- package/template/public/Cesium1.119/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/template/public/Cesium1.119/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/template/public/Cesium1.119/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/TimelineIcons.png +0 -0
- package/template/public/Cesium1.119/Widgets/Images/info-loading.gif +0 -0
- package/template/public/Cesium1.119/Widgets/InfoBox/InfoBox.css +0 -94
- package/template/public/Cesium1.119/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/template/public/Cesium1.119/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -95
- package/template/public/Cesium1.119/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/template/public/Cesium1.119/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/template/public/Cesium1.119/Widgets/ProjectionPicker/ProjectionPicker.css +0 -46
- package/template/public/Cesium1.119/Widgets/SceneModePicker/SceneModePicker.css +0 -72
- package/template/public/Cesium1.119/Widgets/SelectionIndicator/SelectionIndicator.css +0 -22
- package/template/public/Cesium1.119/Widgets/Timeline/Timeline.css +0 -103
- package/template/public/Cesium1.119/Widgets/Timeline/lighter.css +0 -18
- package/template/public/Cesium1.119/Widgets/VRButton/VRButton.css +0 -8
- package/template/public/Cesium1.119/Widgets/Viewer/Viewer.css +0 -107
- package/template/public/Cesium1.119/Widgets/VoxelInspector/VoxelInspector.css +0 -18
- package/template/public/Cesium1.119/Widgets/lighter.css +0 -246
- package/template/public/Cesium1.119/Widgets/lighterShared.css +0 -46
- package/template/public/Cesium1.119/Widgets/shared.css +0 -103
- package/template/public/Cesium1.119/Widgets/widgets.css +0 -1376
- package/template/public/Cesium1.119/Workers/chunk-3C7WC463.js +0 -611
- package/template/public/Cesium1.119/Workers/chunk-3JW36LZF.js +0 -166
- package/template/public/Cesium1.119/Workers/chunk-4BTGX3WJ.js +0 -264
- package/template/public/Cesium1.119/Workers/chunk-4WRMLZA7.js +0 -128
- package/template/public/Cesium1.119/Workers/chunk-7Z5IIKOJ.js +0 -8046
- package/template/public/Cesium1.119/Workers/chunk-ABGXSJNX.js +0 -341
- package/template/public/Cesium1.119/Workers/chunk-AMQUWUD4.js +0 -269
- package/template/public/Cesium1.119/Workers/chunk-ATPDRNKI.js +0 -28
- package/template/public/Cesium1.119/Workers/chunk-BMHPVZ4H.js +0 -199
- package/template/public/Cesium1.119/Workers/chunk-CBEO3SHS.js +0 -1102
- package/template/public/Cesium1.119/Workers/chunk-CV7DLCWG.js +0 -485
- package/template/public/Cesium1.119/Workers/chunk-DQO6B4EQ.js +0 -76
- package/template/public/Cesium1.119/Workers/chunk-ED3TLP6D.js +0 -91
- package/template/public/Cesium1.119/Workers/chunk-EFZKO5RU.js +0 -42
- package/template/public/Cesium1.119/Workers/chunk-F5IHREXR.js +0 -2678
- package/template/public/Cesium1.119/Workers/chunk-FKRG4HDY.js +0 -516
- package/template/public/Cesium1.119/Workers/chunk-FYOYUPXG.js +0 -399
- package/template/public/Cesium1.119/Workers/chunk-GFN7NNSJ.js +0 -65
- package/template/public/Cesium1.119/Workers/chunk-HEEMUCG6.js +0 -92
- package/template/public/Cesium1.119/Workers/chunk-HSWA4OEL.js +0 -672
- package/template/public/Cesium1.119/Workers/chunk-IAC5XVZV.js +0 -287
- package/template/public/Cesium1.119/Workers/chunk-II4VNKYR.js +0 -50
- package/template/public/Cesium1.119/Workers/chunk-ILGBPNP6.js +0 -28
- package/template/public/Cesium1.119/Workers/chunk-IRH46BDL.js +0 -124
- package/template/public/Cesium1.119/Workers/chunk-IUA6FAOZ.js +0 -31
- package/template/public/Cesium1.119/Workers/chunk-K4ASOM65.js +0 -331
- package/template/public/Cesium1.119/Workers/chunk-KCIZBVXL.js +0 -258
- package/template/public/Cesium1.119/Workers/chunk-KF5NF354.js +0 -162
- package/template/public/Cesium1.119/Workers/chunk-KRKI6AAO.js +0 -773
- package/template/public/Cesium1.119/Workers/chunk-KZNJOCYU.js +0 -162
- package/template/public/Cesium1.119/Workers/chunk-O5IJ3OGP.js +0 -857
- package/template/public/Cesium1.119/Workers/chunk-OO23RBLX.js +0 -183
- package/template/public/Cesium1.119/Workers/chunk-P37AI2DW.js +0 -85
- package/template/public/Cesium1.119/Workers/chunk-PDMQLSBL.js +0 -108
- package/template/public/Cesium1.119/Workers/chunk-PEYJTJPE.js +0 -73
- package/template/public/Cesium1.119/Workers/chunk-POASMU2N.js +0 -2372
- package/template/public/Cesium1.119/Workers/chunk-PXCJYT2S.js +0 -73
- package/template/public/Cesium1.119/Workers/chunk-Q6L7X3LP.js +0 -538
- package/template/public/Cesium1.119/Workers/chunk-QB3MDM4J.js +0 -1670
- package/template/public/Cesium1.119/Workers/chunk-R6KGAEF6.js +0 -392
- package/template/public/Cesium1.119/Workers/chunk-RXTBM4OI.js +0 -57
- package/template/public/Cesium1.119/Workers/chunk-SB224QGV.js +0 -72
- package/template/public/Cesium1.119/Workers/chunk-T6BE4RZK.js +0 -37
- package/template/public/Cesium1.119/Workers/chunk-TAMCUKAR.js +0 -814
- package/template/public/Cesium1.119/Workers/chunk-TMSETF7M.js +0 -579
- package/template/public/Cesium1.119/Workers/chunk-TOGHF3VN.js +0 -376
- package/template/public/Cesium1.119/Workers/chunk-UH2WFNTA.js +0 -111
- package/template/public/Cesium1.119/Workers/chunk-V7JEDBOE.js +0 -573
- package/template/public/Cesium1.119/Workers/chunk-VBIROZR5.js +0 -633
- package/template/public/Cesium1.119/Workers/chunk-W23CU777.js +0 -271
- package/template/public/Cesium1.119/Workers/chunk-X5IHHI6X.js +0 -173
- package/template/public/Cesium1.119/Workers/chunk-XHX2UPDO.js +0 -217
- package/template/public/Cesium1.119/Workers/combineGeometry.js +0 -53
- package/template/public/Cesium1.119/Workers/createBoxGeometry.js +0 -45
- package/template/public/Cesium1.119/Workers/createBoxOutlineGeometry.js +0 -189
- package/template/public/Cesium1.119/Workers/createCircleGeometry.js +0 -148
- package/template/public/Cesium1.119/Workers/createCircleOutlineGeometry.js +0 -105
- package/template/public/Cesium1.119/Workers/createCoplanarPolygonGeometry.js +0 -293
- package/template/public/Cesium1.119/Workers/createCoplanarPolygonOutlineGeometry.js +0 -143
- package/template/public/Cesium1.119/Workers/createCorridorGeometry.js +0 -830
- package/template/public/Cesium1.119/Workers/createCorridorOutlineGeometry.js +0 -417
- package/template/public/Cesium1.119/Workers/createCylinderGeometry.js +0 -47
- package/template/public/Cesium1.119/Workers/createCylinderOutlineGeometry.js +0 -170
- package/template/public/Cesium1.119/Workers/createEllipseGeometry.js +0 -58
- package/template/public/Cesium1.119/Workers/createEllipseOutlineGeometry.js +0 -51
- package/template/public/Cesium1.119/Workers/createEllipsoidGeometry.js +0 -46
- package/template/public/Cesium1.119/Workers/createEllipsoidOutlineGeometry.js +0 -45
- package/template/public/Cesium1.119/Workers/createFrustumGeometry.js +0 -45
- package/template/public/Cesium1.119/Workers/createFrustumOutlineGeometry.js +0 -164
- package/template/public/Cesium1.119/Workers/createGeometry.js +0 -159
- package/template/public/Cesium1.119/Workers/createGroundPolylineGeometry.js +0 -911
- package/template/public/Cesium1.119/Workers/createPlaneGeometry.js +0 -185
- package/template/public/Cesium1.119/Workers/createPlaneOutlineGeometry.js +0 -93
- package/template/public/Cesium1.119/Workers/createPolygonGeometry.js +0 -884
- package/template/public/Cesium1.119/Workers/createPolygonOutlineGeometry.js +0 -359
- package/template/public/Cesium1.119/Workers/createPolylineGeometry.js +0 -349
- package/template/public/Cesium1.119/Workers/createPolylineVolumeGeometry.js +0 -262
- package/template/public/Cesium1.119/Workers/createPolylineVolumeOutlineGeometry.js +0 -177
- package/template/public/Cesium1.119/Workers/createRectangleGeometry.js +0 -787
- package/template/public/Cesium1.119/Workers/createRectangleOutlineGeometry.js +0 -299
- package/template/public/Cesium1.119/Workers/createSimplePolylineGeometry.js +0 -294
- package/template/public/Cesium1.119/Workers/createSphereGeometry.js +0 -84
- package/template/public/Cesium1.119/Workers/createSphereOutlineGeometry.js +0 -83
- package/template/public/Cesium1.119/Workers/createTaskProcessorWorker.js +0 -28
- package/template/public/Cesium1.119/Workers/createVectorTileClampedPolylines.js +0 -289
- package/template/public/Cesium1.119/Workers/createVectorTileGeometries.js +0 -258
- package/template/public/Cesium1.119/Workers/createVectorTilePoints.js +0 -79
- package/template/public/Cesium1.119/Workers/createVectorTilePolygons.js +0 -275
- package/template/public/Cesium1.119/Workers/createVectorTilePolylines.js +0 -176
- package/template/public/Cesium1.119/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -375
- package/template/public/Cesium1.119/Workers/createVerticesFromHeightmap.js +0 -1772
- package/template/public/Cesium1.119/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -425
- package/template/public/Cesium1.119/Workers/createWallGeometry.js +0 -320
- package/template/public/Cesium1.119/Workers/createWallOutlineGeometry.js +0 -229
- package/template/public/Cesium1.119/Workers/decodeDraco.js +0 -227
- package/template/public/Cesium1.119/Workers/decodeGoogleEarthEnterprisePacket.js +0 -1836
- package/template/public/Cesium1.119/Workers/decodeI3S.js +0 -924
- package/template/public/Cesium1.119/Workers/transcodeKTX2.js +0 -3180
- package/template/public/Cesium1.119/Workers/transferTypedArrayTest.js +0 -34
- package/template/public/Cesium1.119/Workers/upsampleQuantizedTerrainMesh.js +0 -534
- package/template/public/Cesium1.119/index.cjs +0 -185632
- package/template/public/Cesium1.119/index.js +0 -182874
- package/template/src/views/Test/index.vue +0 -23
- package/template/tests/unit/example.test.ts +0 -7
package/template/.prettierrc.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
semi: true, // 在语句末尾添加分号
|
|
3
|
-
singleQuote: true, // 使用单引号而不是双引号
|
|
4
|
-
trailingComma: 'es5', // 多行时尽可能打印尾随逗号
|
|
5
|
-
bracketSpacing: true, // 在对象的括号之间添加空格
|
|
6
|
-
tabWidth: 2, // 指定每个缩进级别的空格数
|
|
7
|
-
useTabs: false, // 使用空格代替制表符
|
|
8
|
-
endOfLine: 'lf', // 维持现有的行尾(防止在不同操作系统间出现问题)
|
|
9
|
-
printWidth: 80, // 推荐值是 80 或 120
|
|
10
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
semi: true, // 在语句末尾添加分号
|
|
3
|
+
singleQuote: true, // 使用单引号而不是双引号
|
|
4
|
+
trailingComma: 'es5', // 多行时尽可能打印尾随逗号
|
|
5
|
+
bracketSpacing: true, // 在对象的括号之间添加空格
|
|
6
|
+
tabWidth: 2, // 指定每个缩进级别的空格数
|
|
7
|
+
useTabs: false, // 使用空格代替制表符
|
|
8
|
+
endOfLine: 'lf', // 维持现有的行尾(防止在不同操作系统间出现问题)
|
|
9
|
+
printWidth: 80, // 推荐值是 80 或 120
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
src/style/**
|
|
1
|
+
src/style/**
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["stylelint-config-standard", "stylelint-config-recommended-vue"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"no-empty-source": null
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": ["stylelint-config-standard", "stylelint-config-recommended-vue"],
|
|
3
|
+
"rules": {
|
|
4
|
+
"no-empty-source": null,
|
|
5
|
+
"selector-class-pattern": [
|
|
6
|
+
"^([a-z][a-z0-9]*(-[a-z0-9]+)*)(__([a-z][a-z0-9]*(-[a-z0-9]+)*))*(-{1,2}([a-z][a-z0-9]*(-[a-z0-9]+)*))*?$",
|
|
7
|
+
{
|
|
8
|
+
"message": "Use kebab-case or BEM (block__element--modifier)"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
}
|
package/template/README.md
CHANGED
|
@@ -1,36 +1,99 @@
|
|
|
1
|
-
# Frontend Framework
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
# SWDG Frontend Framework
|
|
2
|
+
|
|
3
|
+
面向团队的 **Vue 3 + TypeScript + Vite** 标准模板与脚手架(`create-swdg`)。
|
|
4
|
+
|
|
5
|
+
设计参考 Google / Meta / Microsoft 内部生成器常见模式:
|
|
6
|
+
|
|
7
|
+
- **薄 CLI、厚模板**:逻辑在模板仓库迭代,CLI 只做拷贝与特性裁剪
|
|
8
|
+
- **Feature flags**:重型能力(GIS)默认关闭,按需 opt-in
|
|
9
|
+
- **示例与业务分离**:`src/views/examples/` 仅 dev 路由,生产自动剔除
|
|
10
|
+
- **可验证**:创建后可跑 `typecheck`;模板发布前 `validate-template`
|
|
11
|
+
- **可追溯**:生成 `.swdg/manifest.json` 记录创建参数
|
|
12
|
+
|
|
13
|
+
## 如何使用本项目
|
|
14
|
+
|
|
15
|
+
**完整说明(环境、路由、接口、GIS、构建)** → **[docs/ONBOARDING.md](docs/ONBOARDING.md)**
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm install
|
|
19
|
+
cp .env.example .env # 含 VITE_FEATURE_GIS、代理地址
|
|
20
|
+
pnpm dev # http://localhost:3000 ,改 .env 后需重启
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| 你想做的事 | 怎么做 |
|
|
24
|
+
| ------------ | ---------------------------------------------------------------------- |
|
|
25
|
+
| 跑起来看效果 | 首页 `/#/` → 开发示例卡片 → Cesium / Store 示例 |
|
|
26
|
+
| 加一个新页面 | `src/views/模块名/index.vue` → 自动得到 `/#/模块名` |
|
|
27
|
+
| 调后端接口 | `src/api/` + 开发代理 `/demo` → `VITE_DEMO_PROXY_TARGET` |
|
|
28
|
+
| 开三维地图 | `.env` 设 `VITE_FEATURE_GIS=true`,用 `CesiumViewer` 或 `createViewer` |
|
|
29
|
+
| 提交前检查 | `pnpm verify` |
|
|
30
|
+
|
|
31
|
+
维护模板 / 发 npm → [docs/MAINTAINER.md](docs/MAINTAINER.md) · 测试门禁 → [docs/TESTING.md](docs/TESTING.md)
|
|
32
|
+
|
|
33
|
+
## 创建新项目(脚手架)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pnpm create swdg my-app
|
|
37
|
+
# 或
|
|
38
|
+
npx create-swdg-frontend my-app
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
交互会询问:项目名、**是否 GIS(默认否)**、是否安装依赖、是否 Git、是否 typecheck 校验。
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# 非 GIS 项目(推荐多数后台类应用)
|
|
45
|
+
pnpm create swdg my-app --no-gis --install
|
|
46
|
+
|
|
47
|
+
# GIS 项目
|
|
48
|
+
pnpm create swdg my-app --gis --install
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 目录结构
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
src/
|
|
55
|
+
├── api/ # 接口
|
|
56
|
+
├── components/ # 公共组件
|
|
57
|
+
├── layout/
|
|
58
|
+
├── router/ # 约定式路由(views 下文件即路由)
|
|
59
|
+
├── stores/
|
|
60
|
+
├── utils/
|
|
61
|
+
├── views/ # 业务页面
|
|
62
|
+
│ └── examples/ # 开发示例(生产构建剔除)
|
|
63
|
+
interface/
|
|
64
|
+
types/
|
|
65
|
+
docs/
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Cesium / GIS(可选特性)
|
|
69
|
+
|
|
70
|
+
启用后包含:`cesium`、`vite-plugin-static-copy`、开发中间件、`/#/examples/cesium`。
|
|
71
|
+
|
|
72
|
+
- 底图:OpenStreetMap(无需 Ion token)
|
|
73
|
+
- 可选:`VITE_CESIUM_ION_ACCESS_TOKEN`
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { createViewer } from '@utils/cesium';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 维护者与发布
|
|
80
|
+
|
|
81
|
+
见 [docs/MAINTAINER.md](docs/MAINTAINER.md)。
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pnpm verify # 本地质量门禁
|
|
85
|
+
cd create-swdg && pnpm sync-template # 同步模板
|
|
86
|
+
cd create-swdg && node scripts/validate-template.mjs
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 脚本
|
|
90
|
+
|
|
91
|
+
| 命令 | 说明 |
|
|
92
|
+
| ---------------- | ------------------------------------ |
|
|
93
|
+
| `pnpm dev` | 开发 |
|
|
94
|
+
| `pnpm build` | 构建 |
|
|
95
|
+
| `pnpm typecheck` | TS 检查 |
|
|
96
|
+
| `pnpm verify` | typecheck + lint(日常) |
|
|
97
|
+
| `pnpm test:ci` | 发布门禁(全量,见 docs/TESTING.md) |
|
|
98
|
+
| `pnpm gen:api` | OpenAPI 生成 |
|
|
99
|
+
| `pnpm release` | 先跑 test:ci,再发布 npm 包 |
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['@commitlint/config-conventional'],
|
|
3
|
-
rules: {
|
|
4
|
-
// 提交消息的类型必须是以下之一
|
|
5
|
-
'type-enum': [
|
|
6
|
-
2, // 错误级别
|
|
7
|
-
'always',
|
|
8
|
-
[
|
|
9
|
-
'feat', // 新功能
|
|
10
|
-
'fix', // 修复问题
|
|
11
|
-
'update', // 更新现有功能
|
|
12
|
-
'docs', // 文档更新
|
|
13
|
-
'style', // 代码格式(不影响功能)
|
|
14
|
-
'refactor', // 重构代码(不影响功能)
|
|
15
|
-
'perf', // 性能优化
|
|
16
|
-
'test', // 添加或修改测试
|
|
17
|
-
'chore', // 杂项更新(比如构建工具)
|
|
18
|
-
'revert', // 回滚提交
|
|
19
|
-
'build', // 构建系统或外部依赖变更
|
|
20
|
-
'ci', // CI/CD 配置或脚本修改
|
|
21
|
-
],
|
|
22
|
-
],
|
|
23
|
-
// 允许范围为空
|
|
24
|
-
'scope-empty': [0, 'never'],
|
|
25
|
-
'scope-case': [2, 'always'],
|
|
26
|
-
// 提交消息的主题不能为空
|
|
27
|
-
'subject-empty': [2, 'never'],
|
|
28
|
-
// 不限制提交消息结尾的标点符号
|
|
29
|
-
'subject-full-stop': [0, 'never'],
|
|
30
|
-
// 限制提交消息的主题长度
|
|
31
|
-
'header-max-length': [2, 'always', 72],
|
|
32
|
-
// 'message-case': [2, 'always', 'lower-case'],
|
|
33
|
-
},
|
|
34
|
-
prompt: {
|
|
35
|
-
messages: {
|
|
36
|
-
skip: ':跳过',
|
|
37
|
-
max: '最多输入 %d 个字符',
|
|
38
|
-
min: '至少输入 %d 个字符',
|
|
39
|
-
emptyWarning: '请填写有效内容',
|
|
40
|
-
upperLimitWarning: '长度超过限制',
|
|
41
|
-
lowerLimitWarning: '长度不足',
|
|
42
|
-
},
|
|
43
|
-
questions: {
|
|
44
|
-
type: {
|
|
45
|
-
description: '选择提交类型(如:feat, fix, docs等)',
|
|
46
|
-
},
|
|
47
|
-
scope: {
|
|
48
|
-
description: '影响的模块范围(如:auth, api等,可选)',
|
|
49
|
-
},
|
|
50
|
-
subject: {
|
|
51
|
-
description: '简要描述本次提交(限72个字符以内)',
|
|
52
|
-
},
|
|
53
|
-
body: {
|
|
54
|
-
description: '详细描述本次提交(可选)',
|
|
55
|
-
},
|
|
56
|
-
breaking: {
|
|
57
|
-
description: '列出任何破坏性更新(可选)',
|
|
58
|
-
},
|
|
59
|
-
footer: {
|
|
60
|
-
description: '关联的issue,例如:#123, #456(可选)',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['@commitlint/config-conventional'],
|
|
3
|
+
rules: {
|
|
4
|
+
// 提交消息的类型必须是以下之一
|
|
5
|
+
'type-enum': [
|
|
6
|
+
2, // 错误级别
|
|
7
|
+
'always',
|
|
8
|
+
[
|
|
9
|
+
'feat', // 新功能
|
|
10
|
+
'fix', // 修复问题
|
|
11
|
+
'update', // 更新现有功能
|
|
12
|
+
'docs', // 文档更新
|
|
13
|
+
'style', // 代码格式(不影响功能)
|
|
14
|
+
'refactor', // 重构代码(不影响功能)
|
|
15
|
+
'perf', // 性能优化
|
|
16
|
+
'test', // 添加或修改测试
|
|
17
|
+
'chore', // 杂项更新(比如构建工具)
|
|
18
|
+
'revert', // 回滚提交
|
|
19
|
+
'build', // 构建系统或外部依赖变更
|
|
20
|
+
'ci', // CI/CD 配置或脚本修改
|
|
21
|
+
],
|
|
22
|
+
],
|
|
23
|
+
// 允许范围为空
|
|
24
|
+
'scope-empty': [0, 'never'],
|
|
25
|
+
'scope-case': [2, 'always'],
|
|
26
|
+
// 提交消息的主题不能为空
|
|
27
|
+
'subject-empty': [2, 'never'],
|
|
28
|
+
// 不限制提交消息结尾的标点符号
|
|
29
|
+
'subject-full-stop': [0, 'never'],
|
|
30
|
+
// 限制提交消息的主题长度
|
|
31
|
+
'header-max-length': [2, 'always', 72],
|
|
32
|
+
// 'message-case': [2, 'always', 'lower-case'],
|
|
33
|
+
},
|
|
34
|
+
prompt: {
|
|
35
|
+
messages: {
|
|
36
|
+
skip: ':跳过',
|
|
37
|
+
max: '最多输入 %d 个字符',
|
|
38
|
+
min: '至少输入 %d 个字符',
|
|
39
|
+
emptyWarning: '请填写有效内容',
|
|
40
|
+
upperLimitWarning: '长度超过限制',
|
|
41
|
+
lowerLimitWarning: '长度不足',
|
|
42
|
+
},
|
|
43
|
+
questions: {
|
|
44
|
+
type: {
|
|
45
|
+
description: '选择提交类型(如:feat, fix, docs等)',
|
|
46
|
+
},
|
|
47
|
+
scope: {
|
|
48
|
+
description: '影响的模块范围(如:auth, api等,可选)',
|
|
49
|
+
},
|
|
50
|
+
subject: {
|
|
51
|
+
description: '简要描述本次提交(限72个字符以内)',
|
|
52
|
+
},
|
|
53
|
+
body: {
|
|
54
|
+
description: '详细描述本次提交(可选)',
|
|
55
|
+
},
|
|
56
|
+
breaking: {
|
|
57
|
+
description: '列出任何破坏性更新(可选)',
|
|
58
|
+
},
|
|
59
|
+
footer: {
|
|
60
|
+
description: '关联的issue,例如:#123, #456(可选)',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# 脚手架维护指南(负责人)
|
|
2
|
+
|
|
3
|
+
对标大厂实践:**薄 CLI、厚模板、特性开关、可验证、可版本化**。
|
|
4
|
+
|
|
5
|
+
## 架构
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
frontend-framework/ # 模板源仓库(本仓库)
|
|
9
|
+
├── create-swdg/ # npm 包 create-swdg-frontend
|
|
10
|
+
│ ├── bin/index.js # CLI 入口
|
|
11
|
+
│ ├── lib/ # 提示、特性剥离、manifest
|
|
12
|
+
│ ├── stubs/ # 无 GIS 时的配置替身
|
|
13
|
+
│ └── template/ # sync-template 同步产物
|
|
14
|
+
└── swdg/ # 全局 CLI 包装
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 发布到 npm
|
|
18
|
+
|
|
19
|
+
### 方式 A:打 tag 自动发布(推荐)
|
|
20
|
+
|
|
21
|
+
**一次性配置**
|
|
22
|
+
|
|
23
|
+
1. 登录 [npmjs.com](https://www.npmjs.com/),确认账号已验证邮箱
|
|
24
|
+
2. 确认包名 **`create-swdg-frontend`**、**`swdg`** 在你账号下(首次需未被占用)
|
|
25
|
+
3. npm → Access Tokens → **Generate New Token**
|
|
26
|
+
- 类型:**Granular**(Publish 权限)或 **Classic**(Automation)
|
|
27
|
+
4. GitHub 仓库 [Inupedia/swdg-frontend](https://github.com/Inupedia/swdg-frontend) → **Settings → Secrets and variables → Actions**
|
|
28
|
+
5. 新建 Secret:`NPM_TOKEN` = 上一步的 token
|
|
29
|
+
|
|
30
|
+
**每次发版**
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# 1. 本地确认测试通过
|
|
34
|
+
pnpm test:ci
|
|
35
|
+
|
|
36
|
+
# 2. 提交并推到 GitHub(如有未 push 的改动)
|
|
37
|
+
git push github main
|
|
38
|
+
|
|
39
|
+
# 3. 打 tag 并推送(版本号与 tag 一致,格式 vX.Y.Z)
|
|
40
|
+
git tag v0.2.0
|
|
41
|
+
git push github v0.2.0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
4. 打开 **Actions → Release to npm**,等待 workflow 完成
|
|
45
|
+
5. 验证:`npm view create-swdg-frontend version`、`npm view swdg version`
|
|
46
|
+
|
|
47
|
+
CI 会:从 tag 解析版本 → `test:ci` → 发布 `create-swdg-frontend` → 发布 `swdg`。
|
|
48
|
+
|
|
49
|
+
### 方式 B:本地手动发布
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm test:ci
|
|
53
|
+
pnpm release 0.2.0
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
详见 [TESTING.md](./TESTING.md)。
|
|
57
|
+
|
|
58
|
+
## 特性(Feature Flags)
|
|
59
|
+
|
|
60
|
+
| 特性 | 默认 | CLI |
|
|
61
|
+
| ----- | ---- | ------------------ |
|
|
62
|
+
| `gis` | 关闭 | `--gis` / 交互选 Y |
|
|
63
|
+
|
|
64
|
+
未启用 GIS 时会删除:cesium 依赖、vite 静态资源配置、`src/views/examples/cesium`、相关工具与组件。
|
|
65
|
+
|
|
66
|
+
生成项目会写入 `.swdg/manifest.json` 记录创建时选项。
|
|
67
|
+
|
|
68
|
+
## 模板质量门禁
|
|
69
|
+
|
|
70
|
+
- `examples/` 路由:**生产构建自动排除**(见 `src/router/index.ts`)
|
|
71
|
+
- 创建后可选 **typecheck 校验**(`--verify`)
|
|
72
|
+
- 建议每月 sync 一次并打 tag
|
|
73
|
+
|
|
74
|
+
## 勿再做的事
|
|
75
|
+
|
|
76
|
+
- 不要把 Cesium 放进 `public/`(已改为 npm + vite 插件)
|
|
77
|
+
- 不要在业务 `src/views/` 根下堆演示页,统一放 `examples/`
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# 项目使用指南
|
|
2
|
+
|
|
3
|
+
本文说明 **如何在本仓库或脚手架生成的项目中日常开发**。维护模板、发布 npm 见 [MAINTAINER.md](./MAINTAINER.md)。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 一、两种使用方式
|
|
8
|
+
|
|
9
|
+
| 方式 | 适合谁 | 第一步 |
|
|
10
|
+
| ------------------ | -------------------------------- | ------------------------------------------------------------ |
|
|
11
|
+
| **直接使用本仓库** | 团队统一模板、在 monorepo 上迭代 | `git clone` → `pnpm install` |
|
|
12
|
+
| **脚手架新建项目** | 每个业务一条独立仓库 | `pnpm create swdg my-app`(见根目录 [README](../README.md)) |
|
|
13
|
+
|
|
14
|
+
两种方式的项目结构、命令、路由约定 **一致**;脚手架可通过 `--gis` / `--no-gis` 裁剪 Cesium 相关文件。
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 二、环境要求与首次启动
|
|
19
|
+
|
|
20
|
+
**要求**
|
|
21
|
+
|
|
22
|
+
- Node.js **22+**
|
|
23
|
+
- **pnpm** 9+(推荐;也可用 npm / yarn)
|
|
24
|
+
|
|
25
|
+
**首次启动**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm install
|
|
29
|
+
cp .env.example .env # 必做:复制环境变量
|
|
30
|
+
pnpm dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
浏览器会自动打开(默认 `http://localhost:3000`)。路由为 **Hash 模式**,首页地址形如 `http://localhost:3000/#/`。
|
|
34
|
+
|
|
35
|
+
**页面内指南**:开发模式下首页自带 **PPT 式翻页**(共 10 页),也可访问 `/#/examples/guide` 全屏阅读。支持方向键、`←` / `→` 按钮与底部圆点跳转。
|
|
36
|
+
|
|
37
|
+
> 修改 `.env` 后需要 **重启** `pnpm dev`,Vite 才会加载新变量。
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 三、环境变量说明
|
|
42
|
+
|
|
43
|
+
在根目录 `.env` 中配置(参考 `.env.example`):
|
|
44
|
+
|
|
45
|
+
| 变量 | 是否必填 | 说明 |
|
|
46
|
+
| ------------------------------ | ------------------- | ------------------------------------------------ |
|
|
47
|
+
| `VITE_DEMO_PROXY_TARGET` | 调 `/demo` 接口时 | 开发代理目标,如 `http://127.0.0.1:8888` |
|
|
48
|
+
| `VITE_FEATURE_GIS` | GIS 项目建议 `true` | 为 `true` 时首页显示 Cesium 入口;`false` 则关闭 |
|
|
49
|
+
| `VITE_CESIUM_ION_ACCESS_TOKEN` | 否 | 使用 Cesium Ion 资产时填写;默认 OSM 底图可不填 |
|
|
50
|
+
|
|
51
|
+
**GIS 看不到地图入口?**
|
|
52
|
+
|
|
53
|
+
1. 确认 `.env` 中有 `VITE_FEATURE_GIS=true`
|
|
54
|
+
2. 重启 `pnpm dev`
|
|
55
|
+
3. 开发环境未配置时也会默认尝试开启 GIS(见 `useFeatureGis`),生产构建仍以 env 为准
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 四、本地开发能做什么
|
|
60
|
+
|
|
61
|
+
启动 `pnpm dev` 后:
|
|
62
|
+
|
|
63
|
+
| 入口 | 路径(Hash) | 说明 |
|
|
64
|
+
| ------------------ | -------------------- | ---------------------------- |
|
|
65
|
+
| 首页 | `/#/` | 应用壳;开发模式下有示例卡片 |
|
|
66
|
+
| Store / Alert 示例 | `/#/examples/test` | Pinia、全局 Alert |
|
|
67
|
+
| Cesium 示例 | `/#/examples/cesium` | 三维地图(需 GIS 开启) |
|
|
68
|
+
|
|
69
|
+
`src/views/examples/` 下的页面 **不会打进生产包**(见 `src/router/index.ts`),可放心放演示代码。
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 五、目录与路径别名
|
|
74
|
+
|
|
75
|
+
### 主要目录
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
src/
|
|
79
|
+
├── views/ # 页面(约定式路由,见下一节)
|
|
80
|
+
├── components/ # 公共组件
|
|
81
|
+
├── layout/ # 布局组件
|
|
82
|
+
├── api/ # 接口请求
|
|
83
|
+
├── stores/ # Pinia
|
|
84
|
+
├── utils/ # 工具、composables、cesium 封装
|
|
85
|
+
├── styles/ # 全局样式(global.css、shell.css)
|
|
86
|
+
├── router/ # 路由入口(一般不用改)
|
|
87
|
+
interface/ # 业务 TS 类型
|
|
88
|
+
types/ # 全局类型、env.d.ts
|
|
89
|
+
docs/ # 文档
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 路径别名(import 时用)
|
|
93
|
+
|
|
94
|
+
| 别名 | 指向 |
|
|
95
|
+
| --------------- | ------------------------ |
|
|
96
|
+
| `@/` | `src/` |
|
|
97
|
+
| `@components/` | `src/components/` |
|
|
98
|
+
| `@views/` | `src/views/` |
|
|
99
|
+
| `@api/` | `src/api/` |
|
|
100
|
+
| `@stores/` | `src/stores/` |
|
|
101
|
+
| `@utils/` | `src/utils/` |
|
|
102
|
+
| `@composables/` | `src/utils/composables/` |
|
|
103
|
+
| `@interface/` | `interface/` |
|
|
104
|
+
| `@layout/` | `src/layout/` |
|
|
105
|
+
|
|
106
|
+
示例:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { useCounterStore } from '@stores/useCounter';
|
|
110
|
+
import { useFeatureGis } from '@composables/useFeatureGis';
|
|
111
|
+
import MyCard from '@components/MyCard/index.vue';
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 六、约定式路由(重要)
|
|
117
|
+
|
|
118
|
+
无需手写 `routes` 数组:`src/views` 下每个 `*.vue` 会自动注册。
|
|
119
|
+
|
|
120
|
+
**规则简述**
|
|
121
|
+
|
|
122
|
+
- 文件路径 → URL 路径(去掉 `views`、去掉 `/index`)
|
|
123
|
+
- 目录名会转为 **kebab-case**
|
|
124
|
+
|
|
125
|
+
| 文件 | 访问路径 |
|
|
126
|
+
| --------------------------------------- | ----------------------- |
|
|
127
|
+
| `src/views/index.vue` | `/#/` |
|
|
128
|
+
| `src/views/UserList/index.vue` | `/#/user-list` |
|
|
129
|
+
| `src/views/system/RoleManage/index.vue` | `/#/system/role-manage` |
|
|
130
|
+
| `src/views/examples/test/index.vue` | `/#/examples/test` |
|
|
131
|
+
|
|
132
|
+
**新增业务页步骤**
|
|
133
|
+
|
|
134
|
+
1. 创建 `src/views/YourFeature/index.vue`
|
|
135
|
+
2. 保存后刷新浏览器,直接访问 `/#/your-feature`
|
|
136
|
+
3. 在页面内用 `useRouter()` / `<router-link to="...">` 跳转
|
|
137
|
+
|
|
138
|
+
```vue
|
|
139
|
+
<!-- src/views/Dashboard/index.vue -->
|
|
140
|
+
<template>
|
|
141
|
+
<div>业务大屏</div>
|
|
142
|
+
</template>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 七、接口与代理
|
|
148
|
+
|
|
149
|
+
- 接口代码放在 `src/api/`
|
|
150
|
+
- 开发环境已配置代理:请求 **`/demo`** 会转发到 `VITE_DEMO_PROXY_TARGET`
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
// 示例:axios 请求会走 vite proxy
|
|
154
|
+
// GET http://localhost:3000/demo/xxx → VITE_DEMO_PROXY_TARGET/demo/xxx
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
从 OpenAPI 生成客户端:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pnpm gen:api
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
(具体配置见 `scripts/gen-api.cjs`)
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 八、状态与全局能力
|
|
168
|
+
|
|
169
|
+
- **Pinia**:`src/stores/`,已接入持久化插件
|
|
170
|
+
- **全局 Alert**:`useAlert()`(`@composables/useAlert`)
|
|
171
|
+
- **全局组件**:在 `src/utils/components` 注册
|
|
172
|
+
- **指令**:如 `v-focus`(`src/directive/`)
|
|
173
|
+
|
|
174
|
+
示例页 `/#/examples/test` 演示了 Store + Alert 的用法。
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 九、GIS / Cesium(可选)
|
|
179
|
+
|
|
180
|
+
启用条件:`package.json` 含 `cesium`,且 `.env` 中 `VITE_FEATURE_GIS=true`(或使用脚手架 `--gis` 创建)。
|
|
181
|
+
|
|
182
|
+
**在业务页中嵌入地图**
|
|
183
|
+
|
|
184
|
+
```vue
|
|
185
|
+
<template>
|
|
186
|
+
<CesiumViewer class="map-host" />
|
|
187
|
+
</template>
|
|
188
|
+
|
|
189
|
+
<script setup lang="ts">
|
|
190
|
+
import CesiumViewer from '@components/CesiumViewer/index.vue';
|
|
191
|
+
</script>
|
|
192
|
+
|
|
193
|
+
<style scoped>
|
|
194
|
+
.map-host {
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 480px;
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**或自行创建 Viewer**
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
import { createViewer, destroyViewer } from '@utils/cesium';
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
- 默认 **OpenStreetMap** 底图,一般不需要 Ion Token
|
|
208
|
+
- 开发时 Workers/Assets 由 `scripts/vite-plugin-cesium-dev.ts` 提供
|
|
209
|
+
- 生产构建会复制 `dist/cesium/`,`base: './'` 适合静态部署
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 十、常用命令
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
pnpm dev # 开发(端口 3000,自动打开浏览器)
|
|
217
|
+
pnpm build # 生产构建 → dist/
|
|
218
|
+
pnpm preview # 本地预览构建结果
|
|
219
|
+
pnpm typecheck # TypeScript 检查
|
|
220
|
+
pnpm lint:all # ESLint + Stylelint + Prettier 检查
|
|
221
|
+
pnpm lint:fix # 自动修复 ESLint
|
|
222
|
+
pnpm test:run # 单元测试(Vitest)
|
|
223
|
+
pnpm verify # typecheck + lint(提交前建议)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 十一、构建与部署
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
pnpm build
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
产物在 `dist/`:
|
|
235
|
+
|
|
236
|
+
- `index.html`、JS/CSS 在 `assets/`
|
|
237
|
+
- 若启用 GIS,另有 `cesium/` 静态资源目录
|
|
238
|
+
|
|
239
|
+
部署到任意静态服务器(Nginx、OSS、GitHub Pages 等)即可;注意站点需能访问 **相对路径** 资源(已设置 `base: './'`)。
|
|
240
|
+
|
|
241
|
+
预览构建:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
pnpm preview
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 十二、推荐日常流程
|
|
250
|
+
|
|
251
|
+
1. `cp .env.example .env`,按需改代理与 GIS
|
|
252
|
+
2. `pnpm dev`,从首页示例熟悉 Store / 地图
|
|
253
|
+
3. 在 `src/views/` 下新增业务目录
|
|
254
|
+
4. 在 `src/api/`、`src/stores/` 补充接口与状态
|
|
255
|
+
5. 提交前执行 `pnpm verify`
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 十三、脚手架创建新项目(摘要)
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
pnpm create swdg my-app
|
|
263
|
+
cd my-app
|
|
264
|
+
pnpm dev
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
- 交互默认 **不启用 GIS**;三维项目请选 Y 或加 `--gis`
|
|
268
|
+
- 生成目录含 `docs/ONBOARDING.md`(与本文同步)和 `.swdg/manifest.json`(记录创建选项)
|
|
269
|
+
|
|
270
|
+
更多参数:`create-swdg` 包内 `pnpm create swdg --help` 或根 [README](../README.md)。
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 十四、遇到问题
|
|
275
|
+
|
|
276
|
+
| 现象 | 处理 |
|
|
277
|
+
| ---------------------- | ------------------------------------------------------------------ |
|
|
278
|
+
| 首页没有 Cesium 卡片 | `.env` 加 `VITE_FEATURE_GIS=true` 并重启 dev |
|
|
279
|
+
| 地图白屏 / Worker 报错 | 确认已 `pnpm install`,重启 dev;看控制台是否 404 `cesium/Workers` |
|
|
280
|
+
| 改 env 不生效 | 必须重启 `pnpm dev` |
|
|
281
|
+
| 新页面 404 | 确认文件在 `src/views/` 下且路径符合约定;Hash 地址带 `#` |
|
|
282
|
+
| TS 路径报错 | 使用 `@/` 等别名,与 `tsconfig.json` 的 `paths` 一致 |
|
|
283
|
+
|
|
284
|
+
仍无法解决时,把浏览器控制台与终端完整报错发给维护人。
|