Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #168 from zarathustra323/fix-builds
Browse files Browse the repository at this point in the history
Create basic example website sandbox
  • Loading branch information
zarathustra323 authored Oct 12, 2021
2 parents b237639 + fcea1a1 commit f23ae4a
Show file tree
Hide file tree
Showing 25 changed files with 176 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ typings/
*.marko.js
.marko-cli
.marko-devtools

# Build assets
**/dist/
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,32 @@ services:

# EXAMPLES / OTHER

example-website:
<<: *node
working_dir: /base-cms/services/example-website
entrypoint: ["yarn"]
command: ["dev"]
environment:
<<: *env
PORT: 80
EXPOSED_PORT: 51269
LIVERELOAD_PORT: 61269
TENANT_KEY: abmedia_all
SITE_ID: 60f6ec3bd28860bc3384e784

GRAPHQL_URI: ${GRAPHQL_URI-http://graphql-server-virgon}
OEMBED_URI: ${OEMBED_URI-https://oembed}
RSS_URI: ${RSS_URI-http://rss-virgon}
SITEMAPS_URI: ${SITEMAPS_URI-http://sitemaps-virgon}
depends_on:
- graphql-server-virgon
- oembed
- rss-virgon
- sitemaps-virgon
ports:
- "51269:80"
- "61269:61269"

example-leaders-program:
<< : *node
working_dir: /base-cms/packages/leaders-program
Expand Down
1 change: 1 addition & 0 deletions services/example-website/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.marko.js
9 changes: 9 additions & 0 deletions services/example-website/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.marko'],
},
},
},
};
21 changes: 21 additions & 0 deletions services/example-website/browser/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
extends: [
'airbnb-base',
'plugin:vue/recommended',
],
env: {
browser: true,
},
rules: {
'vue/max-attributes-per-line': ['error', {
singleline: 3,
multiline: {
max: 1,
allowFirstLine: false,
},
}],
},
parserOptions: {
parser: 'babel-eslint',
},
};
3 changes: 3 additions & 0 deletions services/example-website/browser/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Browser from '@parameter1/base-cms-marko-web/browser';

export default Browser;
1 change: 1 addition & 0 deletions services/example-website/browser/ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
1 change: 1 addition & 0 deletions services/example-website/config/core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
1 change: 1 addition & 0 deletions services/example-website/config/site.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
19 changes: 19 additions & 0 deletions services/example-website/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { startServer } = require('@parameter1/base-cms-marko-web');

const document = require('./server/components/document');
const coreConfig = require('./config/core');
const siteConfig = require('./config/site');
const routes = require('./server/routes');

const { log } = console;

module.exports = startServer({
rootDir: __dirname,
document,
coreConfig,
siteConfig,
routes,
onStart: (app) => {
app.set('trust proxy', 'loopback, linklocal, uniquelocal');
},
}).then(() => log('Website started!')).catch(e => setImmediate(() => { throw e; }));
29 changes: 29 additions & 0 deletions services/example-website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@parameter1/base-cms-example-website",
"version": "2.46.2",
"description": "Example BaseCMS website.",
"main": "src/index.js",
"author": "Jacob Bare <[email protected]>",
"repository": "https://github.com/parameter1/base-cms/tree/master/services/example-website",
"license": "MIT",
"private": true,
"scripts": {
"dev": "basecms-website dev index.js",
"build": "basecms-website build",
"compile": "basecms-marko-compile compile --dir ./ --silent true",
"lint": "yarn lint:js && yarn lint:css",
"lint:js": "eslint --ext .js --ext .vue --max-warnings 5 --ignore-path ../../.eslintignore ./",
"lint:css": "stylelint ./**/*.scss --max-warnings 5",
"test": "yarn lint && yarn compile && yarn build"
},
"dependencies": {
"@parameter1/base-cms-marko-core": "^2.46.0",
"@parameter1/base-cms-marko-web": "^2.46.1",
"@parameter1/base-cms-marko-web-theme-default": "^2.45.0",
"@parameter1/base-cms-object-path": "^2.45.0",
"@parameter1/base-cms-utils": "^2.22.2",
"@parameter1/base-cms-web-cli": "^2.46.2",
"graphql": "^14.7.0",
"graphql-tag": "^2.12.5"
}
}
15 changes: 15 additions & 0 deletions services/example-website/server/components/document.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<marko-web-document ...input>
<@head>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<${input.head} />
</@head>
<@above-container>
<${input.aboveContainer} />
</@above-container>
<@below-container>
<${input.belowContainer} />
</@below-container>
</marko-web-document>
14 changes: 14 additions & 0 deletions services/example-website/server/components/marko.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"<site-document>": {
"template": "./document.marko",
"<head>": {},
"<above-container>": {},
"<container>": {
"<above-page>": {},
"<page>": {},
"<below-page>": {}
},
"<below-container>": {},
"<foot>": {}
}
}
5 changes: 5 additions & 0 deletions services/example-website/server/marko.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"taglib-imports": [
"./components/marko.json"
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
5 changes: 5 additions & 0 deletions services/example-website/server/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# www.robotstxt.org/
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449

User-agent: *
Disallow: /
1 change: 1 addition & 0 deletions services/example-website/server/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
7 changes: 7 additions & 0 deletions services/example-website/server/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const index = require('../templates/index');

module.exports = (app) => {
app.get('/', (_, res) => {
res.marko(index);
});
};
6 changes: 6 additions & 0 deletions services/example-website/server/styles/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import "../../node_modules/@parameter1/base-cms-marko-web-theme-default/scss/theme";

body {
-webkit-font-smoothing: antialiased;
letter-spacing: .25px;
}
9 changes: 9 additions & 0 deletions services/example-website/server/templates/index.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<marko-web-default-page-layout
type="test"
title="Test Page"
description="This is a test page."
>
<@page>
<h1>Hello World!</h1>
</@page>
</marko-web-default-page-layout>

0 comments on commit f23ae4a

Please sign in to comment.