Skip to content

Commit

Permalink
Quality of Life changes (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjick authored Feb 18, 2020
1 parent 25bcc09 commit d0408d0
Show file tree
Hide file tree
Showing 245 changed files with 758 additions and 19,767 deletions.
2 changes: 1 addition & 1 deletion .docker/api/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

"magento2": {
"url": "http://magento2.demo-1.xyz.com",
"imgUrl": "http://localhost:8080/media/catalog/product",
"imgUrl": "https://demo.vuestorefront.io/media/catalog/product",
"magentoUserName": "",
"magentoUserPassword": "",
"httpUserName": "",
Expand Down
6 changes: 3 additions & 3 deletions .docker/api/db.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let config = require('config')
let es = require('elasticsearch')
const config = require('config')
const es = require('elasticsearch')
const esConfig = {
host: config.elasticsearch.host + ':' + config.elasticsearch.port,
log: 'debug',
// log: 'debug',
apiVersion: config.elasticsearch.apiVersion,
requestTimeout: 1000 * 60 * 60,
keepAlive: false
Expand Down
21 changes: 21 additions & 0 deletions .docker/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "es6",
"strict": false,
"allowJs": true,
"importHelpers": true,
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"resolveJsonModule": false,
"outDir": "dist",
"sourceMap": true,
"baseUrl": ".",
"lib": ["es7", "dom"]
},
"include": [
"src/**/*"
]
}
45 changes: 6 additions & 39 deletions .docker/frontend/config.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,18 @@
{
"server": {
"dynamicConfigReload": true,
"dynamicConfigContinueOnError": true
"api": {
"url": "http://demo.vuestorefront.io"
},
"elasticsearch": {
"httpAuth": "",
"host": "storefront-api:8080/api/catalog",
"index": "vue_storefront_catalog"
"graphql":{
"host": "storefront-api",
"port": 8080
},
"theme": "@vue-storefront/theme-default",
"storyblok": {
"endpoint": "http://storefront-api:8080/api/ext/vsf-storyblok-extension",
"settings": {
"addRoutes": true
}
},
"cart": {
"synchronize": true,
"create_endpoint": "http://storefront-api:8080/api/cart/create?token={{token}}",
"updateitem_endpoint": "http://storefront-api:8080/api/cart/update?token={{token}}&cartId={{cartId}}",
"deleteitem_endpoint": "http://storefront-api:8080/api/cart/delete?token={{token}}&cartId={{cartId}}",
"pull_endpoint": "http://storefront-api:8080/api/cart/pull?token={{token}}&cartId={{cartId}}"
},
"orders": {
"endpoint": "http://storefront-api:8080/api/order"
},
"users": {
"endpoint": "http://storefront-api:8080/api/user"
},
"stock": {
"endpoint": "http://storefront-api:8080/api/stock"
},
"images": {
"baseUrl": "https://demo.vuestorefront.io/img/"
},
"install": {
"is_local_backend": false,
"backend_dir": "../vue-storefront-api"
},
"demomode": false,
"tax": {
"defaultCountry": "PL",
"defaultRegion": "",
"calculateServerSide": false
},
"i18n": {
"defaultCountry": "US",
"defaultLanguage": "EN"
"is_local_backend": false
}
}
11 changes: 7 additions & 4 deletions .docker/frontend/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Compare } from '@vue-storefront/core/modules/compare'
import { Review } from '@vue-storefront/core/modules/review'
import { Mailer } from '@vue-storefront/core/modules/mailer'
import { Wishlist } from '@vue-storefront/core/modules/wishlist'
import { Mailchimp } from '../modules/mailchimp'
import { Notification } from '@vue-storefront/core/modules/notification'
import { RecentlyViewed } from '@vue-storefront/core/modules/recently-viewed'
import { Homepage } from './homepage'
Expand All @@ -21,9 +20,14 @@ import { RawOutputExample } from './raw-output-example'
import { Magento2CMS } from './magento-2-cms'
import { Url } from '@vue-storefront/core/modules/url'
import { InstantCheckout } from './instant-checkout'
import { Storyblok, urlExtend } from './vsf-storyblok-module'
import { Storyblok } from './vsf-storyblok-module'
import { forStoryblok } from './vsf-storyblok-module/mappingFallback'
import { extendMappingFallback } from './vsf-mapping-fallback'
import { forCategory, forProduct, tap } from './vsf-mapping-fallback/builtin'

extendModule(urlExtend)
extendMappingFallback(
forProduct, forCategory, forStoryblok, tap
)

export const registerModules: VueStorefrontModule[] = [
Checkout,
Expand All @@ -33,7 +37,6 @@ export const registerModules: VueStorefrontModule[] = [
Review,
Mailer,
Wishlist,
Mailchimp,
Notification,
Ui,
RecentlyViewed,
Expand Down
41 changes: 41 additions & 0 deletions .docker/frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"strict": false,
"allowJs": true,
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"resolveJsonModule": false,
"sourceMap": true,
"baseUrl": ".",
"types": [
"reflect-metadata",
"node",
"jest"
],
"paths": {
"core/*": ["core/*"],
"theme/*": ["src/themes/default/*"], //needs testing with non-default theme!
"core/modules/*": ["./core/modules/*"],
"@vue-storefront/*": ["./"]
},
"lib": ["es2017", "dom", "es2018.promise"]
},
"files": ["shims.d.ts"],
"include": [
"src/**/*.ts",
"src/**/*.vue",
"core/**/*.ts",
"core/**/*.vue",
"test/**/*.ts",
"module/**/*.ts",
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
1 change: 1 addition & 0 deletions .docker/vsf-mapping-fallback
Submodule vsf-mapping-fallback added at 6418c4
2 changes: 1 addition & 1 deletion .docker/vue-storefront
2 changes: 1 addition & 1 deletion .docker/vue-storefront-api
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,ts,json,vue,yml}]
charset = utf-8
indent_style = space
indent_size = 2
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vue-storefront
vue-storefront-api
.docker/vue-storefront
.docker/vue-storefront-api
node_modules
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests
on: [push]
jobs:
tests:
name: 'Main'
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 10
- run: yarn install
- name: Run linters
uses: samuelmeuli/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
# Enable linters
eslint: true
eslint_extensions: js,vue,ts
- uses: zhulik/[email protected]
- uses: nyaruka/elasticsearch-action@v1
with:
elastic version: '5.6.11'
- name: Start server
run: make submodules bundle start
- name: Run e2e tests
uses: cypress-io/github-action@v1
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "vue-storefront-api"]
path = .docker/vue-storefront-api
url = https://github.com/DivanteLtd/vue-storefront-api.git
[submodule ".docker/vsf-mapping-fallback"]
path = .docker/vsf-mapping-fallback
url = https://github.com/kodbruket/vsf-mapping-fallback.git
2 changes: 2 additions & 0 deletions .output/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vue-storefront
vue-storefront-api
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
submodules:
git submodule update --init

bundle:
mkdir -p .docker/vue-storefront/var
yarn docker-compose-bundler
sed -i.bak 's/storefront-api/localhost/' .output/vue-storefront/config/local.json

build-api:
cd .output/vue-storefront-api && yarn && yarn build

start-api:
cd .output/vue-storefront-api && yarn start

build-ui:
cd .output/vue-storefront && yarn && yarn build

start-ui:
cd .output/vue-storefront && yarn start

start: build-api start-api build-ui start-ui

submodules:
git submodule update --init
18 changes: 9 additions & 9 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: '2.4'
services:

services:
storefront-api:
depends_on:
elasticsearch:
condition: service_healthy
redis:
condition: service_healthy
depends_on:
- elasticsearch
- redis
labels:
bundle: "vue-storefront-api"
storefront-ui:
depends_on:
storefront-api:
condition: service_healthy
labels:
bundle: "vue-storefront"

volumes:
esdat1: null
27 changes: 16 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,23 @@ services:
VS_ENV: dev
ports:
- '8080:8080'
tmpfs:
- /var/www/dist
volumes:
- './.docker/vue-storefront-api/babel.config.js:/var/www/babel.config.js'
# Upstream
- './.docker/vue-storefront-api/config:/var/www/config'
- './.docker/vue-storefront-api/ecosystem.json:/var/www/ecosystem.json'
- './.docker/vue-storefront-api/migrations:/var/www/migrations:delegated'
- './.docker/vue-storefront-api/package.json:/var/www/package.json'
- './.docker/vue-storefront-api/babel.config.js:/var/www/babel.config.js'
- './.docker/vue-storefront-api/scripts:/var/www/scripts:delegated'
- './.docker/vue-storefront-api/nodemon.json:/var/www/nodemon.json'
- './.docker/vue-storefront-api/src:/var/www/src:delegated'
- './.docker/vue-storefront-api/var:/var/www/var:delegated'
# Development
- './.docker/api/config.json:/var/www/config/local.json'
- './.docker/api/db.js:/var/www/src/db.js'
- >-
./packages/vsf-storyblok-extension:/var/www/src/api/extensions/vsf-storyblok-extension:delegated
- './.docker/api/tsconfig.json:/var/www/tsconfig.json'
# Module
- './packages/vsf-storyblok-extension:/var/www/src/api/extensions/vsf-storyblok-extension:delegated'
healthcheck:
test: ['CMD', 'curl', '-f', '-s', '-S', 'http://localhost:8080/api']
storefront-ui:
Expand All @@ -57,27 +59,30 @@ services:
VS_ENV: dev
ports:
- '3000:3000'
tmpfs:
- /var/www/dist
volumes:
# Upstream
- './.docker/vue-storefront/babel.config.js:/var/www/babel.config.js'
- './.docker/vue-storefront/config:/var/www/config'
- './.docker/vue-storefront/core:/var/www/core:delegated'
- './.docker/vue-storefront/ecosystem.json:/var/www/ecosystem.json'
- './.docker/vue-storefront/.eslintignore:/var/www/.eslintignore'
- './.docker/vue-storefront/.eslintrc.js:/var/www/.eslintrc.js'
- './.docker/vue-storefront/lerna.json:/var/www/lerna.json'
- './.docker/vue-storefront/tsconfig.json:/var/www/tsconfig.json'
- './.docker/vue-storefront/tsconfig-build.json:/var/www/tsconfig-build.json'
- './.docker/vue-storefront/shims.d.ts:/var/www/shims.d.ts'
- './.docker/vue-storefront/package.json:/var/www/package.json'
- './.docker/vue-storefront/src:/var/www/src:delegated'
- './.docker/vue-storefront/var:/var/www/var:delegated'
# Development
- './.docker/frontend/config.json:/var/www/config/local.json'
- './.docker/frontend/modules.ts:/var/www/src/modules/index.ts'
- './theme:/var/www/src/themes/default'
- >-
./packages/vsf-storyblok-module:/var/www/src/modules/vsf-storyblok-module:delegated
- './.docker/frontend/tsconfig.json:/var/www/tsconfig.json'
- './.docker/vsf-mapping-fallback:/var/www/src/modules/vsf-mapping-fallback'
- './theme/components/storyblok:/var/www/src/themes/default/components/storyblok'
- './theme/head.js:/var/www/src/themes/default/head.js'
- './theme/index.js:/var/www/src/themes/default/index.js'
# Module
- './packages/vsf-storyblok-module:/var/www/src/modules/vsf-storyblok-module:delegated'
healthcheck:
test:
['CMD', 'wget', '-q', '--tries=1', '--spider', 'http://localhost:3000']
Expand Down
Loading

0 comments on commit d0408d0

Please sign in to comment.