Skip to content

Commit

Permalink
chore: updating server selector related components and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodek committed Apr 28, 2020
1 parent 7b1d375 commit 7e97275
Show file tree
Hide file tree
Showing 18 changed files with 2,059 additions and 1,908 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
language: node_js
node_js: stable
sudo: required
addons:
chrome: stable
install:
- npm ci
- npm i -D @api-components/api-model-generator
script:
- npm test
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run test:sl; fi
Expand Down
2 changes: 1 addition & 1 deletion demo/api-console-master-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ html {

--anypoint-listbox-background-color: #fff;

--arc-font-body1-font-size: 15px;
--arc-font-body1-font-size: 16px;
--arc-font-body1-font-weight: 400;
--arc-font-body1-line-height: 20px;
--arc-font-code-family: 'Roboto Mono', 'Consolas', 'Menlo', monospace;
Expand Down
7 changes: 7 additions & 0 deletions demo/standalone/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class ApicApplication extends DemoBase {
oauth2clientid="821776164331-rserncqpdsq32lmbf5cfeolgcoujb6fm.apps.googleusercontent.com"
rearrangeEndpoints
>
<!-- Toolbar items -->
<anypoint-icon-button
slot="toolbar"
aria-label="Activate to open API selection menu"
Expand All @@ -39,6 +40,12 @@ class ApicApplication extends DemoBase {
>
<span class="icon">${moreVert}</span>
</anypoint-icon-button>
<!-- Server selector items -->
<div class="other-section" slot="custom-base-uri">Other options</div>
<anypoint-item slot="custom-base-uri"
value="http://mocking.com"
>Mocking service</anypoint-item>
</api-console-app>
${this.apiSelectorTemplate()}
`;
Expand Down
8 changes: 7 additions & 1 deletion demo/standalone/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
margin: 0;
padding: 0;
font-family: 'Roboto', 'Noto', sans-serif;
font-size: 15px;
font-size: 16px;
color: #424242;
height: 100%;
}
Expand All @@ -29,6 +29,12 @@
height: 24px;
fill: currentColor;
}

.other-section {
margin: 16px 12px;
color: #757575;
font-size: 0.95rem;
}
</style>
</head>

Expand Down
1,383 changes: 909 additions & 474 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@
"@advanced-rest-client/oauth-authorization": "^4.0.2",
"@advanced-rest-client/xhr-simple-request": "^3.0.0",
"@anypoint-web-components/anypoint-button": "^1.0.14",
"@api-components/amf-helper-mixin": "^4.0.24",
"@api-components/amf-helper-mixin": "^4.1.1",
"@api-components/api-console-ext-comm": "^3.0.0",
"@api-components/api-documentation": "^4.1.1",
"@api-components/api-documentation": "^5.0.0",
"@api-components/api-navigation": "^4.1.0",
"@api-components/api-request-panel": "^4.1.2",
"@api-components/api-request-panel": "^5.0.1",
"@api-components/raml-aware": "^3.0.0",
"@polymer/app-layout": "^3.1.0",
"@polymer/iron-media-query": "^3.0.0",
"@polymer/paper-toast": "^3.0.0",
"lit-element": "^2.3.1",
"lit-element-router": "^1.2.5",
"lit-html": "^1.2.1"
},
"devDependencies": {
Expand All @@ -58,32 +57,33 @@
"@api-components/api-model-generator": "^0.2.8",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@open-wc/building-rollup": "^0.22.11",
"@open-wc/testing": "^2.5.8",
"@open-wc/testing-karma": "^3.3.9",
"@open-wc/building-rollup": "^1.2.0",
"@open-wc/testing": "^2.5.15",
"@open-wc/testing-karma": "^3.3.17",
"@polymer/gen-typescript-declarations": "^1.6.2",
"@polymer/iron-test-helpers": "^3.0.0",
"amf-client-js": "^4.0.6",
"body-parser": "^1.19.0",
"deepmerge": "^4.2.1",
"es-dev-server": "^1.46.0",
"es-dev-server": "^1.47.0",
"esm": "^3.2.25",
"express": "^4.17.1",
"fs-extra": "^9.0.0",
"husky": "^4.2.1",
"karma": "^4.4.1",
"lint-staged": "^10.1.0",
"multer": "^1.4.2",
"node-cache": "^5.1.0",
"rimraf": "^3.0.1",
"rollup": "^2.3.1",
"rollup": "^2.7.3",
"rollup-plugin-cpy": "^2.0.1",
"rollup-plugin-postcss": "^2.5.0",
"rollup-plugin-postcss": "^3.1.1",
"sinon": "^9.0.1",
"tmp": "0.1.0",
"uglify-js": "^3.8.1",
"unzipper": "^0.10.10",
"uuid": "^7.0.2"
"uuid": "^7.0.2",
"typescript": "^3.8.3",
"typescript-lit-html-plugin": "^0.9.0"
},
"scripts": {
"update-types": "NODE_OPTIONS=--max_old_space_size=2048 gen-typescript-declarations --deleteExisting --outDir .",
Expand Down
129 changes: 82 additions & 47 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,92 @@
// https://open-wc.org/building/building-rollup.html#configuration

import { createCompatibilityConfig } from '@open-wc/building-rollup';
import { createSpaConfig } from '@open-wc/building-rollup';
import merge from 'deepmerge';
import path from 'path';
import cpy from 'rollup-plugin-cpy';
import postcss from 'rollup-plugin-postcss';

const config = createCompatibilityConfig({
const baseConfig = createSpaConfig({
developmentMode: process.env.ROLLUP_WATCH === 'true',
injectServiceWorker: false,
});

export default merge(baseConfig, {
input: path.resolve(__dirname, 'index.html'),
context: 'window',
indexHTMLPlugin: {
minify: {
minifyJS: true,
removeComments: true
}
}
output: {
sourcemap: false,
},
plugins: [
postcss(),
cpy({
files: [
path.join('demo', 'vendor.js'),
],
dest: 'dist',
options: {
parents: false,
},
}),
cpy({
files: [
path.join('demo', 'models', '*.json'),
],
dest: path.join('dist', 'models'),
options: {
parents: false,
},
}),
],
});

// export default config;

config[0].context = 'window';
config[1].context = 'window';

export default [
{
...config[0],
plugins: [
...config[0].plugins,
postcss()
]
},
{
...config[1],
plugins: [
...config[1].plugins,
postcss(),
cpy({
files: [
path.join('demo', 'vendor.js'),
],
dest: 'dist',
options: {
parents: false,
},
}),
cpy({
files: [
path.join('demo', 'models', '*.json'),
],
dest: path.join('dist', 'models'),
options: {
parents: false,
},
}),
],
},
];
// const config = createCompatibilityConfig({
// input: path.resolve(__dirname, 'index.html'),
// context: 'window',
// indexHTMLPlugin: {
// minify: {
// minifyJS: true,
// removeComments: true
// }
// }
// });
//
// // export default config;
//
// config[0].context = 'window';
// config[1].context = 'window';
//
// export default [
// {
// ...config[0],
// plugins: [
// ...config[0].plugins,
// postcss()
// ]
// },
// {
// ...config[1],
// plugins: [
// ...config[1].plugins,
// postcss(),
// cpy({
// files: [
// path.join('demo', 'vendor.js'),
// ],
// dest: 'dist',
// options: {
// parents: false,
// },
// }),
// cpy({
// files: [
// path.join('demo', 'models', '*.json'),
// ],
// dest: path.join('dist', 'models'),
// options: {
// parents: false,
// },
// }),
// ],
// },
// ];
Loading

0 comments on commit 7e97275

Please sign in to comment.