add netlify-cms (main) package
This commit is contained in:
parent
19f484eeda
commit
27d13a73b6
@ -1,29 +1,20 @@
|
||||
{
|
||||
"name": "netlify-cms-core",
|
||||
"description": "Netlify CMS lets content editors work on structured content stored in git",
|
||||
"description": "Netlify CMS core application, see netlify-cms package for the main distribution.",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"main": "dist/netlify-cms-core.js",
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint --fix",
|
||||
"jest --findRelatedTests",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"src/",
|
||||
"dist/"
|
||||
],
|
||||
"scripts": {
|
||||
"watch": "webpack-dev-server --hot --open",
|
||||
"watch": "webpack -w",
|
||||
"build": "webpack"
|
||||
},
|
||||
"keywords": [
|
||||
"netlify",
|
||||
"cms",
|
||||
"content editing",
|
||||
"static site generators",
|
||||
"jamstack"
|
||||
"core"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -105,10 +96,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"css-loader": "^1.0.0",
|
||||
"friendly-errors-webpack-plugin": "^1.7.0",
|
||||
"to-string-loader": "^1.1.5",
|
||||
"webpack": "^4.16.1",
|
||||
"webpack-cli": "^3.1.0",
|
||||
"webpack-dev-server": "^3.1.5"
|
||||
"webpack-cli": "^3.1.0"
|
||||
}
|
||||
}
|
||||
|
1
packages/netlify-cms-core/src/bootstrap.js
vendored
1
packages/netlify-cms-core/src/bootstrap.js
vendored
@ -10,7 +10,6 @@ import { setStore } from 'ValueObjects/AssetProxy';
|
||||
import { ErrorBoundary } from 'UI'
|
||||
import App from 'App/App';
|
||||
import 'EditorWidgets';
|
||||
import 'MarkdownPlugins';
|
||||
import 'what-input';
|
||||
|
||||
const ROOT_ID = 'nc-root';
|
||||
|
@ -1,8 +0,0 @@
|
||||
import { registerEditorComponent } from 'Lib/registry';
|
||||
import image from 'netlify-cms-editor-component-image';
|
||||
|
||||
const plugins = [
|
||||
image,
|
||||
];
|
||||
|
||||
plugins.forEach(registerEditorComponent);
|
@ -1,9 +0,0 @@
|
||||
/**
|
||||
* Components
|
||||
*/
|
||||
@import "./components/EditorWidgets/EditorWidgets.css";
|
||||
|
||||
/**
|
||||
* Backend auth pages
|
||||
*/
|
||||
@import "./backends/git-gateway/AuthenticationPage.css";
|
@ -1,6 +1,5 @@
|
||||
const path = require('path');
|
||||
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
|
||||
const { getConfig, rules, plugins } = require('../../scripts/webpack.js');
|
||||
const { getConfig, rules } = require('../../scripts/webpack.js');
|
||||
|
||||
module.exports = {
|
||||
...getConfig(),
|
||||
@ -27,22 +26,5 @@ module.exports = {
|
||||
use: ['to-string-loader', 'css-loader'],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
...Object.entries(plugins)
|
||||
.filter(([ key ]) => key !== 'friendlyErrors')
|
||||
.map(([ _, plugin ]) => plugin()),
|
||||
new FriendlyErrorsWebpackPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: ['Netlify CMS is now running at http://localhost:8080'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
devServer: {
|
||||
contentBase: './example',
|
||||
watchContentBase: true,
|
||||
quiet: true,
|
||||
host: 'localhost',
|
||||
port: 8080,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
Before Width: | Height: | Size: 808 KiB After Width: | Height: | Size: 808 KiB |
Before Width: | Height: | Size: 310 KiB After Width: | Height: | Size: 310 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
34
packages/netlify-cms/package.json
Normal file
34
packages/netlify-cms/package.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "netlify-cms",
|
||||
"description": "An extensible, open source, Git-based, React CMS for static sites.",
|
||||
"version": "2.0.0-alpha.0",
|
||||
"main": "dist/netlify-cms.js",
|
||||
"scripts": {
|
||||
"watch": "webpack-dev-server --open",
|
||||
"build": "webpack"
|
||||
},
|
||||
"keywords": [
|
||||
"netlify",
|
||||
"cms",
|
||||
"content editing",
|
||||
"static site generators",
|
||||
"jamstack"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
},
|
||||
"peerDependencies": {
|
||||
"netlify-cms-core": "2.0.0-alpha.0",
|
||||
"netlify-cms-backend-github": "2.0.0-alpha.0",
|
||||
"netlify-cms-backend-gitlab": "2.0.0-alpha.0",
|
||||
"netlify-cms-backend-git-gateway": "2.0.0-alpha.0",
|
||||
"netlify-cms-backend-test": "2.0.0-alpha.0",
|
||||
"netlify-cms-editor-component-image": "2.0.0-alpha.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"friendly-errors-webpack-plugin": "^1.7.0",
|
||||
"webpack": "^4.16.1",
|
||||
"webpack-cli": "^3.1.0",
|
||||
"webpack-dev-server": "^3.1.5"
|
||||
}
|
||||
}
|
12
packages/netlify-cms/src/backends.js
Normal file
12
packages/netlify-cms/src/backends.js
Normal file
@ -0,0 +1,12 @@
|
||||
import cms 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 { TestBackend } from 'netlify-cms-backend-test';
|
||||
|
||||
const { registerBackend } = cms;
|
||||
|
||||
registerBackend('git-gateway', GitGatewayBackend);
|
||||
registerBackend('github', GitHubBackend);
|
||||
registerBackend('gitlab', GitLabBackend);
|
||||
registerBackend('test-repo', TestBackend);
|
5
packages/netlify-cms/src/editor-components.js
Normal file
5
packages/netlify-cms/src/editor-components.js
Normal file
@ -0,0 +1,5 @@
|
||||
import image from 'netlify-cms-editor-component-image';
|
||||
|
||||
const { registerEditorComponent } = cms;
|
||||
|
||||
registerEditorComponent(image);
|
3
packages/netlify-cms/src/index.js
Normal file
3
packages/netlify-cms/src/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
import './backends';
|
||||
import './widgets';
|
||||
import './editor-components';
|
30
packages/netlify-cms/src/widgets.js
Normal file
30
packages/netlify-cms/src/widgets.js
Normal file
@ -0,0 +1,30 @@
|
||||
import cms from 'netlify-cms-core';
|
||||
// import { StringControl, StringPreview } from 'netlify-cms-widget-string';
|
||||
// import { NumberControl, NumberPreview } from 'netlify-cms-widget-number';
|
||||
// import { TextControl, TextPreview } from 'netlify-cms-widget-text';
|
||||
// import { ImageControl, ImagePreview } from 'netlify-cms-widget-image';
|
||||
// import { FileControl, FilePreview } from 'netlify-cms-widget-file';
|
||||
// import { DateControl, DatePreview } from 'netlify-cms-widget-date';
|
||||
// import { DateTimeControl, DateTimePreview } from 'netlify-cms-widget-datetime';
|
||||
// import { SelectControl, SelectPreview } from 'netlify-cms-widget-select';
|
||||
// import { MarkdownControl, MarkdownPreview } from 'netlify-cms-widget-markdown';
|
||||
// import { ListControl, ListPreview } from 'netlify-cms-widget-list';
|
||||
// import { ObjectControl, ObjectPreview } from 'netlify-cms-widget-object';
|
||||
// import { RelationControl, RelationPreview } from 'netlify-cms-widget-relation';
|
||||
// import { BooleanControl } from 'netlify-cms-widget-boolean';
|
||||
|
||||
const { registerWidget } = cms;
|
||||
|
||||
// registerWidget('string', StringControl, StringPreview);
|
||||
// registerWidget('text', TextControl, TextPreview);
|
||||
// registerWidget('number', NumberControl, NumberPreview);
|
||||
// registerWidget('list', ListControl, ListPreview);
|
||||
// registerWidget('markdown', MarkdownControl, MarkdownPreview);
|
||||
// registerWidget('image', ImageControl, ImagePreview);
|
||||
// registerWidget('file', FileControl, FilePreview);
|
||||
// registerWidget('date', DateControl, DatePreview);
|
||||
// registerWidget('datetime', DateTimeControl, DateTimePreview);
|
||||
// registerWidget('select', SelectControl, SelectPreview);
|
||||
// registerWidget('object', ObjectControl, ObjectPreview);
|
||||
// registerWidget('relation', RelationControl, RelationPreview);
|
||||
// registerWidget('boolean', BooleanControl);
|
23
packages/netlify-cms/webpack.config.js
Normal file
23
packages/netlify-cms/webpack.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
|
||||
const { getConfig, plugins } = require('../../scripts/webpack.js');
|
||||
|
||||
module.exports = {
|
||||
...getConfig(),
|
||||
plugins: [
|
||||
...Object.entries(plugins)
|
||||
.filter(([ key ]) => key !== 'friendlyErrors')
|
||||
.map(([ _, plugin ]) => plugin()),
|
||||
new FriendlyErrorsWebpackPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: ['Netlify CMS is now running at http://localhost:8080'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
devServer: {
|
||||
contentBase: './example',
|
||||
watchContentBase: true,
|
||||
quiet: true,
|
||||
host: 'localhost',
|
||||
port: 8080,
|
||||
},
|
||||
};
|
@ -24,24 +24,9 @@ const rules = () => ({
|
||||
});
|
||||
|
||||
const plugins = () => {
|
||||
const defaultPlugins = {
|
||||
return {
|
||||
friendlyErrors: () => new FriendlyErrorsWebpackPlugin()
|
||||
};
|
||||
|
||||
if (isProduction) {
|
||||
return {
|
||||
...defaultPlugins,
|
||||
sourcemap: (config = {}) => new webpack.SourceMapDevToolPlugin({
|
||||
filename: '[file].map',
|
||||
moduleFilenameTemplate: info => path.posix.normalize(`../src/${info.resourcePath}`),
|
||||
noSources: true,
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...defaultPlugins,
|
||||
}
|
||||
};
|
||||
|
||||
const stats = () => {
|
||||
@ -75,7 +60,7 @@ const getConfig = () => ({
|
||||
rules: Object.values(rules()).map(rule => rule()),
|
||||
},
|
||||
plugins: Object.values(plugins()).map(plugin => plugin),
|
||||
devtool: !isProduction && 'source-map',
|
||||
devtool: 'source-map',
|
||||
target: 'web',
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user