-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
557 additions
and
1,866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ cypress/report.json | |
cypress/screenshots/actual | ||
cypress/videos/ | ||
dist/ | ||
compiled/ | ||
yarn-error.log | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,63 +3,53 @@ | |
"version": "0.0.39", | ||
"description": "Common AWS features for grafana", | ||
"main": "dist/index.js", | ||
"publishConfig": { | ||
"main": "dist/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/index.d.ts", | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"dev": "watch 'npm run bundle' ./src", | ||
"dev": "yarn bundle --watch", | ||
"build": "yarn clean && yarn typecheck && yarn bundle", | ||
"bundle": "rollup -c rollup.config.ts", | ||
"clean": "rimraf ./dist ./compiled", | ||
"typecheck": "tsc --noEmit", | ||
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx ./src", | ||
"typecheck": "tsc -p ./tsconfig.build.json", | ||
"test": "jest --notify --watch", | ||
"test:coverage": "jest --coverage", | ||
"test-ci": "grafana-toolkit plugin:test" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"dist" | ||
], | ||
"repository": "github:grafana/grafana-aws-sdk-react", | ||
"author": "Grafana Labs <[email protected]> (https://grafanap.com)", | ||
"author": "Grafana Labs <[email protected]> (https://grafana.com)", | ||
"license": "Apache-2.0", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.13.12", | ||
"@babel/preset-react": "^7.13.13", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@grafana/data": "9.2.3", | ||
"@grafana/runtime": "9.2.3", | ||
"@grafana/toolkit": "9.2.3", | ||
"@grafana/ui": "9.2.3", | ||
"@rollup/plugin-commonjs": "11.0.2", | ||
"@rollup/plugin-json": "4.0.3", | ||
"@rollup/plugin-node-resolve": "7.1.1", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@testing-library/jest-dom": "5.16.5", | ||
"@testing-library/react": "12.1.5", | ||
"@testing-library/react-hooks": "8.0.1", | ||
"@types/braintree__sanitize-url": "4.0.0", | ||
"@types/jest": "27.4.1", | ||
"@types/jquery": "3.3.38", | ||
"@types/lodash": "4.14.123", | ||
"@types/node": "10.14.1", | ||
"@types/papaparse": "5.2.0", | ||
"@types/lodash": "4.14.191", | ||
"@types/node": "16.18.6", | ||
"@types/react": "17.0.42", | ||
"@types/react-dom": "17.0.14", | ||
"@types/react-test-renderer": "^17.0.1", | ||
"@types/rollup-plugin-visualizer": "2.6.0", | ||
"@types/sinon": "^7.5.2", | ||
"babel-jest": "^26.6.3", | ||
"esbuild": "^0.16.2", | ||
"jest": "27.5.1", | ||
"node-notifier": "^10.0.1", | ||
"pretty-format": "25.1.0", | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2", | ||
"react-select-event": "^5.3.0", | ||
"react-test-renderer": "^17.0.2", | ||
"rimraf": "^3.0.2", | ||
"rollup": "2.0.6", | ||
"rollup-plugin-sourcemaps": "0.5.0", | ||
"rollup-plugin-terser": "5.3.0", | ||
"rollup-plugin-typescript2": "^0.29.0", | ||
"rollup-plugin-visualizer": "3.3.1", | ||
"sinon": "8.1.1" | ||
"rollup": "2.79.1", | ||
"rollup-plugin-dts": "^5.0.0", | ||
"rollup-plugin-esbuild": "^5.0.0", | ||
"rollup-plugin-node-externals": "^5.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
import path from 'path'; | ||
import dts from 'rollup-plugin-dts'; | ||
import esbuild from 'rollup-plugin-esbuild'; | ||
import { externals } from 'rollup-plugin-node-externals'; | ||
|
||
import typescript from 'rollup-plugin-typescript2'; | ||
const packagePath = './package.json'; | ||
const pkg = require(packagePath); | ||
|
||
const pkg = require('./package.json'); | ||
|
||
const libraryName = pkg.name; | ||
|
||
const buildCjsPackage = ({ env }) => { | ||
return { | ||
export default [ | ||
{ | ||
input: 'src/index.ts', | ||
plugins: [ | ||
externals({ | ||
deps: true, | ||
include: ['react', '@grafana/data', '@grafana/ui', 'lodash'], | ||
packagePath, | ||
}), | ||
resolve(), | ||
esbuild(), | ||
], | ||
output: [ | ||
{ | ||
file: `dist/index.${env}.js`, | ||
name: libraryName, | ||
format: 'cjs', | ||
sourcemap: true, | ||
chunkFileNames: `[name].${env}.js`, | ||
strict: false, | ||
exports: 'named', | ||
globals: { | ||
react: 'React', | ||
'prop-types': 'PropTypes', | ||
}, | ||
dir: path.dirname(pkg.publishConfig.main), | ||
}, | ||
{ | ||
format: 'esm', | ||
sourcemap: true, | ||
dir: path.dirname(pkg.publishConfig.module), | ||
preserveModules: true, | ||
}, | ||
], | ||
external: ['react', '@grafana/data', '@grafana/ui', 'lodash'], | ||
plugins: [ | ||
typescript({ | ||
rollupCommonJSResolveHack: false, | ||
clean: true, | ||
}), | ||
commonjs({ | ||
include: /node_modules/, | ||
}), | ||
resolve(), | ||
env === 'production' && terser(), | ||
], | ||
}; | ||
}; | ||
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })]; | ||
}, | ||
{ | ||
input: './compiled/index.d.ts', | ||
plugins: [dts()], | ||
output: { | ||
file: pkg.publishConfig.types, | ||
format: 'es', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { ConfigSelect, ConfigSelectProps } from './ConfigSelect'; | ||
export { InlineInput, InlineInputProps } from './InlineInput'; | ||
export { ConfigSelect, type ConfigSelectProps } from './ConfigSelect'; | ||
export { InlineInput, type InlineInputProps } from './InlineInput'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"exclude": ["**/*.test.ts", "**/*.test.tsx", "dist", "node_modules"], | ||
"extends": "./tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{ | ||
"extends": "@grafana/tsconfig/base.json", | ||
"include": ["src", "index.js"], | ||
"extends": "@grafana/tsconfig", | ||
"include": ["src/**/*.ts"], | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"baseUrl": "./src", | ||
"rootDir": "./src", | ||
"typeRoots": ["./node_modules/@types"], | ||
"declaration": true, | ||
"outDir": "dist" | ||
"declarationDir": "./compiled", | ||
"emitDeclarationOnly": true, | ||
"isolatedModules": true | ||
} | ||
} |
Oops, something went wrong.