Skip to content

Commit

Permalink
Merge 18d88d9 into 91e696f
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanLovely authored Dec 31, 2018
2 parents 91e696f + 18d88d9 commit 32a241e
Show file tree
Hide file tree
Showing 33 changed files with 568 additions and 244 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
dist
vendor
/.idea
/.vscode
/example-integrations
/www
/docs-site/cache
/docs-site/vendor
/docs-site/node_modules
# /apps/pattern-lab/cache
31 changes: 23 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
sudo: false
sudo: required
dist: trusty

services:
- docker

stages:
- build-and-deploy # lint code and docs

Expand Down Expand Up @@ -36,14 +39,26 @@ jobs:

- stage: build-and-deploy
name: 'Build + Deploy'
before_script:
- phpenv config-rm xdebug.ini
- composer global require hirak/prestissimo
- yarn run setup
# before_script:
# - phpenv config-rm xdebug.ini
# - composer global require hirak/prestissimo
# - yarn run setup
script:
- yarn run build
- yarn run deploy
# - yarn run build
# - yarn run deploy
# - sh ./scripts/update-read-only-git-repos.sh @todo: run this only on Bolt releases
- docker --log-level error pull boltdesignsystem/bolt || true
- docker build --cache-from boltdesignsystem/bolt --tag boltdesignsystem/bolt .
- docker images
- echo $DOCKER_HUB_PASS | docker login --username $DOCKER_HUB_USER --password-stdin
- GIT_SHA="$(git rev-parse --short HEAD)"
- docker tag boltdesignsystem/bolt boltdesignsystem/bolt:latest
- docker tag boltdesignsystem/bolt boltdesignsystem/bolt:${GIT_SHA}
- docker --log-level error push boltdesignsystem/bolt:latest
- docker --log-level error push boltdesignsystem/bolt:${GIT_SHA}
after_script:
- cd scripts && npm install
- npm run deploy
cache:
yarn: true
directories:
Expand All @@ -70,7 +85,7 @@ before_install:
notifications:
email:
on_success: never
on_failure: always
on_failure: never # @todo re-enable
slack:
secure: cNto+gWAoK1JM9jBNG4i4rMSybv3twMbqlFSCohQFBDMwKFMdlyWqFDX6iYKtHxWEDzrZyRz3qiJ8/S44mgjeKJ/xHbHDtPchp/KL2P1htipvwD2EZXobcBEGl83v2rmtFO1WNJUPB3RIJE2yt1wJsX7NIXpDw82hePmaIvNJmtbLpK/J5uaFqGNHIsctmULgVmGSNSTyK4nYxxjNNLd0EvO37Y6VN8FhsKNu2NHMKeeQxinEvETDUh8XuqXZYNWE3PBvVa4OiDhgnr5K27jsnWX+wEmqg0xY+CMf7mUSTqVN61fA7LnHyM0qcGGmB6YTv4QYLMwPydp+nsjDcm3St9D+KOTsQ4ExOaEAL/6EnAEpl8GtxST+ytdqswhCC4yMCO61Hy+M5AoXgDSGrrXHgZakDMAcEVcJdH38791hRxcuM3ldVmHAlAWFdgRLG5rRMVh3qoXz7jbraoTdjyKMegQIQdKR2SX7O9Dv0EEtLz4lTFN2RENvAjLggUPPU+ESoUHmSbwmPGnt7jy3ra2AI3nnYpfn/0e6Op/A3z7HLbdm3XyuNWoTPhy1mc4Adca+HosJ37UPv7nDRIGds1sKYAeWq94+rEk+/6IQ/oRIDRhSYsQbLLWnU6DH4o7iOj7D+X/ngjqmF75nW2s5+7rtdBHFvNzOJalCKHiDTMfdlQ=

10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM basaltinc/docker-node-php-base:latest
# @todo replace with `boltdesignsystem/bolt-docker:latest` once that is configured correctly
WORKDIR /app
COPY . .
EXPOSE 3123
RUN composer global require hirak/prestissimo
RUN yarn run setup
RUN yarn run build

CMD yarn serve
4 changes: 4 additions & 0 deletions deploys/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM boltdesignsystem/bolt:${DOCKER_TAG:-latest}
RUN echo "Using DOCKER_TAG: ${DOCKER_TAG:-latest}"
# tag being built from will be env var `$DOCKER_TAG` if set, else it will be `latest`
EXPOSE 3123
14 changes: 14 additions & 0 deletions deploys/now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"name": "boltdesignsystem",
"type": "docker",
"scale": {
"sfo1": {
"min": 1,
"max": 1
}
},
"features": {
"cloud": "v1"
}
}
2 changes: 1 addition & 1 deletion docs-site/.boltrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const config = {
components: {
global: [
'@bolt/global',
// '@bolt/schema-form',
'@bolt/schema-form',
'@bolt/components-placeholder',
'@bolt/components-action-blocks',
'@bolt/components-dropdown',
Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/components/pattern-lab-utils/docs.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% set readmeFile = "@bolt-components-#{componentName}/README.md" %}
{% endif %}

{% if schemaForm and schema and bolt.data.config.renderingService == true %}
{% if schemaForm and schema %}
<bolt-component-demo>
{% set schemaForm = schemaForm|merge({ schema: schema }) %}
<script type="application/json">{{ schemaForm | json_encode }}</script>
Expand Down
5 changes: 3 additions & 2 deletions docs-site/src/components/schema-form/grid-layout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { h } from '@bolt/core';
import React from 'react';
// import React from 'react';
import React, { Component } from 'react';
import { WidthProvider, Responsive } from 'react-grid-layout';

const ResponsiveReactGridLayout = WidthProvider(Responsive);
Expand All @@ -8,7 +9,7 @@ const originalLayouts = getFromLS('layouts') || {};
/**
* This layout demonstrates how to sync multiple responsive layouts to localstorage.
*/
export default class ResponsiveLocalStorageLayout extends React.PureComponent {
export class ResponsiveLocalStorageLayout extends React.Component {
constructor(props) {
super(props);

Expand Down
1 change: 0 additions & 1 deletion docs-site/src/components/schema-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if (document.querySelector('.schema-form-root')) {
const dataString = root.previousElementSibling.innerHTML;
const data = JSON.parse(dataString);
if (data.schema) {
console.log(data);
render(<SchemaForm {...data} />, root);
}
});
Expand Down
5 changes: 2 additions & 3 deletions docs-site/src/components/schema-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
],
"homepage": "https://boltdesignsystem.com",
"license": "MIT",
"repository": "https://github.com/bolt-design-system/bolt/tree/master/packages/ui-toolkit/bds-schema-form",
"bugs": "https://github.com/bolt-design-system/bolt/issues",
"private": true,
"main": "index.js",
"style": "schema-form.scss",
"dependencies": {
"@bolt/core": "^2.2.1",
"html-react-parser": "^0.4.6",
"html-react-parser": "^0.6.0",
"lodash.debounce": "^4.0.8",
"prop-types": "^15.6.2",
"querystring": "^0.2.0",
"react-grid-layout": "^0.16.6",
"react-jsonschema-form": "^1.0.4"
"react-jsonschema-form": "^1.0.6"
}
}
9 changes: 5 additions & 4 deletions docs-site/src/components/schema-form/schema-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export default class SchemaForm extends Component {
// this.requestRender(data);
// } else {
const res = await fetch(
`/api/render-twig?${qs.stringify({
templatePath: this.props.demoTemplate,
`/api/render?${qs.stringify({
template: this.props.demoTemplate,
})}`,
{
method: 'POST',
Expand All @@ -94,6 +94,7 @@ export default class SchemaForm extends Component {
);

const body = await res.text();

if (!res.ok) {
console.error(`Error: rendering ${this.props.demoTemplate}`, body);
return;
Expand All @@ -120,9 +121,9 @@ export default class SchemaForm extends Component {
render() {
const { layout } = this.props;

const iframeHead = `<link rel="stylesheet" href="/pattern-lab/build/bolt-global${
const iframeHead = `<link rel="stylesheet" href="/build/bolt-global${
bolt.config.lang ? '-' + bolt.data.config.lang[0] : ''
}.css"> <script src="/pattern-lab/build/bolt-global.js" async></script>`;
}.css"> <script src="/build/bolt-global.js" async></script>`;

const schema = SchemaForm.prepareSchema(this.props.schema);
const isHorizontal = layout === 'horizontal';
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './components/version-selector/version-selector';
import './components/schema-form';
import './components/handle-iframe-height';
import './pages/pattern-lab/_patterns/02-components/card/__tests__';
// import './pages/pattern-lab/_patterns/01-styleguide/100-rendering-performance/bolt-preact-test';
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import './components/pattern-lab-hacks/pattern-lab-hacks.scss';
@import './components/pattern-lab-demos/pattern-lab-demos.scss';
@import './components/schema-table/schema-table.scss';
@import './components/schema-form/schema-form.scss';
@import './pages/pattern-lab/_patterns/01-visual-styles/00-color-palette/_color-swatch';
@import './pages/pattern-lab/_patterns/01-visual-styles/15-breakpoints/_breakpoints';
@import './components/pattern-lab-utils/_sassdoc.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,16 @@

{% include "@utils/docs.twig" with {
componentName: "button",
usage: usage
usage: usage,
schemaForm: {
demoTemplate: '@bolt-components-button/button.twig',
layout: "horizontal",
initialData: {
text: "Button w/ Icon `after` Text",
icon: {
name: "chevron-right",
position: "after"
}
},
},
} only %}
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,29 @@
demoTemplate: '@bolt-components-navbar/navbar.twig',
layout: "horizontal",
initialData: {
title: {
tag: "h2",
text: "Title Text",
icon: {
name: "brand-operations"
"title": {
"tag": "h2",
"text": "Title Text",
"icon": {
"name": "marketing-gray"
}
},
links: [
"links": [
{
text: "Link 1 Text",
url: "link-1-url"
"text": "Features",
"url": "#!"
},
{
text: "Link 2 Text",
url: "link-2-url"
"text": "Resources",
"url": "#!"
},
{
text: "Link 3 Text",
url: "link-3-url"
"text": "Industry Apps",
"url": "#!"
},
{
"text": "Customer Success",
"url": "#!"
}
]
},
Expand Down
38 changes: 0 additions & 38 deletions now.json

This file was deleted.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"setup:full": "yarn --force",

"deploy": "./scripts/deploy.js",
"deploy:docker": "sh ./scripts/docker.sh",

"clean": "npx npm-run-all --parallel clean:*",
"clean:empty": "find . -empty -type d -delete",
Expand All @@ -43,11 +44,14 @@
"test": "npm-run-all --parallel test:*",
"test:js": "NODE_ENV='test' jest",
"test:php": "npx lerna exec --scope @bolt/core-php -- composer run test",

"serve": "node server.js",

"postbootstrap": "node scripts/monorepo-tests.js",
"prepublishOnly": "node scripts/monorepo-tests.js"
},
"dependencies": {
"ci-utils": "^0.5.0",
"sassdoc": "^2.5.0",
"npm-run-all": "^4.1.5",
"jest": "^23.6.0",
Expand All @@ -60,18 +64,20 @@
},
"devDependencies": {
"editorconfig-checker": "^1.3.3",
"express": "^4.16.3",
"git-semver-tags": "^2.0.0",
"husky": "^1.3.1",
"lerna": "^3.8.0",
"nightwatch": "^1.0.8",
"node-fetch": "^2.2.0",
"now": "^12.1.0",
"now": "latest",
"url-exists": "^1.0.3",
"yaml-lint": "^1.2.4"
},
"workspaces": {
"packages": [
"docs-site",
"docs-site/src/components/*",
"packages/uikit-workshop",
"packages/build-tools",
"packages/build-tools/plugins/*",
Expand Down
Loading

0 comments on commit 32a241e

Please sign in to comment.