Skip to content

Commit

Permalink
Merge pull request #102 from miroapp/chore/types-in-package
Browse files Browse the repository at this point in the history
Added types for module
  • Loading branch information
artem-molokov authored Aug 5, 2024
2 parents b772caf + 4b23e2c commit 0071c61
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-spies-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mirohq/cloud-data-import": patch
---

Added types for module
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
"name": "@mirohq/cloud-data-import",
"version": "0.4.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/esm/index.js",
"files": [
"dist",
"dist/esm"
],
"bin": {
"cloud-data-import": "./dist/cli.js"
},
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/esm/index.js"
"import": "./dist/esm/index.js",
"types": "./dist/index.d.ts"
}
},
"publishConfig": {
Expand All @@ -25,8 +32,8 @@
"lint:fix": "eslint . --fix",
"format": "prettier --write \"**/*.{js,ts,json,md}\"",
"prepare": "husky",
"build:cjs": "tsc -p tsconfig.build.json && tsc-alias",
"build:esm": "tsc -p tsconfig.esm.json && tsc-alias",
"build:cjs": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"build:esm": "tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json",
"build": "npm run build:cjs && npm run build:esm",
"release": "npm run build && changeset publish",
"dev:setup": "npm install && npm run build && npm link",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {createRateLimiter, getAwsScanners} from '@/scanners'

export type {GetAwsScannersArguments} from '@/scanners'

/**
* @public
* @experimental This export is experimental and may change or be removed in future versions.
Expand Down
8 changes: 4 additions & 4 deletions src/scanners/getAwsScanners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import {getEC2VpnGateways} from './scan-functions/aws/ec2-vpn-gateways'
import {getEC2NetworkInterfaces} from './scan-functions/aws/ec2-network-interfaces'
import {getAthenaNamedQueries} from './scan-functions/aws/athena-named-queries'

interface GetAwsScannersArguments {
credentials: Credentials
export interface GetAwsScannersArguments {
credentials?: Credentials
getRateLimiter: GetRateLimiterFunction
hooks: ScannerLifecycleHook[]
hooks?: ScannerLifecycleHook[]
regions: string[]
shouldIncludeGlobalServices: boolean
}
Expand All @@ -56,7 +56,7 @@ export const getAwsScanners = ({
const options = {
credentials,
getRateLimiter,
hooks,
hooks: hooks || [],
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/scanners/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export {RateLimiter, createRateLimiter} from './common/RateLimiter'
export {createGlobalScanner} from './common/createGlobalScanner'
export {createRegionalScanner} from './common/createRegionalScanner'
export {getAwsScanners} from './getAwsScanners'
export type {GetAwsScannersArguments} from './getAwsScanners'
4 changes: 3 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"rootDir": "./src",
"outDir": "./dist",
"module": "commonjs",
"target": "es2016"
"target": "es2016",
"declaration": true,
"declarationMap": true
},
"exclude": ["tests"]
}
4 changes: 3 additions & 1 deletion tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"outDir": "./dist/esm",
"moduleResolution": "node",
"module": "esnext",
"target": "esnext"
"target": "esnext",
"declaration": true,
"declarationMap": true
},
"exclude": ["tests"]
}

0 comments on commit 0071c61

Please sign in to comment.