Skip to content

Commit

Permalink
Merge f7e2e95 into 91e696f
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanLovely authored Jan 2, 2019
2 parents 91e696f + f7e2e95 commit 1439a96
Show file tree
Hide file tree
Showing 49 changed files with 1,295 additions and 547 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"
}
}
3 changes: 1 addition & 2 deletions docs-site/.boltrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const config = {
// array of languages to compile the design system. note, these are ignored when the --i18n flag is set to false
// Note: if lang is defined, the first item is currently the one used by default in the Pattern Lab build, pending further iterations on this!
// lang: ['en', 'ja'],
lang: ['en'],

renderingService: false, // starts PHP service for rendering Twig templates
openServerAtStart: false,
Expand Down Expand Up @@ -73,7 +72,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
4 changes: 3 additions & 1 deletion docs-site/src/components/handle-iframe-height/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ if (window.self !== window.top) {
} else {
import('iframe-resizer/src/iframeResizer.js').then(module => {
const iFrameResize = module.default;
iFrameResize();
iFrameResize({
checkOrigin: false,
});
});
}
77 changes: 74 additions & 3 deletions docs-site/src/components/pattern-lab-utils/docs.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,82 @@
{% 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>
<div class="schema-form-root"></div>
{% set definitions = {} %}
{% set properties = {} %}

{% for key, prop in schema.properties %}
{% set propertyValues = {} %}
{% set propertyValues = schema.properties[key] %}

{% if prop.ref %}
{% set refName = prop.ref|split("/")[0]|replace({'@':''}) %}
{% set referenceData = get_data(prop.ref) %}
{% set reference = {} %}

{% if referenceData.type %}
{% set reference = reference|merge({
type: referenceData.type
}) %}
{% endif %}

{% if referenceData.properties %}
{% set reference = reference|merge({
properties: referenceData.properties
}) %}
{% endif %}

{% if referenceData.required %}
{% set reference = reference|merge({
required: referenceData.required
}) %}
{% endif %}

{% if referenceData.enum %}
{% set reference = reference|merge({
enum: referenceData.enum
}) %}
{% endif %}

{% if referenceData.default %}
{% set reference = reference|merge({
default: referenceData.default
}) %}
{% endif %}

{% set definitions = definitions | merge({
("" ~ refName): reference
}) %}

{% set propertyValues = propertyValues|merge({
"$ref": '#/definitions/' ~ prop.ref|split("/")[0]|replace({'@': ''})
}) %}
{# {% set newSchema = newSchema|merge(newSchema.properties[key]['$ref'] = '#/definitions/' ~ prop.ref %}
{% set newSchema newSchema|merge({
definitions
}.['definitions'][prop.ref] = reference %} #}
{% endif %}

{% set properties = properties|merge({
("" ~ key): propertyValues
}) %}
{% endfor %}

{% if definitions %}
{% set schema = schema|merge({
definitions: definitions,
}) %}
{% endif %}

{% if properties %}
{% set schema = schema|merge({
properties: properties,
}) %}
{% endif %}

<bolt-component-explorer initial-layout="{{ schemaForm.layout }}" template="{{ schemaForm.template }}" schema="{{ schema | json_encode() | raw | escape('html_attr') }}" form-data="{{ schemaForm.initialData | json_encode() | escape('html_attr') }}"></bolt-component-explorer>
</bolt-component-demo>
{% endif %}

Expand Down
Loading

0 comments on commit 1439a96

Please sign in to comment.