Skip to content

Commit

Permalink
feat: Place contentscript, launcher and bridge libs at the same level
Browse files Browse the repository at this point in the history
To allow/force to embed them distinctly.
  • Loading branch information
doubleface authored and doubleface committed Jan 23, 2023
1 parent bd9d6ff commit 1716c1f
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 11 deletions.
20 changes: 20 additions & 0 deletions packages/cozy-ccc-libs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
`cozy-ccc-libs` provides libraries necessary to cozy konnectors on client side and also on launcher
side.

To get the libs necessary on content script side use :

```javascript
import libs from 'cozy-ccc-libs/contentscript'
```

To get the libs necessary in the launcher use :

```javascript
import launcherLibs from 'cozy-ccc-libs/launcher'
```

To get the bridge necessary to allow communication between content script and launcher use :

```javascript
import bridge from 'cozy-ccc-libs/bridge'
```
1 change: 0 additions & 1 deletion packages/cozy-ccc-libs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "cozy-ccc-libs",
"version": "0.1.0",
"description": "All the libs needed to run a cozy client connector",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/konnectors/libs.git"
Expand Down
3 changes: 3 additions & 0 deletions packages/cozy-ccc-libs/src/bridge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as LauncherBridge } from './bridge/LauncherBridge'
export { default as ContentScriptMessenger } from './bridge/ContentScriptMessenger'
export { default as bridgeInterfaces } from './bridge/bridgeInterfaces'
3 changes: 0 additions & 3 deletions packages/cozy-ccc-libs/src/bridge/index.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/cozy-ccc-libs/src/contentscript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as ContentScript } from './contentscript/ContentScript'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import get from 'lodash/get'
import waitFor from 'p-wait-for'
import Minilog from '@cozy/minilog'

import LauncherBridge from './bridge/LauncherBridge'
import LauncherBridge from '../bridge/LauncherBridge'
import { blobToBase64 } from './utils'
import ky from 'ky/umd'

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions packages/cozy-ccc-libs/src/launcher.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { default as addData } from './launcher/addData'
export { default as hydrateAndFilter } from './launcher/hydrateAndFilter'
export { default as saveFiles } from './launcher/saveFiles'
export { default as saveBills } from './launcher/saveBills'
export { default as saveIdentity } from './launcher/saveIdentity'
export { default as updateOrCreate } from './launcher/updateOrCreate'
6 changes: 0 additions & 6 deletions packages/cozy-ccc-libs/src/launcher/index.js

This file was deleted.

0 comments on commit 1716c1f

Please sign in to comment.