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

Named exports in umd builds #2141

Merged
merged 28 commits into from
Mar 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6371195
dependencies for libraries
talves Mar 5, 2019
b08cca7
default named exports
talves Mar 5, 2019
d0e311b
restructure base webpack.config
talves Mar 5, 2019
b673f0b
move aliases to root babel
talves Mar 5, 2019
3e80aa3
default exports library for peers
talves Mar 5, 2019
380bc73
main build (netlify-cms) uses new default exports
talves Mar 5, 2019
1e3f931
use main babel.config for tests
talves Mar 5, 2019
7c4a4d3
named exports with global name
talves Mar 5, 2019
2ac0c39
formatting 🦋
talves Mar 5, 2019
9400985
missing exports
talves Mar 6, 2019
4a10043
resolve control in test
talves Mar 6, 2019
47b4dc4
export missing exports
talves Mar 6, 2019
a613878
remove named exports
talves Mar 6, 2019
7ba2c86
Merge branch 'netlify/master' into named-exports
talves Mar 7, 2019
8009e26
Merge branch 'netlify/master' into named-exports (v2.6.0)
talves Mar 8, 2019
98564bb
Merge branch 'netlify/master' into names-exports-next
talves Mar 15, 2019
1e2a042
revert changes
talves Mar 15, 2019
f130c25
align version
talves Mar 15, 2019
a8a6f95
Merge branch 'netlify/master' into names-exports-next
talves Mar 15, 2019
a1c5bb0
monorepo versions
talves Mar 15, 2019
25d3ccf
react hot only on dev builds
talves Mar 15, 2019
e14f00a
remove umd dir build for now
talves Mar 15, 2019
a1f2869
fix peer deps
talves Mar 16, 2019
c49ea5c
missing dependency
talves Mar 16, 2019
519f944
fix default exports
talves Mar 16, 2019
dba1665
fix for controlComponent name change
talves Mar 16, 2019
3041382
format
talves Mar 16, 2019
c9a9aea
fix import names
talves Mar 16, 2019
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
20 changes: 20 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require('path');
const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';

Expand Down Expand Up @@ -29,6 +30,24 @@ const plugins = () => {
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-default-from',
[
'module-resolver',
{
root: path.join(__dirname, 'packages/netlify-cms-core/src/components'),
alias: {
coreSrc: path.join(__dirname, 'packages/netlify-cms-core/src'),
Actions: path.join(__dirname, 'packages/netlify-cms-core/src/actions/'),
Constants: path.join(__dirname, 'packages/netlify-cms-core/src/constants/'),
Formats: path.join(__dirname, 'packages/netlify-cms-core/src/formats/'),
Integrations: path.join(__dirname, 'packages/netlify-cms-core/src/integrations/'),
Lib: path.join(__dirname, 'packages/netlify-cms-core/src/lib/'),
Reducers: path.join(__dirname, 'packages/netlify-cms-core/src/reducers/'),
Redux: path.join(__dirname, 'packages/netlify-cms-core/src/redux/'),
Routing: path.join(__dirname, 'packages/netlify-cms-core/src/routing/'),
ValueObjects: path.join(__dirname, 'packages/netlify-cms-core/src/valueObjects/'),
},
},
],
];

if (isProduction) {
Expand Down Expand Up @@ -65,6 +84,7 @@ const plugins = () => {
];
}

defaultPlugins.push('react-hot-loader/babel');
return [
...defaultPlugins,
[
Expand Down
2 changes: 1 addition & 1 deletion custom-preprocessor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const babelJest = require('babel-jest');
const babelConfig = require('./packages/netlify-cms-core/babel.config.js');
const babelConfig = require('./babel.config.js');

module.exports = babelJest.createTransformer(babelConfig);
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"cache-me-outside": "^0.0.4",
"cross-env": "^5.1.4",
"copy-webpack-plugin": "^5.0.1",
"cross-env": "^5.2.0",
"css-loader": "^2.1.1",
"cypress": "^3.1.5",
"dom-testing-library": "^3.17.1",
"eslint": "^5.15.1",
Expand All @@ -92,18 +94,24 @@
"http-server": "^0.11.1",
"jest": "^24.5.0",
"jest-cli": "^24.5.0",
"jest-dom": "^3.1.3",
"jest-emotion": "^10.0.9",
"lerna": "^3.13.1",
"npm-run-all": "^4.1.5",
"prettier": "1.16.4",
"react-test-renderer": "^16.8.4",
"react-testing-library": "^6.0.0",
"rimraf": "^2.6.3",
"start-server-and-test": "^1.7.11",
"stylelint": "^9.10.1",
"stylelint-config-recommended": "^2.1.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.5.2",
"svg-inline-loader": "^0.8.0"
"svg-inline-loader": "^0.8.0",
"to-string-loader": "^1.1.5",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1"
},
"workspaces": [
"packages/*"
Expand Down
17 changes: 6 additions & 11 deletions packages/netlify-cms-backend-bitbucket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@
"js-base64": "^2.5.1",
"semaphore": "^1.1.0"
},
"devDependencies": {
"cross-env": "^5.2.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",
"@emotion/styled": "^10.0.9",
"immutable": "^3.7.6",
"lodash": "^4.17.10",
"netlify-cms-lib-auth": "^2.0.4",
"netlify-cms-lib-util": "^2.1.0",
"netlify-cms-ui-default": "^2.0.6",
"prop-types": "^15.6.2",
"react": "^16.4.1"
"lodash": "^4.17.11",
"netlify-cms-lib-auth": "^2.0.6-beta.0",
"netlify-cms-lib-util": "^2.1.3-beta.0",
"netlify-cms-ui-default": "^2.4.1-beta.0",
"prop-types": "^15.7.2",
"react": "^16.8.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import API from './API';
const MAX_CONCURRENT_DOWNLOADS = 10;

// Implementation wrapper class
export default class Bitbucket {
export default class BitbucketBackend {
constructor(config, options = {}) {
this.config = config;
this.options = {
Expand Down
13 changes: 10 additions & 3 deletions packages/netlify-cms-backend-bitbucket/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export BitbucketBackend from './implementation';
export API from './API';
export AuthenticationPage from './AuthenticationPage';
import Control from './implementation';
import API from './API';
import AuthenticationPage from './AuthenticationPage';

export const NetlifyCmsBackendBitbucket = {
Control,
API,
AuthenticationPage,
};
export { Control, API, AuthenticationPage };
23 changes: 9 additions & 14 deletions packages/netlify-cms-backend-git-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,18 @@
"jwt-decode": "^2.2.0",
"minimatch": "^3.0.4"
},
"devDependencies": {
"cross-env": "^5.2.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",
"@emotion/styled": "^10.0.9",
"immutable": "^3.7.6",
"lodash": "^4.17.10",
"netlify-cms-backend-bitbucket": "^2.0.0",
"netlify-cms-backend-github": "^2.0.0",
"netlify-cms-backend-gitlab": "^2.0.0",
"netlify-cms-lib-auth": "^2.0.0",
"netlify-cms-lib-util": "^2.0.0",
"netlify-cms-ui-default": "^2.0.0",
"prop-types": "^15.6.2",
"react": "^16.4.1"
"lodash": "^4.17.11",
"netlify-cms-backend-bitbucket": "^2.1.3-beta.0",
"netlify-cms-backend-github": "^2.2.3-beta.0",
"netlify-cms-backend-gitlab": "^2.1.4-beta.0",
"netlify-cms-lib-auth": "^2.0.6-beta.0",
"netlify-cms-lib-util": "^2.1.3-beta.0",
"netlify-cms-ui-default": "^2.4.1-beta.0",
"prop-types": "^15.7.2",
"react": "^16.8.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ini from 'ini';
import { APIError, getBlobSHA, unsentRequest } from 'netlify-cms-lib-util';
import { GitHubBackend } from 'netlify-cms-backend-github';
import { GitLabBackend } from 'netlify-cms-backend-gitlab';
import { BitBucketBackend, API as BitBucketAPI } from 'netlify-cms-backend-bitbucket';
import { BitbucketBackend, API as BitBucketAPI } from 'netlify-cms-backend-bitbucket';
import GitHubAPI from './GitHubAPI';
import GitLabAPI from './GitLabAPI';
import AuthenticationPage from './AuthenticationPage';
Expand Down Expand Up @@ -168,7 +168,7 @@ export default class GitGateway {
requestFunction: this.requestFunction,
hasWriteAccess: async () => true,
});
this.backend = new BitBucketBackend(this.config, { ...this.options, API: this.api });
this.backend = new BitbucketBackend(this.config, { ...this.options, API: this.api });
}

if (!(await this.api.hasWriteAccess())) {
Expand Down
10 changes: 8 additions & 2 deletions packages/netlify-cms-backend-git-gateway/src/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
export GitGatewayBackend from './implementation';
export AuthenticationPage from './AuthenticationPage';
import Control from './implementation';
import AuthenticationPage from './AuthenticationPage';

export const NetlifyCmsBackendGitGateway = {
Control,
AuthenticationPage,
};
export { Control, AuthenticationPage };
17 changes: 6 additions & 11 deletions packages/netlify-cms-backend-github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,14 @@
"js-base64": "^2.5.1",
"semaphore": "^1.1.0"
},
"devDependencies": {
"cross-env": "^5.2.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",
"@emotion/styled": "^10.0.9",
"lodash": "^4.17.10",
"netlify-cms-lib-auth": "^2.0.0",
"netlify-cms-lib-util": "^2.0.0",
"netlify-cms-ui-default": "^2.0.0",
"prop-types": "^15.6.2",
"react": "^16.4.1"
"lodash": "^4.17.11",
"netlify-cms-lib-auth": "^2.0.6-beta.0",
"netlify-cms-lib-util": "^2.1.3-beta.0",
"netlify-cms-ui-default": "^2.4.1-beta.0",
"prop-types": "^15.7.2",
"react": "^16.8.4"
}
}
13 changes: 10 additions & 3 deletions packages/netlify-cms-backend-github/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export GitHubBackend from './implementation';
export API from './API';
export AuthenticationPage from './AuthenticationPage';
import Control from './implementation';
import API from './API';
import AuthenticationPage from './AuthenticationPage';

export const NetlifyCmsBackendGithub = {
Control,
API,
AuthenticationPage,
};
export { Control, API, AuthenticationPage };
17 changes: 6 additions & 11 deletions packages/netlify-cms-backend-gitlab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@
"js-base64": "^2.5.1",
"semaphore": "^1.1.0"
},
"devDependencies": {
"cross-env": "^5.2.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",
"@emotion/styled": "^10.0.9",
"immutable": "^3.7.6",
"lodash": "^4.17.10",
"netlify-cms-lib-auth": "^2.0.0",
"netlify-cms-lib-util": "^2.0.0",
"netlify-cms-ui-default": "^2.0.0",
"prop-types": "^15.6.2",
"react": "^16.4.1"
"lodash": "^4.17.11",
"netlify-cms-lib-auth": "^2.0.6-beta.0",
"netlify-cms-lib-util": "^2.1.3-beta.0",
"netlify-cms-ui-default": "^2.4.1-beta.0",
"prop-types": "^15.7.2",
"react": "^16.8.4"
}
}
13 changes: 10 additions & 3 deletions packages/netlify-cms-backend-gitlab/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export GitLabBackend from './implementation';
export API from './API';
export AuthenticationPage from './AuthenticationPage';
import Control from './implementation';
import API from './API';
import AuthenticationPage from './AuthenticationPage';

export const NetlifyCmsBackendGitlab = {
Control,
API,
AuthenticationPage,
};
export { Control, API, AuthenticationPage };
21 changes: 7 additions & 14 deletions packages/netlify-cms-backend-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
},
"dependencies": {
"uuid": "^3.3.2"
},
"devDependencies": {
"cross-env": "^5.2.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",
"@emotion/styled": "^10.0.9",
"immutable": "^3.8.2",
"lodash": "^4.17.10",
"netlify-cms-lib-util": "^2.0.0",
"netlify-cms-ui-default": "^2.0.0",
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-immutable-proptypes": "^2.1.0"
"lodash": "^4.17.11",
"netlify-cms-lib-util": "^2.1.3-beta.0",
"netlify-cms-ui-default": "^2.4.1-beta.0",
"prop-types": "^15.7.2",
"react": "^16.8.4",
"react-immutable-proptypes": "^2.1.0",
"uuid": "^3.3.2"
}
}
2 changes: 1 addition & 1 deletion packages/netlify-cms-backend-test/src/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const getFolderEntries = (folder, extension) => {
.reverse();
};

export default class TestRepo {
export default class TestBackend {
constructor(config, options = {}) {
this.config = config;
this.assets = [];
Expand Down
10 changes: 8 additions & 2 deletions packages/netlify-cms-backend-test/src/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
export TestBackend from './implementation';
export AuthenticationPage from './AuthenticationPage';
import Control from './implementation';
import AuthenticationPage from './AuthenticationPage';

export const NetlifyCmsBackendTest = {
Control,
AuthenticationPage,
};
export { Control, AuthenticationPage };
28 changes: 0 additions & 28 deletions packages/netlify-cms-core/babel.config.js

This file was deleted.

Loading