begin scaffolding for lerna

This commit is contained in:
Shawn Erquhart 2018-07-03 15:47:15 -04:00
parent 26f7c38a9f
commit 768fcbaa1d
320 changed files with 50292 additions and 464 deletions

View File

@ -1,19 +1,9 @@
{
"presets": [
"react",
["env", {
"modules": false
}]
"env",
],
"plugins": [
"lodash",
["babel-plugin-transform-builtin-extend", {
"globals": ["Error"]
}],
["transform-runtime", {
"useBuiltIns": true,
"useESModules": true
}],
["module-resolver", {
"root": [
"./src/components"
@ -31,14 +21,9 @@
"ValueObjects": "./src/valueObjects/",
}
}],
"transform-export-extensions",
"transform-class-properties",
"transform-object-rest-spread",
"react-hot-loader/babel",
"inline-svg",
["inline-import", {
"extensions": ["yml"],
}],
],
"env": {
"test": {
"plugins": ["transform-es2015-modules-commonjs"]
}
}
}

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ manifest.yml
.imdone/
website/data/contributors.json
/coverage/
.cache

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

9
lerna.json Normal file
View File

@ -0,0 +1,9 @@
{
"lerna": "2.11.0",
"packages": [
"packages/*"
],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}

View File

@ -3,25 +3,6 @@
"version": "2.0.0-dev",
"description": "Netlify CMS lets content editors work on structured content stored in git",
"main": "dist/cms.js",
"scripts": {
"start": "npm run dev",
"dev": "webpack-dev-server --env.development",
"dev:write": "webpack-dev-server --env.development --env.write",
"test": "jest --coverage",
"test:watch": "jest --watch",
"build": "cross-env NODE_ENV=production webpack-cli --display-error-details --env.production",
"add-contributor": "all-contributors add",
"generate-contributors": "all-contributors generate",
"lint": "npm run lint:js & npm run lint:css",
"lint:js": "eslint .",
"lint:js:fix": "npm run lint:js -- --fix",
"lint:css": "stylelint 'src/**/*.css'",
"lint:css:fix": "stylefmt --recursive src/",
"lint:staged": "lint-staged",
"deps": "npm-check -s",
"deps:update": "npm-check -u",
"prepublishOnly": "npm run build"
},
"lint-staged": {
"*.js": [
"eslint --fix",
@ -72,22 +53,12 @@
],
"devDependencies": {
"all-contributors-cli": "^4.4.0",
"babel": "^6.5.2",
"babel-cli": "^6.18.0",
"babel-core": "^6.23.1",
"babel-jest": "^22.0.0",
"babel-loader": "^7.1.4",
"babel-plugin-lodash": "^3.2.0",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-inline-svg": "^1.0.0",
"babel-plugin-module-resolver": "^3.0.0",
"babel-plugin-transform-builtin-extend": "^1.1.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.23.0",
"babel-runtime": "^6.23.0",
"cross-env": "^5.1.4",
"css-loader": "^0.28.11",
"cssnano": "^v4.0.0-rc.2",
@ -103,9 +74,11 @@
"imports-loader": "^0.8.0",
"jest": "^22.0.0",
"jest-cli": "^22.0.0",
"lerna": "^2.11.0",
"lint-staged": "^3.3.1",
"mini-css-extract-plugin": "^0.4.0",
"npm-check": "^5.2.3",
"parcel-plugin-inlinesvg": "^0.0.14",
"postcss-cssnext": "^3.0.2",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.1.3",
@ -124,76 +97,8 @@
"webpack-dev-server": "^3.1.3",
"write-file-webpack-plugin": "^4.2.0"
},
"dependencies": {
"classnames": "^2.2.5",
"create-react-class": "^15.6.0",
"diacritics": "^1.3.0",
"fuzzy": "^0.1.1",
"gotrue-js": "^0.9.15",
"gray-matter": "^3.0.6",
"history": "^4.7.2",
"immutable": "^3.7.6",
"is-hotkey": "^0.1.1",
"js-base64": "^2.1.9",
"js-yaml": "^3.10.0",
"jwt-decode": "^2.1.0",
"localforage": "^1.4.2",
"lodash": "^4.13.1",
"mdast-util-definitions": "^1.2.2",
"mdast-util-to-string": "^1.0.4",
"moment": "^2.11.2",
"prop-types": "^15.5.10",
"react": "^16.0.0",
"react-aria-menubutton": "^5.1.0",
"react-autosuggest": "^9.3.2",
"react-datetime": "^2.11.0",
"react-dnd": "^2.5.4",
"react-dnd-html5-backend": "^2.5.4",
"react-dom": "^16.0.0",
"react-frame-component": "^2.0.0",
"react-hot-loader": "^4.0.0",
"react-immutable-proptypes": "^2.1.0",
"react-is": "16.3.1",
"react-modal": "^3.1.5",
"react-redux": "^4.4.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.8",
"react-scroll-sync": "^0.4.0",
"react-sortable-hoc": "^0.6.8",
"react-split-pane": "^0.1.66",
"react-textarea-autosize": "^5.2.0",
"react-toggled": "^1.1.2",
"react-topbar-progress-indicator": "^2.0.0",
"react-transition-group": "^2.2.1",
"react-waypoint": "^7.1.0",
"redux": "^3.3.1",
"redux-notifications": "^4.0.1",
"redux-optimist": "^0.0.2",
"redux-thunk": "^1.0.3",
"rehype-parse": "^3.1.0",
"rehype-remark": "^2.0.0",
"rehype-stringify": "^3.0.0",
"remark-parse": "^3.0.1",
"remark-rehype": "^2.0.0",
"remark-stringify": "^3.0.1",
"sanitize-filename": "^1.6.1",
"semaphore": "^1.0.5",
"slate": "^0.30.0",
"slate-edit-list": "^0.10.1",
"slate-edit-table": "^0.12.0",
"slate-plain-serializer": "^0.4.0",
"slate-react": "0.10.11",
"slate-soft-break": "^0.6.0",
"toml-j0.4": "^1.1.1",
"tomlify-j0.4": "^3.0.0-alpha.0",
"unified": "^6.1.4",
"unist-builder": "^1.0.2",
"unist-util-visit-parents": "^1.1.1",
"url": "^0.11.0",
"uuid": "^3.1.0",
"what-input": "^5.0.3"
},
"optionalDependencies": {
"fsevents": "^1.0.14"
}
"workspaces": [
"packages/*"
],
"private": true
}

View File

Before

Width:  |  Height:  |  Size: 808 KiB

After

Width:  |  Height:  |  Size: 808 KiB

View File

@ -6,15 +6,14 @@
<title>This is an example</title>
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/cms.css"/>
<link rel="stylesheet" href="../src/index.css"/>
<!--
Netlify CMS will automatically look for a "config.yml" file in the same directory
as this "index.html", but you can override this by providing a link tag like this
one:
<link href="path/to/config.yml" type="text/yaml" rel="cms-config-url">
-->
Netlify CMS will automatically look for a "config.yml" file in the same
directory as the CMS HTML file (like this one), but you can override this by
providing a link tag like the one below.
-->
<link href="./config.yml" type="text/yaml" rel="cms-config-url">
<script>
window.repoFiles = {
@ -90,7 +89,7 @@
</head>
<body>
<script src='/cms.js'></script>
<script src='../src/index.js'></script>
<script>
var PostPreview = createClass({
render: function() {

View File

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 310 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

27009
packages/netlify-cms-core/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,106 @@
{
"name": "netlify-cms-core",
"description": "Netlify CMS lets content editors work on structured content stored in git",
"version": "2.0.0-alpha.0",
"main": "dist/cms.js",
"lint-staged": {
"*.js": [
"eslint --fix",
"jest --findRelatedTests",
"git add"
]
},
"files": [
"src/",
"dist/"
],
"scripts": {
"start": "npm run dev",
"dev": "parcel example/index.html --open"
},
"keywords": [
"netlify",
"cms",
"content editing",
"static site generators",
"jamstack"
],
"license": "MIT",
"dependencies": {
"classnames": "^2.2.5",
"create-react-class": "^15.6.0",
"diacritics": "^1.3.0",
"fuzzy": "^0.1.1",
"gotrue-js": "^0.9.15",
"gray-matter": "^3.0.6",
"history": "^4.7.2",
"immutable": "^3.7.6",
"is-hotkey": "^0.1.1",
"js-base64": "^2.1.9",
"js-yaml": "^3.10.0",
"jwt-decode": "^2.1.0",
"lib": "^3.0.2",
"localforage": "^1.4.2",
"lodash": "^4.13.1",
"mdast-util-definitions": "^1.2.2",
"mdast-util-to-string": "^1.0.4",
"moment": "^2.11.2",
"netlify-cms-lib-auth": "file:../netlify-cms-lib-auth",
"netlify-cms-lib-util": "file:../netlify-cms-lib-util",
"netlify-cms-ui-default": "file:../netlify-cms-ui-default",
"prop-types": "^15.5.10",
"react": "^16.0.0",
"react-aria-menubutton": "^5.1.0",
"react-autosuggest": "^9.3.2",
"react-datetime": "^2.11.0",
"react-dnd": "^2.5.4",
"react-dnd-html5-backend": "^2.5.4",
"react-dom": "^16.0.0",
"react-frame-component": "^2.0.0",
"react-hot-loader": "^4.0.0",
"react-immutable-proptypes": "^2.1.0",
"react-is": "16.3.1",
"react-modal": "^3.1.5",
"react-redux": "^4.4.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.8",
"react-scroll-sync": "^0.4.0",
"react-sortable-hoc": "^0.6.8",
"react-split-pane": "^0.1.81",
"react-textarea-autosize": "^5.2.0",
"react-toggled": "^1.1.2",
"react-topbar-progress-indicator": "^2.0.0",
"react-transition-group": "^2.2.1",
"react-waypoint": "^7.1.0",
"redux": "^3.3.1",
"redux-notifications": "^4.0.1",
"redux-optimist": "^0.0.2",
"redux-thunk": "^1.0.3",
"rehype-parse": "^3.1.0",
"rehype-remark": "^2.0.0",
"rehype-stringify": "^3.0.0",
"remark-parse": "^3.0.1",
"remark-rehype": "^2.0.0",
"remark-stringify": "^3.0.1",
"sanitize-filename": "^1.6.1",
"semaphore": "^1.0.5",
"slate": "^0.30.0",
"slate-edit-list": "^0.10.1",
"slate-edit-table": "^0.12.0",
"slate-plain-serializer": "^0.4.0",
"slate-react": "0.10.11",
"slate-soft-break": "^0.6.0",
"toml-j0.4": "^1.1.1",
"tomlify-j0.4": "^3.0.0-alpha.0",
"unified": "^6.1.4",
"unist-builder": "^1.0.2",
"unist-util-visit-parents": "^1.1.1",
"url": "^0.11.0",
"uuid": "^3.1.0",
"what-input": "^5.0.3"
},
"devDependencies": {
"cross-env": "^5.2.0",
"parcel-bundler": "^1.9.4"
}
}

View File

@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from "react";
import { partial } from 'lodash';
import { Icon } from 'UI';
import { Icon } from 'netlify-cms-ui-default';
let component = null;

View File

@ -1,6 +1,6 @@
import { flow } from "lodash";
import unsentRequest from "Lib/unsentRequest";
import { then } from "Lib/promiseHelper";
import unsentRequest from "netlify-cms-lib-util/unsentRequest";
import { then } from "netlify-cms-lib-util/promise";
import GitlabAPI from "Backends/gitlab/API";
export default class API extends GitlabAPI {

View File

@ -1,7 +1,7 @@
import LocalForage from "Lib/LocalForage";
import localForage from "netlify-cms-lib-util/localForage";
import { Base64 } from "js-base64";
import { uniq, initial, last, get, find, hasIn } from "lodash";
import { filterPromises, resolvePromiseProperties } from "Lib/promiseHelper";
import { filterPromises, resolvePromiseProperties } from "netlify-cms-lib-util/promise";
import AssetProxy from "ValueObjects/AssetProxy";
import { SIMPLE, EDITORIAL_WORKFLOW, status } from "Constants/publishModes";
import { APIError, EditorialWorkflowError } from "ValueObjects/errors";
@ -132,7 +132,7 @@ export default class API {
.then(changeTree => this.commit(`Updating “${ key }” metadata`, changeTree))
.then(response => this.patchRef("meta", "_netlify_cms", response.sha))
.then(() => {
LocalForage.setItem(`gh.meta.${ key }`, {
localForage.setItem(`gh.meta.${ key }`, {
expires: Date.now() + 300000, // In 5 minutes
data,
});
@ -141,7 +141,7 @@ export default class API {
}
retrieveMetadata(key) {
const cache = LocalForage.getItem(`gh.meta.${ key }`);
const cache = localForage.getItem(`gh.meta.${ key }`);
return cache.then((cached) => {
if (cached && cached.expires > Date.now()) { return cached.data; }
console.log("%c Checking for MetaData files", "line-height: 30px;text-align: center;font-weight: bold"); // eslint-disable-line
@ -176,13 +176,13 @@ export default class API {
}
getBlob(sha) {
return LocalForage.getItem(`gh.${sha}`).then(cached => {
return localForage.getItem(`gh.${sha}`).then(cached => {
if (cached) { return cached; }
return this.request(`${this.repoURL}/git/blobs/${sha}`, {
headers: { Accept: "application/vnd.github.VERSION.raw" },
}).then(result => {
LocalForage.setItem(`gh.${sha}`, result);
localForage.setItem(`gh.${sha}`, result);
return result;
});
});

View File

@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import Authenticator from 'Lib/netlify-auth';
import { Icon } from 'UI';
import Authenticator from 'netlify-cms-lib-auth/netlify-auth';
import { Icon } from 'netlify-cms-ui-default';
export default class AuthenticationPage extends React.Component {
static propTypes = {

View File

@ -1,9 +1,9 @@
import LocalForage from "Lib/LocalForage";
import localForage from "netlify-cms-lib-util/localForage";
import { Base64 } from "js-base64";
import { fromJS, List, Map } from "immutable";
import { cond, flow, isString, partial, partialRight, pick, omit, set, update } from "lodash";
import unsentRequest from "Lib/unsentRequest";
import { then } from "Lib/promiseHelper";
import unsentRequest from "netlify-cms-lib-util/unsentRequest";
import { then } from "netlify-cms-lib-util/promise";
import AssetProxy from "ValueObjects/AssetProxy";
import { APIError } from "ValueObjects/errors";
import Cursor from "ValueObjects/Cursor"
@ -67,14 +67,14 @@ export default class API {
});
readFile = async (path, sha, ref=this.branch) => {
const cachedFile = sha ? await LocalForage.getItem(`gl.${ sha }`) : null;
const cachedFile = sha ? await localForage.getItem(`gl.${ sha }`) : null;
if (cachedFile) { return cachedFile; }
const result = await this.requestText({
url: `${ this.repoURL }/repository/files/${ encodeURIComponent(path) }/raw`,
params: { ref },
cache: "no-store",
});
if (sha) { LocalForage.setItem(`gl.${ sha }`, result) }
if (sha) { localForage.setItem(`gl.${ sha }`, result) }
return result;
};

View File

@ -1,8 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import NetlifyAuthenticator from 'Lib/netlify-auth';
import ImplicitAuthenticator from 'Lib/implicit-oauth';
import { Icon } from 'UI';
import NetlifyAuthenticator from 'netlify-cms-lib-auth/netlify-auth';
import ImplicitAuthenticator from 'netlify-cms-lib-auth/implicit-oauth';
import { Icon } from 'netlify-cms-ui-default';
export default class AuthenticationPage extends React.Component {
static propTypes = {
@ -19,6 +19,7 @@ export default class AuthenticationPage extends React.Component {
base_url: this.props.config.getIn(['backend', 'base_url'], "https://gitlab.com"),
auth_endpoint: this.props.config.getIn(['backend', 'auth_endpoint'], 'oauth/authorize'),
app_id: this.props.config.getIn(['backend', 'app_id']),
clearHash: this.props.clearHash,
});
// Complete implicit authentication if we were redirected back to from the provider.
this.auth.completeAuth((err, data) => {

View File

@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import React from 'react';
import { Icon } from 'UI';
import { Icon } from 'netlify-cms-ui-default';
export default class AuthenticationPage extends React.Component {
static propTypes = {

View File

@ -21,7 +21,7 @@ function bootstrap(opts = {}) {
/**
* Log the version number.
*/
console.log(`Netlify CMS version ${NETLIFY_CMS_VERSION}`);
console.log(`Netlify CMS version ${process.env.NETLIFY_CMS_VERSION}`);
/**
* Get DOM element where app will mount.

View File

@ -12,7 +12,9 @@ import { currentBackend } from 'Backends/backend';
import { showCollection, createNewEntry } from 'Actions/collections';
import { openMediaLibrary as actionOpenMediaLibrary } from 'Actions/mediaLibrary';
import MediaLibrary from 'MediaLibrary/MediaLibrary';
import { Loader, Toast } from 'UI';
import { Toast } from 'UI';
import { Loader } from 'netlify-cms-ui-default';
import history from 'Routing/history';
import { getCollectionUrl, getNewEntryUrl } from 'Lib/urlHelper';
import { SIMPLE, EDITORIAL_WORKFLOW } from 'Constants/publishModes';
import Collection from 'Collection/Collection';
@ -87,6 +89,7 @@ class App extends React.Component {
base_url: this.props.config.getIn(["backend", "base_url"], null),
authEndpoint: this.props.config.getIn(["backend", "auth_endpoint"]),
config: this.props.config,
clearHash: () => history.replace('/'),
})
}
</div>

View File

@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from "react";
import ImmutablePropTypes from "react-immutable-proptypes";
import { NavLink } from 'react-router-dom';
import { Icon, Dropdown, DropdownItem } from 'UI';
import { Icon, Dropdown, DropdownItem } from 'netlify-cms-ui-default';
import { stripProtocol } from 'Lib/urlHelper';
export default class Header extends React.Component {

View File

@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import c from 'classnames';
import { Link } from 'react-router-dom';
import { Icon } from 'UI';
import { Icon } from 'netlify-cms-ui-default';
import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from 'Constants/collectionViews';
const CollectionTop = ({

View File

@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { Loader } from 'UI';
import { Loader } from 'netlify-cms-ui-default';
import EntryListing from './EntryListing';
const Entries = ({

View File

@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { Link } from 'react-router-dom';
import c from 'classnames';
import history from 'Routing/history';
import { resolvePath } from 'Lib/pathHelper';
import { resolvePath } from 'netlify-cms-lib-util/path';
import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from 'Constants/collectionViews';
const CollectionLabel = ({ label }) =>

View File

@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { NavLink } from 'react-router-dom';
import { searchCollections } from 'Actions/collections';
import { getCollectionUrl } from 'Lib/urlHelper';
import { Icon } from 'UI';
import { Icon } from 'netlify-cms-ui-default';
export default class Collection extends React.Component {

View File

@ -27,7 +27,7 @@ import { addAsset } from 'Actions/media';
import { openMediaLibrary, removeInsertedMedia } from 'Actions/mediaLibrary';
import { selectEntry, selectUnpublishedEntry, getAsset } from 'Reducers';
import { selectFields } from 'Reducers/collections';
import { Loader } from 'UI';
import { Loader } from 'netlify-cms-ui-default';
import { status } from 'Constants/publishModes';
import { EDITORIAL_WORKFLOW } from 'Constants/publishModes';
import EditorInterface from './EditorInterface';

View File

@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import SplitPane from 'react-split-pane';
import classnames from 'classnames';
import { ScrollSync, ScrollSyncPane } from './EditorScrollSync';
import { Icon } from 'UI'
import { Icon } from 'netlify-cms-ui-default';
import EditorControlPane from './EditorControlPane/EditorControlPane';
import EditorPreviewPane from './EditorPreviewPane/EditorPreviewPane';
import EditorToolbar from './EditorToolbar';

View File

@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import c from 'classnames';
import { Icon } from 'UI';
import { Icon } from 'netlify-cms-ui-default';
const EditorToggle = ({ enabled, active, onClick, icon }) => !enabled ? null :
<button className={c('nc-editor-toggle', {'nc-editor-toggleActive': active })} onClick={onClick}>

View File

@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import c from 'classnames';
import { Link } from 'react-router-dom';
import { status } from 'Constants/publishModes';
import { Icon, Dropdown, DropdownItem } from 'UI';
import { Icon, Dropdown, DropdownItem } from 'netlify-cms-ui-default';
import { stripProtocol } from 'Lib/urlHelper';
export default class EditorToolbar extends React.Component {

View File

@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from "react-immutable-proptypes";
import { isBoolean } from 'lodash';
import { Toggle } from 'UI';
import { Toggle } from 'netlify-cms-ui-default';
export default class BooleanControl extends React.Component {
render() {

Some files were not shown because too many files have changed in this diff Show More