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

Build with esbuild #6993

Merged
merged 10 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from 8 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
lib
esm
es6
dist
docs/_site/
docs/.jekyll-metadata
docs/.jekyll-cache
Expand Down
10 changes: 5 additions & 5 deletions examples/data-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"homepage": "https://github.com/marmelab/react-admin/tree/master/examples/data-generator",
"bugs": "https://github.com/marmelab/react-admin/issues",
"license": "MIT",
"main": "./lib/index.js",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"date-fns": "~1.29.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/products/ProductCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
CreateProps,
} from 'react-admin';
import { InputAdornment } from '@mui/material';
import RichTextInput from 'ra-input-rich-text';
import { RichTextInput } from 'ra-input-rich-text';

const PREFIX = 'ProductCreate';

Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/products/ProductEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
TextInput,
} from 'react-admin';
import { InputAdornment, styled } from '@mui/material';
import RichTextInput from 'ra-input-rich-text';
import { RichTextInput } from 'ra-input-rich-text';

import CustomerReferenceField from '../visitors/CustomerReferenceField';
import StarRatingField from '../reviews/StarRatingField';
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/src/posts/PostCreate.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useMemo } from 'react';
import RichTextInput from 'ra-input-rich-text';
import { RichTextInput } from 'ra-input-rich-text';
import {
ArrayInput,
AutocompleteInput,
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/src/posts/PostEdit.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import RichTextInput from 'ra-input-rich-text';
import { RichTextInput } from 'ra-input-rich-text';
import {
TopToolbar,
AutocompleteInput,
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"prettier": "~2.1.1",
"raf": "~3.4.1",
"ts-jest": "^26.4.4",
"typescript": "^4.4.0",
"wait-on": "^3.2.0",
"whatwg-fetch": "^3.0.0"
},
Expand All @@ -74,6 +75,7 @@
"cypress"
],
"dependencies": {
"typescript": "^4.4.0"
"npm-dts": "^1.3.10",
"tsup": "^5.11.4"
}
}
21 changes: 12 additions & 9 deletions packages/ra-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
"description": "Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React",
"files": [
"*.md",
"lib",
"esm",
"dist",
"src"
],
"main": "lib/index",
"module": "esm/index.js",
"types": "esm/index.d.ts",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"authors": [
"François Zaninotto",
Expand All @@ -21,10 +20,8 @@
"bugs": "https://github.com/marmelab/react-admin/issues",
"license": "MIT",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"devDependencies": {
"@testing-library/react": "^11.2.3",
Expand All @@ -33,6 +30,8 @@
"@types/react-redux": "^7.1.1",
"cross-env": "^5.2.0",
"final-form": "^4.20.2",
"final-form-arrays": "^3.0.2",
"history": "^5.1.0",
"ignore-styles": "~5.0.1",
"ra-test": "^4.0.0-alpha.0",
"react": "^17.0.0",
Expand All @@ -46,7 +45,9 @@
"rimraf": "^2.6.3"
},
"peerDependencies": {
"history": "^5.1.0",
"final-form": "^4.20.2",
"final-form-arrays": "^3.0.2",
"react": "^16.9.0 || ^17.0.0",
"react-dom": "^16.9.0 || ^17.0.0",
"react-final-form": "^6.5.2",
Expand All @@ -60,9 +61,11 @@
"date-fns": "^1.29.0",
"eventemitter3": "^3.0.0",
"inflection": "~1.12.0",
"jsonexport": "^2.4.1",
"lodash": "~4.17.5",
"prop-types": "^15.6.1",
"query-string": "^5.1.1",
"react-is": "^17.0.2",
"react-query": "^3.32.1",
"reselect": "~3.0.0"
}
Expand Down
1 change: 1 addition & 0 deletions packages/ra-core/src/dataProvider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from './useQueryWithStore';
export * from './useQuery';
export * from './useUpdate';

export type { Options } from './fetch';
export type { QueryProps, UseMutationValue, MutationProps };

export {
Expand Down
2 changes: 0 additions & 2 deletions packages/ra-core/src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import translate from './translate';
import { TranslationContext } from './TranslationContext';
import TranslationProvider, {
TranslationProviderProps,
} from './TranslationProvider';
Expand All @@ -14,7 +13,6 @@ const withTranslate = translate;
export {
translate, // deprecated
withTranslate, // deprecated
TranslationContext,
TranslationProvider,
TestTranslationProvider,
useLocale,
Expand Down
14 changes: 6 additions & 8 deletions packages/ra-data-fakerest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "ra-data-fakerest",
"version": "4.0.0-alpha.0",
"description": "JSON Server data provider for react-admin",
"main": "lib/index.js",
"module": "esm/index.js",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"LICENSE",
"*.md",
"lib",
"esm",
"dist",
"src"
],
"repository": {
Expand All @@ -31,10 +31,8 @@
},
"homepage": "https://github.com/marmelab/react-admin#readme",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"fakerest": "^3.0.0"
Expand Down
11 changes: 5 additions & 6 deletions packages/ra-data-graphql-simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "ra-data-graphql-simple",
"version": "4.0.0-alpha.0",
"description": "A GraphQL simple data provider for react-admin",
"main": "lib/index.js",
"module": "esm/index.js",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -26,10 +27,8 @@
],
"license": "MIT",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"graphql-ast-types-browser": "~1.0.2",
Expand Down
12 changes: 5 additions & 7 deletions packages/ra-data-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "ra-data-graphql",
"version": "4.0.0-alpha.0",
"description": "A GraphQL data provider for react-admin",
"main": "lib/index.js",
"module": "esm/index.js",
"types": "esm/index.d.ts",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -27,10 +27,8 @@
],
"license": "MIT",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"@apollo/client": "^3.3.19",
Expand Down
14 changes: 6 additions & 8 deletions packages/ra-data-json-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "ra-data-json-server",
"version": "4.0.0-alpha.0",
"description": "JSON Server data provider for react-admin",
"main": "lib/index.js",
"module": "esm/index.js",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"*.md",
"lib",
"esm",
"dist",
"src"
],
"authors": [
Expand All @@ -19,10 +19,8 @@
"bugs": "https://github.com/marmelab/react-admin/issues",
"license": "MIT",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"query-string": "^5.1.1",
Expand Down
14 changes: 6 additions & 8 deletions packages/ra-data-localstorage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "ra-data-local-storage",
"version": "4.0.0-alpha.0",
"description": "Local storage data provider for react-admin",
"main": "lib/index.js",
"module": "esm/index.js",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"LICENSE",
"*.md",
"lib",
"esm",
"dist",
"src"
],
"repository": {
Expand All @@ -31,10 +31,8 @@
},
"homepage": "https://github.com/marmelab/react-admin#readme",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"lodash": "~4.17.5",
Expand Down
14 changes: 6 additions & 8 deletions packages/ra-data-simple-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "ra-data-simple-rest",
"version": "4.0.0-alpha.0",
"description": "Simple REST data provider for react-admin",
"main": "lib/index.js",
"module": "esm/index.js",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"*.md",
"lib",
"esm",
"dist",
"src"
],
"authors": [
Expand All @@ -19,10 +19,8 @@
"bugs": "https://github.com/marmelab/react-admin/issues",
"license": "MIT",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"query-string": "^5.1.1"
Expand Down
14 changes: 6 additions & 8 deletions packages/ra-i18n-polyglot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "ra-i18n-polyglot",
"version": "4.0.0-alpha.0",
"description": "Polyglot i18n provider for react-admin",
"main": "lib/index.js",
"module": "esm/index.js",
"main": "dist/index",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"*.md",
"lib",
"esm",
"dist",
"src"
],
"authors": [
Expand All @@ -19,10 +19,8 @@
"bugs": "https://github.com/marmelab/react-admin/issues",
"license": "MIT",
"scripts": {
"build": "yarn run build-cjs && yarn run build-esm",
"build-cjs": "rimraf ./lib && tsc",
"build-esm": "rimraf ./esm && tsc --outDir esm --module es2015",
"watch": "tsc --outDir esm --module es2015 --watch"
"build": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output",
"watch": "tsup src/index.ts --clean --format cjs,esm --minify --keep-names --metafile --sourcemap --dts --legacy-output --watch"
},
"dependencies": {
"node-polyglot": "^2.2.2",
Expand Down
Loading