Skip to content

Commit

Permalink
Merge pull request #1367 from qdraw/feature/202402_knip_rm_code
Browse files Browse the repository at this point in the history
Knip Clean usused code && update packages
  • Loading branch information
qdraw authored Feb 6, 2024
2 parents 41e1f71 + 20cf32f commit 674317a
Show file tree
Hide file tree
Showing 65 changed files with 1,963 additions and 1,006 deletions.
30 changes: 15 additions & 15 deletions starsky-tools/build-tools/clientapp-vite-update.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/node

const { spawnSync } = require("child_process");
const {spawnSync} = require("child_process");
const fs = require("fs");
const path = require("path");
const { exit } = require("process");
const {exit} = require("process");

const clientAppFolderPath = path.join(
__dirname,
Expand Down Expand Up @@ -74,7 +74,7 @@ function getNpxCreateCreateApp() {

const updateSpawn = spawnSync(
"npm",
["create", "-y", "vite@latest" , myAppName, ,"--", "--template", "react-ts"],
["create", "-y", "vite@latest", myAppName, , "--", "--template", "react-ts"],
{
cwd: createReactTempFolder,
env: process.env,
Expand Down Expand Up @@ -154,7 +154,7 @@ fs.writeFileSync(
function npmCi() {
console.log(
"run > npm ci --no-audit --legacy-peer-deps | in: " +
clientAppFolderPath
clientAppFolderPath
);
const npmCiOne = spawnSync(
"npm",
Expand Down Expand Up @@ -222,14 +222,14 @@ function npmInstall(packageName, force, dev) {
}
console.log(
"npm" +
" " +
"install --no-audit" +
" " +
packageName +
" " +
saveText +
" " +
forceText
" " +
"install --no-audit" +
" " +
packageName +
" " +
saveText +
" " +
forceText
);
const npmInstallSpawn = spawnSync(
"npm",
Expand Down Expand Up @@ -277,14 +277,14 @@ npmInstall('storybook', false, true);
npmInstall('@storybook/addon-essentials', false, true);
npmInstall('@storybook/addon-interactions', false, true);
npmInstall('@storybook/addon-links', false, true);
npmInstall('@storybook/blocks', false, true);
// @storybook/blocks is skipped
npmInstall('@storybook/builder-vite', false, true);
npmInstall('@storybook/react', false, true);
npmInstall('@storybook/react-vite', false, true);
npmInstall('@storybook/testing-library', false, true);
// @storybook/testing-library is skipped
npmInstall('@testing-library/jest-dom', false, true);
npmInstall('@testing-library/react', false, true);
npmInstall('@testing-library/user-event', false, true);
// @testing-library/user-event is skipped

console.log("npm install result:");
const npmInstallSpawnResult = spawnSync(
Expand Down
1 change: 1 addition & 0 deletions starsky/starsky/clientapp/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "@storybook/builder-vite";
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
Expand Down
2 changes: 1 addition & 1 deletion starsky/starsky/clientapp/.storybook/middleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const setRouter = require("../../../../starsky-tools/mock/set-router").setRouter;
var bodyParser = require("body-parser");
const bodyParser = require("body-parser");

const expressMiddleWare = (router) => {
router.use(bodyParser.urlencoded({ extended: true }));
Expand Down
6 changes: 0 additions & 6 deletions starsky/starsky/clientapp/clientapp.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
],
"typescript.preferences.quoteStyle": "double",
"typescript.updateImportsOnFileMove.enabled": "always",
"cSpell.words": [
"Exif",
"Starsky",
"colorclass",
"unmount"
],
"typescript.tsdk": "clientapp/node_modules/typescript/lib",
"editor.formatOnSave": true,
}
Expand Down
2 changes: 2 additions & 0 deletions starsky/starsky/clientapp/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import "@testing-library/jest-dom";
import { configure } from "@testing-library/react";
import "isomorphic-fetch";
import "jest-environment-jsdom";
import "ts-node";

// Mock IntersectionObserver
class IntersectionObserver {
Expand Down
Loading

1 comment on commit 674317a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.