Skip to content

Commit

Permalink
chore(compass-generative-ai): add generative ai package COMPASS-7244 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Anemy authored Oct 10, 2023
1 parent 66099ac commit a1f53d1
Show file tree
Hide file tree
Showing 28 changed files with 320 additions and 37 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ Is there anything else you’d like to see in Compass? Let us know by submitting
- [**@mongodb-js/compass-connections**](packages/compass-connections): Manage your MongoDB connections and connect in Compass
- [**@mongodb-js/compass-databases-navigation**](packages/compass-databases-navigation): Databases and collections sidebar navigation tree
- [**@mongodb-js/compass-editor**](packages/compass-editor): Reusable Compass editor component based on ace-editor with MongoDB-specific ace modes, themes, and autocompleters
- [**@mongodb-js/compass-generative-ai**](packages/compass-generative-ai): Shared components and helpers for the generative ai aspects of Compass
- [**@mongodb-js/compass-logging**](packages/compass-logging): Shared helpers for logging in Compass packages
- [**@mongodb-js/compass-maybe-protect-connection-string**](packages/compass-maybe-protect-connection-string): Utility for protecting connection strings if requested
- [**@mongodb-js/compass-settings**](packages/compass-settings): Settings for compass
- [**@mongodb-js/compass-settings**](packages/compass-settings): Settings for Compass
- [**@mongodb-js/compass-utils**](packages/compass-utils): Utilities for MongoDB Compass Development
- [**@mongodb-js/compass-welcome**](packages/compass-welcome): The welcome modal
- [**@mongodb-js/connection-form**](packages/connection-form): A form for specifying information needed to connect to a MongoDB instance
Expand Down
125 changes: 125 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/compass-aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@mongodb-js/compass-components": "^1.15.0",
"@mongodb-js/compass-crud": "^13.15.1",
"@mongodb-js/compass-editor": "^0.14.1",
"@mongodb-js/compass-generative-ai": "^0.1.0",
"@mongodb-js/compass-logging": "^1.2.2",
"@mongodb-js/compass-user-data": "^0.1.4",
"@mongodb-js/compass-utils": "^0.5.1",
Expand Down Expand Up @@ -102,6 +103,7 @@
"@mongodb-js/compass-components": "^1.15.0",
"@mongodb-js/compass-crud": "^13.15.1",
"@mongodb-js/compass-editor": "^0.14.1",
"@mongodb-js/compass-generative-ai": "^0.1.0",
"@mongodb-js/compass-logging": "^1.2.2",
"@mongodb-js/compass-user-data": "^0.1.4",
"@mongodb-js/compass-utils": "^0.5.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useRef, useEffect } from 'react';
import { GenerativeAIInput, openToast } from '@mongodb-js/compass-components';
import { openToast } from '@mongodb-js/compass-components';
import { GenerativeAIInput } from '@mongodb-js/compass-generative-ai';
import { connect } from 'react-redux';
import createLoggerAndTelemetry from '@mongodb-js/compass-logging';
import { usePreference } from 'compass-preferences-model';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import { connect } from 'react-redux';
import {
AIExperienceEntry,
Button,
MoreOptionsToggle,
PerformanceSignals,
SignalPopover,
css,
spacing,
} from '@mongodb-js/compass-components';
import { AIExperienceEntry } from '@mongodb-js/compass-generative-ai';
import type { RootState } from '../../../modules';
import {
exportAggregationResults,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
import {
AIExperienceEntry,
Pipeline,
Stage,
Description,
Expand All @@ -11,6 +10,7 @@ import {
Button,
Icon,
} from '@mongodb-js/compass-components';
import { AIExperienceEntry } from '@mongodb-js/compass-generative-ai';
import { useIsAIFeatureEnabled } from 'compass-preferences-model';

import type { RootState } from '../../../modules';
Expand Down
6 changes: 1 addition & 5 deletions packages/compass-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ import {
export { DocumentIcon } from './components/icons/document-icon';
export { FavoriteIcon } from './components/icons/favorite-icon';
export { NoSavedItemsIcon } from './components/icons/no-saved-items-icon';
export {
AIExperienceEntry,
GenerativeAIInput,
createAIPlaceholderHTMLPlaceholder,
} from './components/generative-ai';
export { GuideCue as LGGuideCue } from '@leafygreen-ui/guide-cue';
export { Variant as BadgeVariant } from '@leafygreen-ui/badge';
export { Variant as BannerVariant } from '@leafygreen-ui/banner';
export {
Expand Down
11 changes: 11 additions & 0 deletions packages/compass-generative-ai/.depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ignores:
- '@mongodb-js/prettier-config-compass'
- '@mongodb-js/tsconfig-compass'
- '@types/chai'
- '@types/sinon-chai'
- 'sinon'
- '@types/chai-dom'
- '@types/react'
- '@types/react-dom'
ignore-patterns:
- 'dist'
2 changes: 2 additions & 0 deletions packages/compass-generative-ai/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.nyc-output
dist
8 changes: 8 additions & 0 deletions packages/compass-generative-ai/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
root: true,
extends: ['@mongodb-js/eslint-config-compass'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig-lint.json'],
},
};
1 change: 1 addition & 0 deletions packages/compass-generative-ai/.mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@mongodb-js/mocha-config-compass/compass-plugin');
3 changes: 3 additions & 0 deletions packages/compass-generative-ai/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.nyc_output
dist
coverage
1 change: 1 addition & 0 deletions packages/compass-generative-ai/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@mongodb-js/prettier-config-compass"
91 changes: 91 additions & 0 deletions packages/compass-generative-ai/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"name": "@mongodb-js/compass-generative-ai",
"productName": "compass-generative-ai",
"description": "Generative AI aspects for Compass",
"author": {
"name": "MongoDB Inc",
"email": "[email protected]"
},
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://jira.mongodb.org/projects/COMPASS/issues",
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
},
"files": [
"dist"
],
"license": "SSPL",
"main": "dist/index.js",
"compass:main": "src/index.ts",
"exports": {
"browser": "./dist/browser.js",
"require": "./dist/index.js"
},
"compass:exports": {
".": "./src/index.ts"
},
"types": "./dist/src/index.d.ts",
"scripts": {
"bootstrap": "npm run postcompile",
"prepublishOnly": "npm run compile",
"compile": "npm run webpack -- --mode production",
"webpack": "webpack-compass",
"postcompile": "tsc --emitDeclarationOnly",
"start": "npm run webpack serve -- --mode development",
"analyze": "npm run webpack -- --mode production --analyze",
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
"eslint": "eslint",
"prettier": "prettier",
"lint": "npm run eslint . && npm run prettier -- --check .",
"depcheck": "compass-scripts check-peer-deps && depcheck",
"check": "npm run typecheck && npm run lint && npm run depcheck",
"check-ci": "npm run check",
"test": "mocha",
"test-electron": "xvfb-maybe electron-mocha --no-sandbox",
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",
"test-watch": "npm run test -- --watch",
"test-ci": "npm run test-cov",
"test-ci-electron": "npm run test-electron",
"reformat": "npm run prettier -- --write . && npm run eslint . --fix"
},
"peerDependencies": {
"@mongodb-js/compass-components": "^1.15.0",
"react": "*"
},
"dependencies": {
"@mongodb-js/compass-components": "^1.15.0"
},
"devDependencies": {
"@mongodb-js/eslint-config-compass": "^1.0.9",
"@mongodb-js/mocha-config-compass": "^1.3.1",
"@mongodb-js/prettier-config-compass": "^1.0.1",
"@mongodb-js/tsconfig-compass": "^1.0.3",
"@mongodb-js/webpack-config-compass": "^1.2.1",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"@types/chai": "^4.2.21",
"@types/chai-dom": "^0.0.10",
"@types/mocha": "^9.0.0",
"@types/react": "^17.0.5",
"@types/react-dom": "^17.0.10",
"@types/sinon-chai": "^3.2.5",
"chai": "^4.3.6",
"depcheck": "^1.4.1",
"eslint": "^7.25.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"prettier": "^2.7.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"sinon": "^9.2.3",
"xvfb-maybe": "^0.2.1"
}
}
Loading

0 comments on commit a1f53d1

Please sign in to comment.