Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web components step 1 #106

Open
wants to merge 20 commits into
base: web-components-step-1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,8 @@ concurrency:
cancel-in-progress: true

jobs:
e2e-github-pages:
name: e2e test github page
if: github.event.pull_request.base.ref == 'web-components-step-5'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: yarn install
- name: Run cypress test
run: yarn cypress run
e2e:
name: e2e tests
if: github.event.pull_request.base.ref != 'web-components-step-5'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -38,4 +23,4 @@ jobs:
- name: Build project
run: yarn build
- name: Run e2e tests
run: yarn test
run: yarn test
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ci-check": "yarn lint && yarn lint:styles",
"clean": "rimraf dist",
"lint": "eslint src",
"lint:styles": "stylelint '**/*.{css,scss}'",
"lint:styles": "stylelint **/*.{css,scss}",
"start": "webpack serve --config ./config/webpack-dev.config.js",
"test": "start-server-and-test 'http-server -c-1 dist --silent' 8080 'cypress run'"
},
Expand All @@ -28,7 +28,7 @@
"cypress": "^9.1.1",
"cypress-wait-until": "^1.7.2",
"dotenv": "^8.2.0",
"eslint": "^6.8.0",
"eslint": "^8.4.1",
"eslint-config-airbnb": "^17.0.0",
"eslint-config-airbnb-base": "^13.0.0",
"eslint-config-prettier": "^5.0.0",
Expand Down Expand Up @@ -62,4 +62,4 @@
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.1.0"
}
}
}
3 changes: 3 additions & 0 deletions src/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
import '../scss/index.scss';
import '../scss/app.scss';
import '@carbon/ibmdotcom-web-components/es/components/button-group/index.js';
import '@carbon/ibmdotcom-web-components/es/components/dotcom-shell/index.js';
9 changes: 9 additions & 0 deletions src/assets/scss/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import 'carbon-components/scss/globals/scss/css--reset';
@import '@carbon/type/scss/font-face/mono';
@import '@carbon/type/scss/font-face/sans';
@import '@carbon/grid/scss/grid';
@import '@carbon/themes/scss/themes';

@include carbon--font-face-mono();
@include carbon--font-face-sans();
@include carbon--type-reset();
9 changes: 8 additions & 1 deletion src/assets/scss/index.scss
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
// Tutorial styles will go here
@import 'carbon-components/scss/globals/scss/css--reset';
@import '@carbon/type/scss/font-face/mono';
@import '@carbon/type/scss/font-face/sans';
@import '@carbon/grid/scss/grid';
@import '@carbon/themes/scss/themes';
@include carbon--font-face-mono();
@include carbon--font-face-sans();
@include carbon--type-reset();
57 changes: 56 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,69 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />

<link rel="icon" href="//www.ibm.com/favicon.ico" />

<meta name="dcterms.date" content="YYYY-MM-DD" /> // replace with today's date
<meta name="dcterms.rights" content="© Copyright IBM Corp. 2021" />
<meta name="geo.country" content="US" />
<meta name="robots" content="index,follow" />
<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Carbon for IBM.com Tutorial</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="This is an example page for the Carbon for IBM.com Tutorial" />
<script>
window.digitalData = {
page: {
category: {
primaryCategory: '', // e.g. SB03
},
pageInfo: {
effectiveDate: '', // e.g. 2014-11-19
expiryDate: '', // e.g. 2017-11-19
language: 'en-US', // e.g. en-US
publishDate: '', // e.g. 2014-11-19
publisher: '', // e.g. IBM Corporation
version: 'Carbon for IBM.com',
ibm: {
contentDelivery: '', // e.g. ECM/Filegen
contentProducer: '', // e.g. ECM/IConS Adopter 34 - GS83J2343G3H3ERG - 11/19/2014 05:14:02 PM
country: 'US', // e.g. US
industry: '', // e.g. B,U
owner: '', // e.g. Some Person/City/IBM
siteID: '', // e.g. MySiteID
subject: '', // e.g. SW492
type: '', // e.g CT305
},
},
},

}
var params = new URLSearchParams(window.location.search);

if(params.has('lc') && params.has('cc')) {
var currentLang = params.get('lc') + '-' + params.get('cc').toUpperCase();
document.getElementsByTagName("html")[0].setAttribute("lang", currentLang);
digitalData.page.pageInfo.language = currentLang;
digitalData.page.pageInfo.ibm.country = params.get('cc').toUpperCase();
};
</script>
<script
src="//1.www.s81c.com/common/stats/ibm-common.js"
type="text/javascript"
async="async"
></script>
<link rel="alternate" hreflang="en-us" href="./index.html?cc=us&lc=en" />
<link rel="alternate" hreflang="fr-ca" href="./index.html?cc=ca&lc=fr" />
<link rel="alternate" hreflang="ko-kr" href="./index.html?cc=kr&lc=ko" />
<link rel="alternate" hreflang="ja-jp" href="./index.html?cc=jp&lc=ja" />
</head>

<body>
Hello Carbon for IBM.com! Well, not quite yet. This is the starting point for the Carbon for IBM.com tutorial.
<dds-dotcom-shell-container>
<main>Hello World!</main>
</dds-dotcom-shell-container>
</body>
</html>
Loading