Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina committed Jan 9, 2023
1 parent fe5a9ba commit b00186a
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 345 deletions.
5 changes: 0 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

# nmHoistingLimits: workspaces

nodeLinker: node-modules
nmSelfReferences: false
nmMode: classic

# lanuage
defaultLanguageName: "node"

# changeset
changesetBaseRefs:
- "master"
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ RUN : \
&& yarn workspaces focus @flyteconsole/client-app --production \
# move the production dependencies to the /app folder
&& mkdir /app \
&& rm -rf node_modules/@flyteorg \
&& cp -R node_modules /app

WORKDIR /my-project/
RUN : \
--mount=type=cache,target=/root/.yarn \
# install all dependencies so we can build
&& yarn workspaces focus @flyteconsole/client-app flyteconsole --production \
&& yarn workspaces focus --all --production \
&& yarn build:pack \
&& BASE_URL=/console yarn run build:prod \
&& cp -R ./website/dist/* /app

Expand Down
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@ lint: #lints the package for common code smells
.PHONY: build_prod
build_prod:
yarn run clean
make pack
BASE_URL=/console yarn run build:prod

.PHONY: pack
pack:
yarn workspaces focus --production --all

yarn workspace @flyteorg/flyteidl build
yarn workspace @flyteorg/common build
yarn workspace @flyteorg/locale build
yarn workspace @flyteorg/ui-atoms build
yarn workspace @flyteorg/flyte-api build
yarn workspace @flyteorg/components build
yarn workspace @flyteorg/console build
yarn run build:pack

# test_unit runs all unit tests
.PHONY: test_unit
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flyteconsole",
"version": "1.3.5",
"version": "2.0.0",
"private": true,
"description": "The web UI for the Flyte platform",
"repository": {
Expand All @@ -16,13 +16,13 @@
},
"scripts": {
"postinstall": "husky install",
"build:pack": "yarn workspaces foreach -vit --include '{@flyteorg/flyteidl,@flyteorg/flyte-api,@flyteorg/ui-atoms,@flyteorg/common,@flyteorg/locale,@flyteorg/flyte-api,@flyteorg/components,@flyteorg/console}' run build",
"clean": "git clean -fxd .yarn node_modules packages website",
"build:pack": "yarn workspaces foreach -vit --include '{@flyteorg/flyteidl-types,@flyteorg/flyte-api,@flyteorg/ui-atoms,@flyteorg/common,@flyteorg/locale,@flyteorg/flyte-api,@flyteorg/components,@flyteorg/console}' run build",
"clean": "git clean -fxd --exclude script",
"gen:ssl": "make generate_ssl",
"start": "yarn workspace @flyteconsole/client-app start",
"build": "yarn workspace @flyteconsole/client-app build",
"start:prod": "yarn workspace @flyteconsole/client-app start:prod",
"build:prod": "yarn workspace @flyteconsole/client-app build:prod",
"start:prod": "yarn build:prod && yarn workspace @flyteconsole/client-app start:prod",
"build:storybook": "build-storybook",
"generate:package": "yarn workspace @flyteconsole/generator start",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
Expand Down Expand Up @@ -68,9 +68,9 @@
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.3.0",
"express": "^4.14.0",
"express-static-gzip": "^0.3.2",
"fork-ts-checker-webpack-plugin": "^7.2.1",
"express": "^4.18.1",
"express-static-gzip": "^2.1.7",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.2",
"lint-staged": "^13.1.0",
Expand All @@ -85,12 +85,12 @@
"tslib": "^2.4.1",
"typescript": "^4.9.4",
"wait-on": "^6.0.1",
"webpack": "^5.68.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.7.4",
"webpack-merge": "^5.8.0",
"webpack-node-externals": "^3.0.0",
"webpack-stats-plugin": "^1.0.3"
"webpack-stats-plugin": "^1.1.1"
},
"devDependencies": {
"@babel/core": "~7.16.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"composite": true,

"paths": {
"@flyteorg/*": ["../packages/(locale|ui-atoms)/src"]
"@flyteorg/*": ["../packages/*/src"]
}
},

Expand Down
19 changes: 9 additions & 10 deletions packages/console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyteorg/console",
"version": "0.0.3",
"version": "0.0.6",
"description": "Flyteconsole main app module",
"main": "./dist/index.js",
"module": "./lib/index.js",
Expand Down Expand Up @@ -33,9 +33,8 @@
"clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true",
"build:watch": "run -T tsc-watch --noClear -p ./tsconfig.es.build.json --onSuccess \"yarn build\"",
"build": "yarn clean && yarn build:esm && yarn build:cjs",
"build:esm": "run -T tsc --module esnext --outDir ./lib --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json",
"build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json",
"build:cp": "run -T wait-on ./lib && cp -R ./src/assets ./lib && run -T wait-on ./dist && cp -R ./src/assets ./dist",
"build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --outDir ./lib --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json",
"build:cjs": "mkdir dist && cp -R src/assets ./dist && run -T wait-on ./dist/assets && run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json",
"test": "NODE_ENV=test jest"
},
"installConfig": {
Expand All @@ -53,12 +52,12 @@
"dependencies": {
"@date-io/moment": "1.3.9",
"@emotion/core": "10.1.1",
"@flyteorg/common": "^0.0.2",
"@flyteorg/components": "^0.0.2",
"@flyteorg/flyte-api": "^0.0.1",
"@flyteorg/flyteidl-types": "^0.0.2",
"@flyteorg/locale": "^0.0.1",
"@flyteorg/ui-atoms": "^0.0.2",
"@flyteorg/common": "^0.0.3",
"@flyteorg/components": "^0.0.3",
"@flyteorg/flyte-api": "^0.0.2",
"@flyteorg/flyteidl-types": "^0.0.3",
"@flyteorg/locale": "^0.0.2",
"@flyteorg/ui-atoms": "^0.0.3",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@material-ui/pickers": "^3.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ export const ReactFlowCustomTaskNode = ({ data }: RFNode) => {
};

const handleNodeClick = _e => {
if (nodeExecutionStatus === NodeExecutionPhase.SKIPPED) {
return;
}
setSelectedNode(true);
setSelectedPhase(undefined);
};
Expand Down
4 changes: 1 addition & 3 deletions packages/console/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"noImplicitOverride": false,

"paths": {
"@flyteorg/*": [
"../packages/(ui-atoms|locale|flyteidl-types|flyte-api|common|components)/src"
]
"@flyteorg/*": ["../packages/*/src"]
}
},

Expand Down
13 changes: 7 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"module": "commonjs",
"moduleResolution": "node",

// "esModuleInterop": true
"esModuleInterop": true,

"isolatedModules": true,
"declaration": true,
Expand All @@ -39,11 +39,12 @@

"sourceMap": true,
"composite": true,
"baseUrl": "."
// "paths": {
// "@flyteconsole/client-app": ["./website/src"],
// "@flyteorg/*": ["./packages/*/src"]
// }
"baseUrl": ".",

"paths": {
"@flyteconsole/client-app": ["./website/src"],
"@flyteorg/*": ["./packages/*/src"]
}
},
"exclude": ["**/node_modules", "**/dist", "**/lib"]
}
16 changes: 6 additions & 10 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyteconsole/client-app",
"version": "0.0.0-develop",
"version": "2.0.0",
"description": "The web UI for the Flyte platform",
"private": true,
"repository": {
Expand Down Expand Up @@ -30,13 +30,14 @@
"author": "Lyft <[email protected]>",
"license": "Apache-2.0",
"peerDependencies": {
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.7",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"dependencies": {
"@flyteorg/common": "^0.0.2",
"@flyteorg/console": "^0.0.1",
"lodash": "^4.17.21",
"@flyteorg/common": "^0.0.3",
"@flyteorg/console": "^0.0.6",
"long": "^4.0.0",
"protobufjs": "~6.11.3",
"react-ga4": "^1.4.1",
Expand All @@ -45,14 +46,9 @@
"use-react-router": "^1.0.7"
},
"devDependencies": {
"@types/long": "^3.0.32",
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.7",
"camelcase-keys": "^7.0.2",
"react-hot-loader": "^4.1.2"
"@types/long": "^3.0.32"
},
"resolutions": {
"long": "^4.0.0",
"protobufjs": "~6.11.3",
"micromatch": "^4.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion website/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ app.use(env.BASE_URL, appRouter);

const showEntryPointUrl = () => {
console.log(chalk.magenta(`Express server ready!`));
const url = `${env.ADMIN_API_USE_SSL}://${
const url = `${env.ADMIN_API_USE_SSL}${
env.LOCAL_DEV_HOST || env.ADMIN_API_URL?.replace('https', '')
}:${PORT}${env.BASE_URL}`;

Expand Down
6 changes: 5 additions & 1 deletion website/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

"references": [
{ "path": "../packages/common/tsconfig.build.json" },
{ "path": "../packages/console/tsconfig.build.json" }
{ "path": "../packages/console/tsconfig.build.json" },
{ "path": "../packages/flyte-api/tsconfig.build.json" },
{ "path": "../packages/flyteidl-types/tsconfig.build.json" },
{ "path": "../packages/locale/tsconfig.build.json" },
{ "path": "../packages/ui-atoms/tsconfig.build.json" }
]
}
2 changes: 1 addition & 1 deletion website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"noImplicitOverride": false
},

"include": ["src/**/*", "src/env.js", "./packages/*"],
"include": ["src/**/*", "env.js"],

"references": [
{ "path": "../packages/common" },
Expand Down
37 changes: 19 additions & 18 deletions website/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
/* eslint-disable no-console */
import * as webpack from 'webpack';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
import HTMLWebpackPlugin, {
Options as HtmlWebpackOptions,
} from 'html-webpack-plugin';
import HTMLWebpackPlugin from 'html-webpack-plugin';

import { ASSETS_PATH as publicPath, processEnv } from './env';
import {
Expand All @@ -17,7 +15,7 @@ import {
getConfigFile,
getDefinePlugin,
statsWriterPlugin,
getResolveOptions,
resolveOptions,
getModuleOptions,
getShouldLoadReactFromCDN,
logWebpackStats,
Expand All @@ -38,18 +36,21 @@ module.exports = (_env: any, argv: { mode: Mode }) => {
const webpackConfig = require(WEBPACK_PATHS[mode]);
const shouldLoadReactFromCDN = getShouldLoadReactFromCDN(mode);

const htmlWebpackOptions: HtmlWebpackOptions = merge(DEFAULT_HTML_WPC_OPTS, {
...webpackConfig.htmlWebpackOptions,
processEnv: JSON.stringify(processEnv),
...(shouldLoadReactFromCDN
? {
cdnSettings: {
cdnReact: CDN_REACT,
cdnReactDOM: CDN_REACT_DOM,
},
}
: {}),
});
const htmlWebpackOptions: HTMLWebpackPlugin.Options = merge(
DEFAULT_HTML_WPC_OPTS,
{
...webpackConfig.htmlWebpackOptions,
processEnv: JSON.stringify(processEnv),
...(shouldLoadReactFromCDN
? {
cdnSettings: {
cdnReact: CDN_REACT,
cdnReactDOM: CDN_REACT_DOM,
},
}
: {}),
},
);

/**
* Client configuration
Expand Down Expand Up @@ -83,7 +84,7 @@ module.exports = (_env: any, argv: { mode: Mode }) => {
}
: {}),

resolve: getResolveOptions(mode),
resolve: resolveOptions,

module: getModuleOptions(mode),

Expand Down Expand Up @@ -160,7 +161,7 @@ module.exports = (_env: any, argv: { mode: Mode }) => {
externals: [nodeExternals({ allowlist: /lyft/ })],
externalsPresets: { node: true },

resolve: getResolveOptions(mode),
resolve: resolveOptions,

module: getModuleOptions(mode),

Expand Down
Loading

0 comments on commit b00186a

Please sign in to comment.