From 90c56c3dc6a99748354babf047c1487a44289dda Mon Sep 17 00:00:00 2001 From: Brent Jackson Date: Fri, 25 May 2018 11:33:54 -0400 Subject: [PATCH 01/45] Update basic example --- examples/basic/index.html | 1 - examples/basic/{App.js => index.js} | 0 examples/basic/package.json | 7 +++---- 3 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 examples/basic/index.html rename examples/basic/{App.js => index.js} (100%) diff --git a/examples/basic/index.html b/examples/basic/index.html deleted file mode 100644 index 8da89d4..0000000 --- a/examples/basic/index.html +++ /dev/null @@ -1 +0,0 @@ -

Hello

diff --git a/examples/basic/App.js b/examples/basic/index.js similarity index 100% rename from examples/basic/App.js rename to examples/basic/index.js diff --git a/examples/basic/package.json b/examples/basic/package.json index f6ac9d8..81cc83a 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -2,11 +2,10 @@ "name": "x0-basic-example", "private": true, "scripts": { - "start": "x0 dev App.js -o", - "build": "x0 build App.js > index.html", - "test": "x0 build App.js" + "start": "x0 . -o", + "build": "x0 build ." }, "dependencies": { - "@compositor/x0": "^3.2.0" + "@compositor/x0": "^5.0.0-12" } } From ca59e9ba77aa9f6e6c06ad45cd7b4b1a1db10a88 Mon Sep 17 00:00:00 2001 From: Brent Jackson Date: Fri, 25 May 2018 11:46:00 -0400 Subject: [PATCH 02/45] Update bundle example --- examples/basic/README.md | 2 +- examples/bundle/README.md | 6 +++--- examples/bundle/package.json | 13 +++++-------- examples/bundle/{App.js => pages/index.js} | 4 ++++ 4 files changed, 13 insertions(+), 12 deletions(-) rename examples/bundle/{App.js => pages/index.js} (91%) diff --git a/examples/basic/README.md b/examples/basic/README.md index d0f526d..c3e009f 100644 --- a/examples/basic/README.md +++ b/examples/basic/README.md @@ -11,7 +11,7 @@ npm install npm start ``` -Editing `App.js` will live update in the development server. +Editing `index.js` will live update in the development server. ## Static Build diff --git a/examples/bundle/README.md b/examples/bundle/README.md index f69064c..e461fc2 100644 --- a/examples/bundle/README.md +++ b/examples/bundle/README.md @@ -11,7 +11,7 @@ npm install npm start ``` -Editing `App.js` will live update in the development server. +Editing `pages/index.js` will live update in the development server. ## Static Build @@ -19,6 +19,6 @@ Editing `App.js` will live update in the development server. npm run build ``` -This should save a `bundle.js` file which will rehydrate state in the `index.html`. +This will save a `bundle.js` file which will rehydrate state in the `index.html`. -To view the output app, run a local server in the `site/` directory. +To view the output app, run a local server in the `dist/` directory. diff --git a/examples/bundle/package.json b/examples/bundle/package.json index 89fc0ad..4dee6b7 100644 --- a/examples/bundle/package.json +++ b/examples/bundle/package.json @@ -2,18 +2,15 @@ "name": "x0-bundle-example", "private": true, "scripts": { - "start": "x0 dev App.js -o", - "build": "x0 build App.js --out-dir ./site", - "test": "x0 build App.js" + "start": "x0 pages -o", + "build": "x0 build pages" }, "dependencies": { - "@compositor/x0": "^3.2.0", - "refunk": "^2.2.4" + "@compositor/x0": "^5.0.0-12", + "refunk": "^3.0.1" }, "x0": { "title": "x0 Bundle Example", - "description": "Just a simple example", - "css": "*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;margin:0}", - "count": 16 + "description": "Just a simple example" } } diff --git a/examples/bundle/App.js b/examples/bundle/pages/index.js similarity index 91% rename from examples/bundle/App.js rename to examples/bundle/pages/index.js index e218191..1899926 100644 --- a/examples/bundle/App.js +++ b/examples/bundle/pages/index.js @@ -16,4 +16,8 @@ const App = connect(props => ( )) +App.defaultProps = { + count: 16 +} + export default App From 9af981fa394141cd19c959a8dbcfd517de6227fd Mon Sep 17 00:00:00 2001 From: Brent Jackson Date: Fri, 25 May 2018 11:48:48 -0400 Subject: [PATCH 03/45] Update configuration example --- examples/configuration/README.md | 2 +- examples/configuration/index.html | 1 - examples/configuration/package.json | 10 ++++------ examples/configuration/{App.js => pages/index.js} | 0 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 examples/configuration/index.html rename examples/configuration/{App.js => pages/index.js} (100%) diff --git a/examples/configuration/README.md b/examples/configuration/README.md index b6cb2f3..d4a5f26 100644 --- a/examples/configuration/README.md +++ b/examples/configuration/README.md @@ -11,7 +11,7 @@ npm install npm start ``` -Editing `App.js` will live update in the development server. +Editing `pages/index.js` will live update in the development server. ## Static Build diff --git a/examples/configuration/index.html b/examples/configuration/index.html deleted file mode 100644 index 997df83..0000000 --- a/examples/configuration/index.html +++ /dev/null @@ -1 +0,0 @@ -x0 Configuration Example

Hello

diff --git a/examples/configuration/package.json b/examples/configuration/package.json index 4aefdb1..1288ec9 100644 --- a/examples/configuration/package.json +++ b/examples/configuration/package.json @@ -2,16 +2,14 @@ "name": "x0-configuration-example", "private": true, "scripts": { - "start": "x0 dev App.js -o", - "build": "x0 build App.js > index.html", - "test": "x0 build App.js" + "start": "x0 pages -o", + "build": "x0 build pages" }, "dependencies": { - "@compositor/x0": "^3.2.0" + "@compositor/x0": "^5.0.0-12" }, "x0": { "title": "x0 Configuration Example", - "description": "Just a simple example", - "css": "*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;margin:0}" + "description": "Just a simple example" } } diff --git a/examples/configuration/App.js b/examples/configuration/pages/index.js similarity index 100% rename from examples/configuration/App.js rename to examples/configuration/pages/index.js From 775a92a58b958494576b0936a68b15f10a67e646 Mon Sep 17 00:00:00 2001 From: Brent Jackson Date: Fri, 25 May 2018 12:05:31 -0400 Subject: [PATCH 04/45] Update router example --- examples/cxs/App.js | 41 ----------------------- examples/cxs/README.md | 20 ----------- examples/cxs/Root.js | 20 ----------- examples/cxs/package.json | 13 -------- examples/react-router/App.js | 50 ---------------------------- examples/react-router/Root.js | 18 ---------- examples/react-router/package.json | 17 ++++------ examples/react-router/pages/_app.js | 17 ++++++++++ examples/react-router/pages/about.js | 5 +++ examples/react-router/pages/index.js | 6 ++++ 10 files changed, 34 insertions(+), 173 deletions(-) delete mode 100644 examples/cxs/App.js delete mode 100644 examples/cxs/README.md delete mode 100644 examples/cxs/Root.js delete mode 100644 examples/cxs/package.json delete mode 100644 examples/react-router/App.js delete mode 100644 examples/react-router/Root.js create mode 100644 examples/react-router/pages/_app.js create mode 100644 examples/react-router/pages/about.js create mode 100644 examples/react-router/pages/index.js diff --git a/examples/cxs/App.js b/examples/cxs/App.js deleted file mode 100644 index d584dbd..0000000 --- a/examples/cxs/App.js +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react' -import cxs from 'cxs/component' - -const Root = cxs('div')({ - padding: '48px' -}) - -const Heading = cxs('h1')({ - fontSize: '48px', - margin: 0 -}) - -const Button = cxs('button')(props => ({ - display: 'inline-block', - fontFamily: 'inherit', - fontSize: '14px', - paddingTop: '6px', - paddingBottom: '6px', - paddingLeft: '12px', - paddingRight: '12px', - border: 0, - borderRadius: '4px', - color: 'white', - backgroundColor: props.color, - WebkitAppearance: 'none' -})) - -Button.defaultProps = { - color: '#07c' -} - -const App = props => ( - - Hello CXS - - -) - -export default App diff --git a/examples/cxs/README.md b/examples/cxs/README.md deleted file mode 100644 index c4fe9a4..0000000 --- a/examples/cxs/README.md +++ /dev/null @@ -1,20 +0,0 @@ - -# x0 CXS example - -```sh -npm install -``` - -## Dev Server - -```sh -npm start -``` - -## Static Build - -```sh -npm run build -``` - -When building static, CSS will be added to a `