feat: add ES module builds (#2215)

This commit is contained in:
Tony Alves 2019-03-22 08:24:46 -07:00 committed by Shawn Erquhart
parent 7672f2ae27
commit d142b32345
38 changed files with 211 additions and 77 deletions

View File

@ -1,6 +1,9 @@
const path = require('path');
const version = require('./packages/netlify-cms/package.json').version;
const coreVersion = require('./packages/netlify-cms-core/package.json').version;
const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const isESM = process.env.NODE_ENV === 'esm';
const presets = () => {
if (isTest) {
@ -32,23 +35,48 @@ const plugins = () => {
'@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/'),
ReduxStore: 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/'),
redux: 'redux',
localforage: 'localforage',
},
},
isESM
? {
root: ['./src'],
alias: {
coreSrc: './src',
Actions: './src/actions',
App: './src/components/App',
Collection: './src/components/Collection',
Constants: './src/constants',
Editor: './src/components/Editor',
EditorWidgets: './src/components/EditorWidgets',
Formats: './src/formats',
Integrations: './src/integrations',
Lib: './src/lib',
MediaLibrary: './src/components/MediaLibrary',
Reducers: './src/reducers',
ReduxStore: './src/redux',
Routing: './src/routing',
UI: './src/components/UI',
Workflow: './src/components/Workflow',
ValueObjects: './src/valueObjects',
localforage: 'localforage',
redux: 'redux',
},
}
: {
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/'),
ReduxStore: 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/'),
localforage: 'localforage',
redux: 'redux',
},
},
],
];
@ -65,6 +93,34 @@ const plugins = () => {
];
}
if (isESM) {
return [
...defaultPlugins,
[
'transform-define',
{
NETLIFY_CMS_VERSION: `${version}`,
NETLIFY_CMS_CORE_VERSION: `${coreVersion}`,
},
],
[
'emotion',
{
hoist: true,
autoLabel: true,
},
],
[
'inline-svg',
{
svgo: {
plugins: [{ removeViewBox: false }],
},
},
],
];
}
if (isTest) {
return [
...defaultPlugins,

View File

@ -4,8 +4,9 @@
"start": "run-s bootstrap develop",
"watch": "lerna run watch --parallel",
"develop": "lerna run develop --parallel",
"build": "run-s clean build:lerna",
"build": "run-s clean build:esm build:lerna",
"build:lerna": "lerna run build",
"build:esm": "lerna run build:esm",
"build-preview": "run-s build build-preview:lerna",
"build-preview:lerna": "lerna run build-preview",
"clean": "rimraf packages/*/dist dev-test/*.js",
@ -82,6 +83,7 @@
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-module-resolver": "^3.2.0",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"babel-plugin-transform-define": "1.3.1",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"cache-me-outside": "^0.0.4",

View File

@ -4,6 +4,7 @@
"version": "2.2.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-backend-bitbucket",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-backend-bitbucket.js",
"license": "MIT",
"keywords": [
@ -16,7 +17,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"js-base64": "^2.5.1",

View File

@ -4,6 +4,7 @@
"version": "2.3.1-beta.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-backend-git-gateway",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-backend-git-gateway.js",
"license": "MIT",
"keywords": [
@ -17,7 +18,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"gotrue-js": "^0.9.24",

View File

@ -5,6 +5,7 @@
"license": "MIT",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-backend-github",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-backend-github.js",
"keywords": [
"netlify",
@ -16,7 +17,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"common-tags": "^1.8.0",

View File

@ -5,6 +5,7 @@
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-backend-gitlab",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"license": "MIT",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-backend-gitlab.js",
"keywords": [
"netlify",
@ -16,7 +17,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"js-base64": "^2.5.1",

View File

@ -5,6 +5,7 @@
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-backend-test",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"license": "MIT",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-backend-test.js",
"keywords": [
"netlify",
@ -15,7 +16,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",

View File

@ -4,13 +4,15 @@
"version": "2.9.1-beta.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-core",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-core.js",
"files": [
"src/",
"dist/"
],
"scripts": {
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"keywords": [
"netlify",

View File

@ -23,9 +23,7 @@ function bootstrap(opts = {}) {
/**
* Log the version number.
*/
if (NETLIFY_CMS_VERSION) {
console.log(`netlify-cms ${NETLIFY_CMS_VERSION}`);
} else if (NETLIFY_CMS_CORE_VERSION) {
if (typeof NETLIFY_CMS_CORE_VERSION === 'string') {
console.log(`netlify-cms-core ${NETLIFY_CMS_CORE_VERSION}`);
}

View File

@ -4,6 +4,7 @@
"description": "NetlifyCMS default exports",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-default-exports",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-editor-component-image.js",
"license": "MIT",
"keywords": [
@ -17,7 +18,7 @@
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack",
"build:dev": "cross-env NODE_ENV=development webpack"
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"@emotion/core": "^10.0.9",

View File

@ -4,6 +4,7 @@
"version": "2.3.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-editor-component-image",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-editor-component-image.js",
"license": "MIT",
"keywords": [
@ -16,7 +17,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"devDependencies": {
"cross-env": "^5.2.0",

View File

@ -4,6 +4,7 @@
"version": "2.1.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-lib-auth",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-lib-auth.js",
"license": "MIT",
"files": [
@ -17,7 +18,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"immutable": "^3.7.6",

View File

@ -4,6 +4,7 @@
"version": "2.2.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-lib-util",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-lib-util.js",
"license": "MIT",
"keywords": [
@ -13,7 +14,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"js-sha256": "^0.9.0",

View File

@ -4,6 +4,7 @@
"version": "1.2.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-media-library-cloudinary",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-media-library-cloudinary.js",
"license": "MIT",
"keywords": [
@ -21,7 +22,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"netlify-cms-lib-util": "^2.1.3-beta.0"

View File

@ -4,6 +4,7 @@
"version": "0.4.0",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-media-library-uploadcare",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-media-library-uploadcare.js",
"license": "MIT",
"keywords": [
@ -19,7 +20,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"uploadcare-widget": "^3.7.0",

View File

@ -5,6 +5,7 @@
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-ui-default",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"license": "MIT",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-ui-default.js",
"keywords": [
"netlify-cms"
@ -13,7 +14,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"react-aria-menubutton": "^6.0.0",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#boolean",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-boolean",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-boolean.js",
"license": "MIT",
"keywords": [
@ -17,7 +18,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#date",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-date",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-date.js",
"license": "MIT",
"keywords": [
@ -18,7 +19,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"react-datetime": "^2.16.3"

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#datetime",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-datetime",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-datetime.js",
"license": "MIT",
"keywords": [
@ -19,7 +20,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#file",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-file",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-file.js",
"license": "MIT",
"keywords": [
@ -19,7 +20,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"common-tags": "^1.8.0"

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#image",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-image",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-image.js",
"license": "MIT",
"keywords": [
@ -19,7 +20,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#list",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-list",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-list.js",
"license": "MIT",
"keywords": [
@ -18,7 +19,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"react-sortable-hoc": "^1.0.0"

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#map",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-map",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-map.js",
"license": "MIT",
"keywords": [
@ -18,7 +19,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#markdown",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-markdown",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-markdown.js",
"license": "MIT",
"keywords": [
@ -18,7 +19,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"is-hotkey": "^0.1.4",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#number",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-number",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-number.js",
"license": "MIT",
"keywords": [
@ -17,7 +18,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"netlify-cms-ui-default": "^2.4.1-beta.0",

View File

@ -1,7 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ValidationErrorTypes from 'netlify-cms-core/src/constants/validationErrorTypes';
const ValidationErrorTypes = {
PRESENCE: 'PRESENCE',
PATTERN: 'PATTERN',
RANGE: 'RANGE',
CUSTOM: 'CUSTOM',
};
export default class NumberControl extends React.Component {
static propTypes = {

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#object",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-object",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-object.js",
"license": "MIT",
"keywords": [
@ -19,7 +20,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"@emotion/core": "^10.0.9",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#relation",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-relation",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-relation.js",
"license": "MIT",
"keywords": [
@ -18,7 +19,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"react-select": "^2.4.2"

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#select",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-select",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-select.js",
"license": "MIT",
"keywords": [
@ -19,7 +20,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"immutable": "^3.7.6",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#string",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-string",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-string.js",
"license": "MIT",
"keywords": [
@ -17,7 +18,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"peerDependencies": {
"netlify-cms-ui-default": "^2.4.1-beta.0",

View File

@ -5,6 +5,7 @@
"homepage": "https://www.netlifycms.org/docs/widgets/#text",
"repository": "https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-widget-text",
"bugs": "https://github.com/netlify/netlify-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/netlify-cms-widget-text.js",
"license": "MIT",
"keywords": [
@ -20,7 +21,8 @@
"scripts": {
"watch": "webpack -w",
"develop": "npm run watch",
"build": "cross-env NODE_ENV=production webpack"
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore src/**/__tests__/* --root-mode upward"
},
"dependencies": {
"react-textarea-autosize": "^7.1.0"

View File

@ -1,9 +1,9 @@
import { registerBackend } from 'netlify-cms-core/src';
import { GitHubBackend } from 'netlify-cms-backend-github/src';
import { GitLabBackend } from 'netlify-cms-backend-gitlab/src';
import { GitGatewayBackend } from 'netlify-cms-backend-git-gateway/src';
import { BitbucketBackend } from 'netlify-cms-backend-bitbucket/src';
import { TestBackend } from 'netlify-cms-backend-test/src';
import { registerBackend } from 'netlify-cms-core';
import { GitHubBackend } from 'netlify-cms-backend-github';
import { GitLabBackend } from 'netlify-cms-backend-gitlab';
import { GitGatewayBackend } from 'netlify-cms-backend-git-gateway';
import { BitbucketBackend } from 'netlify-cms-backend-bitbucket';
import { TestBackend } from 'netlify-cms-backend-test';
registerBackend('git-gateway', GitGatewayBackend);
registerBackend('github', GitHubBackend);

View File

@ -1,4 +1,4 @@
import { registerEditorComponent } from 'netlify-cms-core/src';
import image from 'netlify-cms-editor-component-image/src';
import { registerEditorComponent } from 'netlify-cms-core';
import image from 'netlify-cms-editor-component-image';
registerEditorComponent(image);

View File

@ -1,6 +1,6 @@
import createReactClass from 'create-react-class';
import React from 'react';
import * as CMS from 'netlify-cms-core/src';
import * as CMS from 'netlify-cms-core';
import './backends';
import './widgets';
import './editor-components';
@ -23,6 +23,12 @@ if (typeof window !== 'undefined') {
window.initCMS = CMS.init;
window.createClass = window.createClass || createReactClass;
window.h = window.h || React.createElement;
/**
* Log the version number.
*/
if (typeof NETLIFY_CMS_VERSION === 'string') {
console.log(`netlify-cms ${NETLIFY_CMS_VERSION}`);
}
}
export const NetlifyCms = CMS;

View File

@ -1,6 +1,6 @@
import { registerMediaLibrary } from 'netlify-cms-core/src';
import uploadcare from 'netlify-cms-media-library-uploadcare/src';
import cloudinary from 'netlify-cms-media-library-cloudinary/src';
import { registerMediaLibrary } from 'netlify-cms-core';
import uploadcare from 'netlify-cms-media-library-uploadcare';
import cloudinary from 'netlify-cms-media-library-cloudinary';
registerMediaLibrary(uploadcare);
registerMediaLibrary(cloudinary);

View File

@ -1,18 +1,18 @@
import { registerWidget } from 'netlify-cms-core/src';
import * as NetlifyCmsWidgetString from 'netlify-cms-widget-string/src';
import * as NetlifyCmsWidgetNumber from 'netlify-cms-widget-number/src';
import * as NetlifyCmsWidgetText from 'netlify-cms-widget-text/src';
import * as NetlifyCmsWidgetImage from 'netlify-cms-widget-image/src';
import * as NetlifyCmsWidgetFile from 'netlify-cms-widget-file/src';
import * as NetlifyCmsWidgetSelect from 'netlify-cms-widget-select/src';
import * as NetlifyCmsWidgetMarkdown from 'netlify-cms-widget-markdown/src';
import * as NetlifyCmsWidgetList from 'netlify-cms-widget-list/src';
import * as NetlifyCmsWidgetObject from 'netlify-cms-widget-object/src';
import * as NetlifyCmsWidgetRelation from 'netlify-cms-widget-relation/src';
import * as NetlifyCmsWidgetBoolean from 'netlify-cms-widget-boolean/src';
import * as NetlifyCmsWidgetMap from 'netlify-cms-widget-map/src';
import DateWidget from 'netlify-cms-widget-date/src';
import DateTimeWidget from 'netlify-cms-widget-datetime/src';
import { registerWidget } from 'netlify-cms-core';
import * as NetlifyCmsWidgetString from 'netlify-cms-widget-string';
import * as NetlifyCmsWidgetNumber from 'netlify-cms-widget-number';
import * as NetlifyCmsWidgetText from 'netlify-cms-widget-text';
import * as NetlifyCmsWidgetImage from 'netlify-cms-widget-image';
import * as NetlifyCmsWidgetFile from 'netlify-cms-widget-file';
import * as NetlifyCmsWidgetSelect from 'netlify-cms-widget-select';
import * as NetlifyCmsWidgetMarkdown from 'netlify-cms-widget-markdown';
import * as NetlifyCmsWidgetList from 'netlify-cms-widget-list';
import * as NetlifyCmsWidgetObject from 'netlify-cms-widget-object';
import * as NetlifyCmsWidgetRelation from 'netlify-cms-widget-relation';
import * as NetlifyCmsWidgetBoolean from 'netlify-cms-widget-boolean';
import * as NetlifyCmsWidgetMap from 'netlify-cms-widget-map';
import DateWidget from 'netlify-cms-widget-date';
import DateTimeWidget from 'netlify-cms-widget-datetime';
registerWidget(
'string',

View File

@ -13,7 +13,8 @@ const rules = () => ({
use: {
loader: 'babel-loader',
options: {
configFile: path.resolve(`${__dirname}/../babel.config.js`),
rootMode: 'upward',
// configFile: path.resolve(`${__dirname}/../babel.config.js`),
},
},
}),

View File

@ -2741,6 +2741,14 @@ babel-plugin-transform-builtin-extend@^1.1.2:
babel-runtime "^6.2.0"
babel-template "^6.3.0"
babel-plugin-transform-define@1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-define/-/babel-plugin-transform-define-1.3.1.tgz#b21b7bad3b84cf8e3f07cdc8c660b99cbbc01213"
integrity sha512-JXZ1xE9jIbKCGYZ4wbSMPSI5mdS4DRLi5+SkTHgZqWn5YIf/EucykkzUsPmzJlpkX8fsMVdLnA5vt/LvT97Zbg==
dependencies:
lodash "^4.17.11"
traverse "0.6.6"
babel-plugin-transform-export-extensions@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653"
@ -12397,6 +12405,11 @@ tr46@^1.0.1:
dependencies:
punycode "^2.1.0"
traverse@0.6.6:
version "0.6.6"
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137"
integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=
trim-lines@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.1.tgz#da738ff58fa74817588455e30b11b85289f2a396"