Skip to content

Commit

Permalink
build: release new version dependencies (kubesphere#4082) (kubesphere…
Browse files Browse the repository at this point in the history
…#4253)

* build: remove useless dependencies



* chore: remove unused @ks-console/shared-docs import



* style: format



* build: add publish-packages.local



* build: clean up dependencies



* chore: update import path in shared



* build: update  peerDependencies in core



* chore: update



* build: add minify for @ks-console/shared



* chore: remove extensions/



* Revert "chore: remove extensions/"

This reverts commit 148a6819216d14c37e1a16ba81b77a75bf6b35a2.

* fix: resolve error



* build: remove @ks-console/shared in extensions



* build: remove libs from extension externals



* build: remove @kubed/diff-viewer and @kubed/log-viewer in extension extenals



* chore: add minify progress



---------

Signed-off-by: donniean <[email protected]>
  • Loading branch information
donniean authored Jul 15, 2024
1 parent 50301bf commit dbea6d5
Show file tree
Hide file tree
Showing 28 changed files with 265 additions and 92 deletions.
21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
"url": "git@[email protected]:kubesphere/console.git"
},
"license": "AGPL-3.0",
"workspaces": ["packages/*", "extensions/*", "server", "locales"],
"workspaces": [
"packages/*",
"extensions/*",
"server",
"locales"
],
"scripts": {
"build": "yarn build:dll && yarn build:locales && yarn build:prod && yarn build:server",
"build:dll": "ksc build:dll -s true",
Expand All @@ -16,17 +21,20 @@
"build:packages": "esno scripts/build-packages.js",
"build:prod": "cross-env dll=true ksc build:prod -s true",
"build:server": "NODE_ENV=production webpack --config scripts/webpack.server.js --stats errors-only",
"clean": "rimraf packages/*/{esm,cjs,lib,dist} packages/**/*.tsbuildinfo locales/dist",
"clean": "rimraf packages/*/{esm,cjs,lib,dist} packages/**/*.tsbuildinfo locales/dist dist",
"create:ext": "ksc create:ext",
"dev": "concurrently -k --raw 'yarn dev:client' 'yarn dev:server'",
"dev:client": "NODE_ENV=development ksc dev -s true",
"dev:server": "NODE_ENV=development ksc-server",
"publish:packages:local": "yarn clean && yarn build:locales && yarn build:server && yarn build:packages && esno scripts/publish-packages.local.ts",
"serve": "NODE_ENV=production node server/server.js"
},
"browserslist": ["> 1%", "last 2 versions", "not ie <= 8"],
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@kubed/charts": "^0.0.22",
"@kubed/code-editor": "^0.0.27",
"@kubed/components": "^0.2.8",
Expand Down Expand Up @@ -124,7 +132,6 @@
"execa": "^6.1.0",
"fast-glob": "^3.2.11",
"file-loader": "^6.0.0",
"for-editor": "^0.3.5",
"fork-ts-checker-webpack-plugin": "^6.3.5",
"friendly-errors-webpack-plugin": "^1.7.0",
"fs-extra": "^10.0.0",
Expand All @@ -148,7 +155,7 @@
"shelljs": "^0.8.4",
"style-loader": "^1.1.3",
"systemjs-webpack-interop": "^2.3.7",
"terser": "^5.9.0",
"terser": "^5.31.1",
"terser-webpack-plugin": "^5.2.4",
"ts-loader": "^9.2.6",
"typescript": "4.5.5",
Expand Down
1 change: 0 additions & 1 deletion packages/appstore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"nanoid": "^3.0.0"
},
"peerDependencies": {
"@ks-console/console": "^4.1.0",
"@ks-console/shared": "^4.1.0",
"@kubed/code-editor": "^0.0.27",
"@kubed/components": "^0.2.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/cli/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const alias = {
'@ks-console/core': resolve('packages/core/src'),
'@ks-console/console': resolve('packages/console/src'),
'@ks-console/appstore': resolve('packages/appstore/src'),
'@ks-console/shared-docs': resolve('packages/shared-docs/src'),
// '@ks-console/shared-docs': resolve('packages/shared-docs/src'),
};

async function devServer(setAlias, checkUpgrade) {
Expand Down
6 changes: 3 additions & 3 deletions packages/bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
},
"browserslist": ["> 1%", "last 2 versions", "not ie <= 8"],
"dependencies": {
"@ks-console/appstore": "^4.1.0",
"@ks-console/console": "^4.1.0",
"@ks-console/core": "^4.1.0",
"@ks-console/locales": "^4.1.0",
"mustache": "^4.2.0",
"npm-checky": "^1.0.4"
},
"devDependencies": {
"path-browserify": "^1.0.1"
},
"engines": {
"node": ">= 16.0.0"
},
Expand Down
22 changes: 12 additions & 10 deletions packages/bootstrap/webpack/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ const config = {
};

const systemImports = {
// '@ks-console/shared': 'core:@kubed/@ks-console/shared',
'@kubed/charts': 'core:@kubed/charts',
'@kubed/code-editor': 'core:@kubed/code-editor',
'@kubed/components': 'core:@kubed/components',
// '@kubed/diff-viewer': 'core:@kubed/diff-viewer',
'@kubed/hooks': 'core:@kubed/hooks',
'@kubed/icons': 'core:@kubed/icons',
// '@kubed/log-viewer': 'core:@kubed/log-viewer',
// dayjs: 'core:dayjs',
// lodash: 'core:lodash',
react: 'core:react',
'react-dom': 'core:react-dom',
// 'react-markdown': 'core:react-markdown',
'react-query': 'core:react-query',
'react-router-dom': 'core:react-router-dom',
'styled-components': 'core:styled-components',
lodash: 'core:lodash',
'react-query': 'core:react-query',
'react-markdown': 'core:react-markdown',
'@kubed/components': 'core:@kubed/components',
'@kubed/hooks': 'core:@kubed/hooks',
'@kubed/icons': 'core:@kubed/icons',
'@kubed/code-editor': 'core:@kubed/code-editor',
'@kubed/charts': 'core:@kubed/charts',
'@ks-console/shared': 'core:@kubed/@ks-console/shared',
'wujie-react': 'core:wujie-react',
dayjs: 'core:dayjs',
};

const locales = ['ar', 'en', 'es', 'fr', 'hi', 'ko', 'lt', 'pl', 'tc', 'tr', 'zh'];
Expand Down
1 change: 1 addition & 0 deletions packages/bootstrap/webpack/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const webpackBaseConfig = merge(configs, {
alias: {
'styled-components': resolve('node_modules/styled-components'),
},
fallback: { path: require.resolve('path-browserify') },
},
module: {
rules: [
Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/webpack/webpack.dll.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const config = {
entry: {
common: [
'react',
'react-is',
// 'react-is',
'react-dom',
'react-router-dom',
'react-query',
Expand Down
22 changes: 12 additions & 10 deletions packages/bootstrap/webpack/webpack.extension.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,22 @@ module.exports = merge(
},
],
externals: [
'react',
'react-is',
'react-dom',
'react-router-dom',
'react-query',
'lodash',
// '@ks-console/shared',
'@kubed/charts',
'@kubed/code-editor',
'@kubed/components',
// '@kubed/diff-viewer',
'@kubed/hooks',
'@kubed/icons',
'@kubed/code-editor',
'@kubed/charts',
'@ks-console/shared',
// '@kubed/log-viewer',
// 'lodash',
'react',
'react-dom',
// 'react-is',
// 'react-markdown',
'react-query',
'react-router-dom',
'styled-components',
'react-markdown',
'wujie-react',
],
},
Expand Down
12 changes: 9 additions & 3 deletions packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
"main": "cjs/index.js",
"module": "esm/index.js",
"types": "lib/src/index.d.ts",
"files": ["cjs", "esm", "lib"],
"files": [
"cjs",
"esm",
"lib"
],
"dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"async-validator": "4.2.5",
"file-saver": "^2.0.5",
"for-editor": "^0.3.5",
Expand All @@ -16,8 +23,7 @@
"react-markdown": "^7.1.1",
"react-table": "^7.7.0",
"react-textarea-autosize": "^8.3.2",
"wujie-react": "^1.0.6",
"zod": "^3.22.4"
"wujie-react": "^1.0.6"
},
"devDependencies": {
"@types/react-input-autosize": "^2.2.1"
Expand Down
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"lodash": "^4.17.20",
"minimatch": "^9.0.3",
"react-draggable": "^4.4.5",
"react-markdown": "^7.1.1",
"react-syntax-highlighter": "^15.5.0",
"react-use": "^17.4.2",
"remark-gfm": "^3.0.1",
Expand All @@ -24,9 +23,12 @@
"wujie-react": "^1.0.6"
},
"devDependencies": {
"@types/netmask": "^2.0.5",
"@types/react-syntax-highlighter": "^15.5.11"
},
"peerDependencies": {
"@ks-console/appstore": "^4.1.0",
"@ks-console/console": "^4.1.0",
"@ks-console/shared": "^4.1.0",
"@kubed/charts": "^0.0.22",
"@kubed/code-editor": "^0.0.27",
Expand Down
11 changes: 5 additions & 6 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "@ks-console/shared",
"version": "4.1.0",
"description": "",
"main": "cjs/index.js",
"module": "esm/index.js",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"files": ["cjs", "esm", "lib"],
"files": [
"lib"
],
"dependencies": {
"@kubed/stook": "^0.0.4",
"async-validator": "4.2.5",
Expand All @@ -15,7 +16,6 @@
"js-base64": "^3.7.2",
"js-yaml": "^3.13.1",
"nanoid": "^3.0.0",
"netmask": "^2.0.1",
"path-to-regexp": "^2.2.1",
"react-infinite-scroll-hook": "^4.1.1",
"react-markdown": "^7.1.1",
Expand All @@ -31,8 +31,7 @@
"devDependencies": {
"@types/file-saver": "^2.0.5",
"@types/js-yaml": "^4.0.5",
"@types/nanoid": "^2.1.0",
"@types/netmask": "^1.0.30"
"@types/nanoid": "^2.1.0"
},
"peerDependencies": {
"@kubed/charts": "^0.0.22",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/Apps/AppPreview/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useMemo, useEffect } from 'react';
import { Loading } from '@kubed/components';

import { Markdown } from '@ks-console/shared';
import { Markdown } from '../../Markdown';
import TextPreview from '../../TextPreview';
import { openpitrixStore } from '../../../stores';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useDisclosure } from '@kubed/hooks';
import { AppLogModal } from '../../../Modals/AppLogModal';
import { TooltipIcon } from './TooltipIcon';
import { typeProps } from './PopoverContent';
import { StatusIndicatorProps } from '@ks-console/shared';
import type { StatusIndicatorProps } from '../../../StatusIndicator';
import { getStatusDotColor } from '../../../StatusIndicator/utils';

export interface LogButtonProps extends Pick<StatusIndicatorProps, 'type'> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { StatusIndicatorProps } from '@ks-console/shared';
import type { StatusIndicatorProps } from '../../../../StatusIndicator';
import { getAppStatusStateInfo, typeProps } from './status';
import {
Wrapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { Project, Enterprise } from '@kubed/icons';
import { NavMenu } from '../../Layouts/NavMenu';
import NavTitle from '../../Layouts/NavTitle';

import { ListPageSide, FavoriteHistory } from '@ks-console/shared';
import { FavoriteHistory } from '../../FavoriteHistory';
import ListPageSide from '../../Layouts/ListPageSide';
import { getActions } from '../../../utils';
import type { FormattedNamespace } from '../../../types';
import { useGlobalStore, workspaceStore, permissionStore, projectNewStore } from '../../../stores';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { FavoriteHistory, ListPageSide } from '@ks-console/shared';
import { useModal } from '@kubed/components';
import { Enterprise } from '@kubed/icons';
import React, { useEffect, useMemo } from 'react';
import { Outlet, useLocation, useNavigate, useParams } from 'react-router-dom';
import styled from 'styled-components';

import ListPageSide from '../../Layouts/ListPageSide';
import { FavoriteHistory } from '../../FavoriteHistory';
import { permissionStore, useGlobalStore, workspaceStore } from '../../../stores';
import { NavMenu, NavMenuItem } from '../../Layouts/NavMenu';
import NavTitle from '../../Layouts/NavTitle';
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/components/WorkspaceLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Loading } from '@kubed/components';
import { Outlet, useParams } from 'react-router-dom';
import { useWorkspaceSelectedClusterStore, workspaceStore } from '../../stores';
import { fetchRules } from '../../utils/apis';
import { useClusterStore } from '@ks-console/shared';
import { useClusterStore } from '../../stores/useClustersStore';

const { fetchDetail, useFetchWorkspaceClustersQuery } = workspaceStore;

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/stores/useClustersStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { create } from 'zustand';
import { FormattedCluster } from '@ks-console/shared';
import type { FormattedCluster } from '../types/cluster';

type UseClusterStore = {
clusters: FormattedCluster[];
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/utils/licenses.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FormattedLicense } from '@ks-console/shared';
import { getGlobalLicenseInfo } from '@ks-console/shared';
import type { FormattedLicense } from '../types/license';
import { getGlobalLicenseInfo } from './globals';

function getLicenseErrorInfo({
formattedLicense,
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/utils/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
hasExtensionModuleAnnotation,
hasExtensionModuleAnnotationCluster,
} from './checker';
import { getLicenseErrorInfoFromLicenses } from '@ks-console/shared';
import { getLicenseErrorInfoFromLicenses } from '../utils/licenses';

export const hasClusterModule = (cluster: string, module: string) => {
return get(
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/utils/workloads.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { get, set, merge, isEmpty } from 'lodash';
import { OriginalWorkload, OriginalJob } from '../types';
import { getApiVersion } from '@ks-console/shared';
import { getApiVersion } from './getApiVersion';

export const getWorkloadUpdateTime = (record: OriginalWorkload) => {
const annotations = get(record, 'metadata.annotations', {});
Expand Down
Loading

0 comments on commit dbea6d5

Please sign in to comment.