Skip to content

Commit

Permalink
Merge pull request #2 from goldmansachs/review-repl
Browse files Browse the repository at this point in the history
Support server side push down operations for REPL using Ag-grid
  • Loading branch information
gayathrir11 authored Mar 22, 2024
2 parents aeeee48 + 15eb421 commit cc42e58
Show file tree
Hide file tree
Showing 53 changed files with 2,905 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/nine-poets-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@finos/legend-application-repl': patch
'@finos/legend-application-repl-deployment': patch
---

Support server side push down operations for REPL using Ag-grid
5 changes: 5 additions & 0 deletions .changeset/twenty-insects-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-graph': patch
---

Add models for new `ClassInstance` valueSpecification types
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"dev:assemblage": "node ./scripts/workflow/setupLocalDevAssemblage.js",
"dev:mock-server": "yarn workspace @finos/legend-fixture-mock-server dev",
"dev:pure": "yarn workspace @finos/legend-application-pure-ide-deployment dev",
"dev:repl": "yarn workspace @finos/legend-application-repl-deployment dev",
"dev:query": "yarn workspace @finos/legend-application-query-deployment dev",
"dev:sass": "node ./scripts/workflow/buildSassAll.js --watch",
"dev:showcase-server": "yarn workspace @finos/legend-server-showcase-deployment dev",
Expand Down
3 changes: 3 additions & 0 deletions packages/legend-application-repl-deployemnt/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
/*.*
!/dist
3 changes: 3 additions & 0 deletions packages/legend-application-repl-deployemnt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @finos/legend-application-repl-deployment

This is the `Legend REPL` web application deployment. This is used for development locally
Binary file not shown.
62 changes: 62 additions & 0 deletions packages/legend-application-repl-deployemnt/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "@finos/legend-application-repl-deployment",
"version": "0.0.0",
"description": "Legend REPL web application deployment",
"keywords": [
"legend",
"legend-application",
"legend-repl",
"deployment"
],
"homepage": "https://github.com/finos/legend-studio/tree/master/packages/legend-application-repl-deployment",
"bugs": {
"url": "https://github.com/finos/legend-studio/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/finos/legend-studio.git",
"directory": "packages/legend-application-repl-deployment"
},
"license": "Apache-2.0",
"type": "module",
"scripts": {
"build:webpack": "cross-env NODE_ENV=production webpack --mode production",
"bundle": "yarn clean && yarn build:webpack && node ./scripts/setup.js --dir ./dist/repl",
"bundle:analyze": "cross-env NODE_ENV=production webpack --mode production --analyze",
"bundle:fast": "cross-env NODE_ENV=production PRODUCTION_MODE=fast webpack --mode production && node ./scripts/setup.js --dir ./dist/repl",
"clean": "yarn clean:cache && rimraf \"dist\"",
"clean:cache": "rimraf \"build\"",
"dev": "npm-run-all --parallel dev:ts dev:webpack",
"dev:ts": "tsc --watch --preserveWatchOutput",
"dev:webpack": "cross-env NODE_ENV=development webpack serve --mode development",
"dev:webpack:debug": "cross-env NODE_ENV=development DEVELOPMENT_MODE=debug webpack serve --mode development",
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\",requireConfigFile:false \"./scripts/**/*.{mjs,cjs,js}\" \"./src/**/*.{js,ts,tsx}\"",
"publish:pre-prepare": "yarn clean && yarn build:webpack && node ./scripts/setup.js --dir ./dist/repl --use-dynamic-repl-server",
"publish:prepare": "node ../../scripts/release/preparePublishContent.js",
"publish:snapshot": "node ../../scripts/release/publishDevSnapshot.js",
"serve": "npx http-server ./dist -p 3000 -a localhost -g --cors -o /repl",
"setup": "rimraf \"dev\" && yarn node ./scripts/setup.js --dir ./dev"
},
"dependencies": {
"@finos/legend-application": "workspace:*",
"@finos/legend-application-repl": "workspace:*",
"@finos/legend-art": "workspace:*",
"@finos/legend-lego": "workspace:*"
},
"devDependencies": {
"@finos/legend-dev-utils": "workspace:*",
"copy-webpack-plugin": "11.0.0",
"cross-env": "7.0.3",
"eslint": "8.52.0",
"npm-run-all": "4.1.5",
"rimraf": "5.0.5",
"typescript": "5.2.2",
"webpack": "5.89.0",
"webpack-bundle-analyzer": "4.9.1",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.15.1"
},
"publishConfig": {
"directory": "build/publishContent"
}
}
41 changes: 41 additions & 0 deletions packages/legend-application-repl-deployemnt/repl.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export default {
/**
* `favicon` [string, optional]
* Relative path to the favicon file
* e.g. './assets/favicon.ico'
*/
faviconPath: './assets/favicon.ico',
/**
* `baseUrl` [string, required]
* Base URL for your site. This can also be considered the path after the host.
* e.g. `/something/` is the `baseUrl` of https://www.example.org/something/
* For URLs that have no path, use '/'.
*/
baseUrl: '/repl/',
/**
* `devServerOptions` [object, optional]
* Options to override `webpack-dev-server` configs.
* See https://webpack.js.org/configuration/dev-server/
*/
devServerOptions: {
// NOTE: for development from within a Docker container, it's best to update this to 0.0.0.0
host: 'localhost',
port: 9005,
},
};
66 changes: 66 additions & 0 deletions packages/legend-application-repl-deployemnt/scripts/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
import { existsSync, mkdirSync, writeFileSync } from 'fs';

const __dirname = dirname(fileURLToPath(import.meta.url));

const argv = yargs.default(hideBin(process.argv)).argv;

const setup = (outputDir) => {
if (!existsSync(outputDir)) {
mkdirSync(outputDir);
}

writeFileSync(
resolve(outputDir, 'version.json'),
JSON.stringify(
{
buildTime: new Date().toISOString(),
version: '0.0.0-local',
commitSHA: 'local',
},
null,
2,
),
);

writeFileSync(
resolve(outputDir, 'config.json'),
JSON.stringify(
{
appName: 'REPL',
env: 'local',
repl: {
url: 'http://localhost:8080',
dynamic: argv['use-dynamic-repl-server'] ? true : undefined,
},
documentation: {
url: 'https://legend.finos.org',
registry: [],
},
},
undefined,
2,
),
);
};

setup(resolve(__dirname, `../${argv.dir}`));
13 changes: 13 additions & 0 deletions packages/legend-application-repl-deployemnt/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<title>REPL</title>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
</head>

<body style="width: 100%; height: 100vh; overflow: hidden"></body>
</html>
21 changes: 21 additions & 0 deletions packages/legend-application-repl-deployemnt/src/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@import url('@finos/legend-art/lib/index.css');
@import url('@finos/legend-application/lib/index.css');
@import url('@finos/legend-lego/lib/index.css');

@import url('@finos/legend-application-repl/lib/index.css');
21 changes: 21 additions & 0 deletions packages/legend-application-repl-deployemnt/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { LegendREPLGridClientWebApplication } from '@finos/legend-application-repl';
import config from '../repl.config.js';
import './index.scss';

LegendREPLGridClientWebApplication.run(config.baseUrl);
22 changes: 22 additions & 0 deletions packages/legend-application-repl-deployemnt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "@finos/legend-dev-utils/tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "build/dev.tsbuildinfo",
"noEmit": true,
"jsx": "react-jsxdev",
"allowJs": true
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.json",
"repl.config.js"
],
"references": [
{ "path": "../legend-application" },
{ "path": "../legend-art" },
{ "path": "../legend-shared" },
{ "path": "../legend-application-repl" },
{ "path": "../legend-lego" }
]
}
71 changes: 71 additions & 0 deletions packages/legend-application-repl-deployemnt/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { resolve, dirname } from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import appConfig from './repl.config.js';
import {
getEnvInfo,
getWebAppBaseWebpackConfig,
} from '@finos/legend-dev-utils/WebpackConfigUtils';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));

export default (env, arg) => {
const { isEnvDevelopment } = getEnvInfo(env, arg);

const baseConfig = getWebAppBaseWebpackConfig(env, arg, __dirname, {
mainEntryPath: resolve(__dirname, './src/index.tsx'),
indexHtmlPath: resolve(__dirname, './src/index.html'),
appConfig,
babelConfigPath: resolve(__dirname, '../../babel.config.cjs'),
enableReactFastRefresh: isEnvDevelopment,
});
const config = {
...baseConfig,
devServer: {
...baseConfig.devServer,
...appConfig.devServerOptions,
},
plugins: [
...baseConfig.plugins,
// For development, we want to serve the `config.json` and `version.json` files at the `/baseUrl`
isEnvDevelopment &&
new CopyWebpackPlugin({
patterns: [
{
from: resolve(__dirname, './dev/config.json'),
// trim the leading and trailing slash
to:
appConfig.baseUrl.length === 1
? undefined
: appConfig.baseUrl.slice(1, -1),
},
{
from: resolve(__dirname, './dev/version.json'),
// trim the leading and trailing slash
to:
appConfig.baseUrl.length === 1
? undefined
: appConfig.baseUrl.slice(1, -1),
},
],
}),
].filter(Boolean),
};
return config;
};
6 changes: 6 additions & 0 deletions packages/legend-application-repl/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/build
/style
**/__mocks__/**
**/__tests__/**
/*.*
!tsconfig.json
3 changes: 3 additions & 0 deletions packages/legend-application-repl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @finos/legend-application-repl

Legend REPL
24 changes: 24 additions & 0 deletions packages/legend-application-repl/_package.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export default {
publish: {
typescript: {
main: './tsconfig.publish.json',
others: ['./tsconfig.package.json'],
},
},
};
Loading

0 comments on commit cc42e58

Please sign in to comment.