Skip to content

Commit 4fa7cc1

Browse files
authored
chore(compass-find-in-page): Move to typescript, use leafygreen COMPASS-5609 (#2903)
1 parent fe9a404 commit 4fa7cc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1688
-2823
lines changed

package-lock.json

+895-998
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-find-in-page/.babelrc.js

-24
This file was deleted.

packages/compass-find-in-page/.browserslistrc

-1
This file was deleted.
+9-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
ignores: [
2-
"@babel/cli",
3-
"@babel/register",
4-
"core-js",
5-
"electron-rebuild",
6-
"font-awesome",
7-
"hadron-react-components",
8-
"karma-electron",
9-
"karma-sourcemap-loader",
10-
"karma-webpack",
11-
"mongodb-connection-model",
12-
"resolve",
13-
"webpack-bundle-analyzer",
14-
"webpack-cli",
15-
"mongodb-compass"
16-
]
1+
ignores:
2+
- '@mongodb-js/prettier-config-compass'
3+
- '@mongodb-js/tsconfig-compass'
4+
- '@types/chai'
5+
- '@types/sinon-chai'
6+
- 'sinon'
7+
- '@types/chai-dom'
8+
- '@types/react'
9+
- '@types/react-dom'

packages/compass-find-in-page/.editorconfig

-16
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.nyc-output
2+
dist

packages/compass-find-in-page/.eslintrc

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@mongodb-js/eslint-config-compass'],
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: ['./tsconfig-lint.json'],
7+
},
8+
};

packages/compass-find-in-page/.gitignore

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@mongodb-js/mocha-config-compass/compass-plugin');

packages/compass-find-in-page/.npmignore

-17
This file was deleted.

packages/compass-find-in-page/.nycrc

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.nyc_output
2+
dist
3+
coverage

packages/compass-find-in-page/.prettierrc

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@mongodb-js/prettier-config-compass"
+1-69
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,3 @@
1-
# compass-find-in-page
1+
# @mongodb-js/compass-find-in-page
22

33
> cmd-f UI for compass
4-
5-
## Usage
6-
7-
### Scripts
8-
9-
`link-plugin`: Links the Compass plugin and Compass for development along with React to ensure the
10-
plugin and Compass are using the same React instance.
11-
12-
```shell
13-
COMPASS_HOME=/path/to/my/compass npm run link-plugin
14-
```
15-
16-
`unlink-plugin`: Restores Compass and the plugin to their original unlinked state.
17-
18-
```shell
19-
COMPASS_HOME=/path/to/my/compass npm run unlink-plugin
20-
```
21-
22-
## Features
23-
24-
#### Electron
25-
26-
Validate and test your component in an Electron window, styles included. The source automatically
27-
compiles and the window content reloads when any file under `./src` changes.
28-
29-
To start Electron and render your component, type `npm start`.
30-
31-
#### Enzyme
32-
33-
The test environment is configured to test components with [Enzyme][enzyme]
34-
(including full `mount` mode through [jsdom][jsdom]) and [enzyme-chai][enzyme-chai].
35-
See the test folder for examples. Run `npm test` to execute the test suite.
36-
37-
## Developing
38-
39-
Almost all of your development will happen in the `./src` directory. Add new components
40-
to `./src/components`, actions to `./src/actions/index.js` and if you need additional
41-
stores, add them to `./src/stores`.
42-
43-
To be able to debug the plugin inside `compass` make sure [webpack prod
44-
config](./config/webpack.prod.config.js) has `devtool` is set to `source-map`.
45-
If you want faster compiler time when you commit/push, switch it to `false.`
46-
47-
```js
48-
const config = {
49-
target: 'electron-renderer',
50-
devtool: 'source-map'
51-
}
52-
```
53-
54-
#### Directory Structure
55-
56-
For completeness, below is a list of directories present in this module:
57-
58-
- `electron` code to start electron, open a browser window and load the source.
59-
You don't usually need to touch this, unless you want to render something other
60-
than the main component in Electron.
61-
- `lib` compiled version of your components (plain javascript instead of `jsx`) and
62-
styles (`css` instead of `less`). Never change anything here as this entire folder
63-
gets automatically created and overwritten.
64-
- `src` components, actions and stores source code, as well as style files. This is the
65-
place to implement your own components. `npm run compile` will use `./src` as input
66-
and create `./lib`.
67-
- `test` implement your tests here, and name the files `*.test.js`.
68-
69-
[enzyme]: http://airbnb.io/enzyme/
70-
[enzyme-chai]: https://github.com/producthunt/chai-enzyme
71-
[jsdom]: https://github.com/tmpvar/jsdom

packages/compass-find-in-page/config/project.js

-24
This file was deleted.

packages/compass-find-in-page/config/webpack.base.config.js

-93
This file was deleted.

0 commit comments

Comments
 (0)