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

React-admin 3 #263

Merged
merged 7 commits into from
Jan 13, 2020
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
11 changes: 5 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from"
],
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-react"
Expand Down
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it normal that you commit this file? It feels user based, not project based.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fzaninotto The whole purpose of this file is to define common options for files' formatting, so everyone working on the project can (with support from IDEs) enforce the same configuration without any manual work. With this you won't get unintentional whitespace diffs. It should be commited to work.

The question is: do project maintainers want this file and current configuration fits project's standards?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me (we have it on every other API Platform projects).


[*]
end_of_line = LF
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
indent_style = space
charset = utf-8
indent_size = 2
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {

parser: 'babel-eslint',

plugins: ['import', 'jsx-a11y', 'react', 'prettier'],
plugins: ['markdown', 'import', 'jsx-a11y', 'react', 'prettier'],

extends: ['prettier', 'prettier/react'],

Expand Down Expand Up @@ -228,7 +228,6 @@ module.exports = {
{
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,
jsxBracketSameLine: true,
},
],
Expand Down
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
language: node_js

node_js:
- '10'
- '11'
- 'lts/*'

cache:
directories:
- node_modules
cache: yarn

script:
- yarn build
- yarn test
- yarn lint
- yarn build
- yarn test
- yarn lint

deploy:
provider: npm
email: $NPM_AUTH_EMAIL
api_key: $NPM_AUTH_TOKEN
on:
tags: true
node_js: '11'
node_js: 'lts/*'
skip_cleanup: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT license

Copyright (c) 2017 Kévin Dunglas
Copyright (c) 2020 Kévin Dunglas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,29 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { HydraAdmin } from '@api-platform/admin';

const Admin = () => <HydraAdmin entrypoint="https://demo.api-platform.com"/> // Replace with your own API entrypoint
const Admin = () => <HydraAdmin entrypoint="https://demo.api-platform.com" />; // Replace with your own API entrypoint

ReactDOM.render(<Admin />, document.getElementById('root'));
```

Or alternatively:

```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import {
AdminGuesser,
hydraDataProvider,
hydraSchemaAnalyzer,
} from '@api-platform/admin';

const Admin = () => (
<AdminGuesser
// Use your custom data provider or resource schema analyzer
dataProvider={hydraDataProvider('https://demo.api-platform.com')}
schemaAnalyzer={hydraSchemaAnalyzer()}
/>
);

ReactDOM.render(<Admin />, document.getElementById('root'));
```
Expand Down

This file was deleted.

31 changes: 18 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@api-platform/admin",
"version": "1.0.2",
"version": "2.0.0",
"description": "Automatic administration interface for Hydra-enabled APIs.",
"files": [
"*.md",
Expand All @@ -17,52 +17,57 @@
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.2.3",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
"@babel/preset-env": "^7.2.3",
"@babel/preset-react": "^7.0.0",
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.8.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^6.4.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-markdown": "^1.0.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.1",
"jest": "^24.8.0",
"jest-enzyme": "^7.1.0",
"prettier": "^1.15.3",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-redux": "~5.0.7",
"react-test-renderer": "^16.8.6"
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-redux": "^7.1.0",
"react-test-renderer": "^16.9.0",
"redux": "^3.7.2 || ^4.0.3"
},
"peerDependencies": {
"react": "~16.0.0 || ~16.1.0 || ~16.2.0 || ~16.3.0 || ~16.4.0",
"react-dom": "~16.0.0 || ~16.1.0 || ~16.2.0 || ~16.3.0 || ~16.4.0"
"react": "^16.9.0",
"react-dom": "^16.9.0"
},
"scripts": {
"build": "babel src -d lib --ignore '*.test.js'",
"eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"fix": "eslint --fix src",
"lint": "eslint src",
"fix": "eslint --ignore-pattern 'lib/*' --ext .js,.md --fix .",
"lint": "eslint --ignore-pattern 'lib/*' --ext .js,.md .",
"test": "jest src",
"test:watch": "jest --watch src",
"watch": "babel src -d lib --ignore '*.test.js' --watch"
},
"jest": {
"setupFilesAfterEnv": [
"./src/setupTests.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/lib/"
]
},
"dependencies": {
"@api-platform/api-doc-parser": "^0.8.1",
"history": "^4.7.2",
"jsonld": "^1.2.1",
"lodash.isplainobject": "^4.0.6",
"prop-types": "^15.6.2",
"react-admin": "^2.9.0"
"react-admin": "^3.0.0"
}
}
Loading