Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute types as is #8720

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Chart.js relies on [Travis CI](https://travis-ci.org/) to automate the library [
Creation of this tag triggers a new build:

* `Chart.js.zip` package is generated, containing dist files and examples
* `dist/*.js` and `Chart.js.zip` are attached to the GitHub release (downloads)
* `dist/*.js`, `types/*.ts`, and `Chart.js.zip` are attached to the GitHub release (downloads)
* A new npm package is published on [npmjs](https://www.npmjs.com/package/chart.js)

Finally, [cdnjs](https://cdnjs.com/libraries/Chart.js) is automatically updated from the npm release.
Expand Down
34 changes: 0 additions & 34 deletions package-lock.json

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

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"unpkg": "dist/chart.min.js",
"main": "dist/chart.js",
"module": "dist/chart.esm.js",
"types": "dist/chart.esm.d.ts",
"types": "types/chart.esm.d.ts",
"keywords": [
"canvas",
"charts",
Expand All @@ -28,9 +28,9 @@
"auto/**/*.js",
"auto/**/*.d.ts",
"dist/*.js",
"dist/*.d.ts",
"dist/chunks/*.js",
"dist/chunks/*.d.ts",
"types/*.d.ts",
"types/helpers/*.d.ts",
"helpers/**/*.js",
"helpers/**/*.d.ts"
],
Expand Down Expand Up @@ -84,7 +84,6 @@
"rollup": "^2.41.4",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^3.0.1",
"rollup-plugin-istanbul": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"typedoc": "^0.20.32",
Expand Down
21 changes: 0 additions & 21 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const analyze = require('rollup-plugin-analyzer');
const cleanup = require('rollup-plugin-cleanup');
const dts = require('rollup-plugin-dts').default;
const json = require('@rollup/plugin-json');
const resolve = require('@rollup/plugin-node-resolve').default;
const terser = require('rollup-plugin-terser').terser;
Expand All @@ -11,10 +10,6 @@ const inputESM = {
'dist/chart.esm': 'src/index.esm.js',
'dist/helpers.esm': 'src/helpers/index.js'
};
const inputESMTypings = {
'dist/chart.esm': 'types/index.esm.d.ts',
'dist/helpers.esm': 'types/helpers/index.d.ts'
};

const banner = `/*!
* Chart.js v${pkg.version}
Expand Down Expand Up @@ -84,20 +79,4 @@ module.exports = [
indent: false,
},
},
// ES6 Typings builds
// dist/chart.esm.d.ts
// helpers/*.d.ts
{
input: inputESMTypings,
plugins: [
dts()
],
output: {
dir: './',
chunkFileNames: 'dist/chunks/[name].ts',
banner,
format: 'esm',
indent: false,
},
}
];
14 changes: 0 additions & 14 deletions types/index.esm.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
/**
* Top-level type definitions. These are processed by Rollup and rollup-plugin-dts
* to make a combined .d.ts file under dist; that way, all of the type definitions
* appear directly within the "chart.js" module; that matches the layout of the
* distributed chart.esm.js bundle and means that users of Chart.js can easily use
* module augmentation to extend Chart.js's types and plugins within their own
* code, like so:
*
* @example
* declare module "chart.js" {
* // Add types here
* }
*/

import { DeepPartial, DistributiveArray, UnionToIntersection } from './utils';

import { TimeUnit } from './adapters';
Expand Down