Skip to content

Commit 7e97275

Browse files
committed
chore: updating server selector related components and logic
1 parent 7b1d375 commit 7e97275

18 files changed

+2059
-1908
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
language: node_js
22
node_js: stable
3-
sudo: required
43
addons:
54
chrome: stable
6-
install:
7-
- npm ci
8-
- npm i -D @api-components/api-model-generator
95
script:
106
- npm test
117
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run test:sl; fi

demo/api-console-master-styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ html {
1313

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

16-
--arc-font-body1-font-size: 15px;
16+
--arc-font-body1-font-size: 16px;
1717
--arc-font-body1-font-weight: 400;
1818
--arc-font-body1-line-height: 20px;
1919
--arc-font-code-family: 'Roboto Mono', 'Consolas', 'Menlo', monospace;

demo/standalone/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ApicApplication extends DemoBase {
3131
oauth2clientid="821776164331-rserncqpdsq32lmbf5cfeolgcoujb6fm.apps.googleusercontent.com"
3232
rearrangeEndpoints
3333
>
34+
<!-- Toolbar items -->
3435
<anypoint-icon-button
3536
slot="toolbar"
3637
aria-label="Activate to open API selection menu"
@@ -39,6 +40,12 @@ class ApicApplication extends DemoBase {
3940
>
4041
<span class="icon">${moreVert}</span>
4142
</anypoint-icon-button>
43+
44+
<!-- Server selector items -->
45+
<div class="other-section" slot="custom-base-uri">Other options</div>
46+
<anypoint-item slot="custom-base-uri"
47+
value="http://mocking.com"
48+
>Mocking service</anypoint-item>
4249
</api-console-app>
4350
${this.apiSelectorTemplate()}
4451
`;

demo/standalone/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
margin: 0;
1414
padding: 0;
1515
font-family: 'Roboto', 'Noto', sans-serif;
16-
font-size: 15px;
16+
font-size: 16px;
1717
color: #424242;
1818
height: 100%;
1919
}
@@ -29,6 +29,12 @@
2929
height: 24px;
3030
fill: currentColor;
3131
}
32+
33+
.other-section {
34+
margin: 16px 12px;
35+
color: #757575;
36+
font-size: 0.95rem;
37+
}
3238
</style>
3339
</head>
3440

package-lock.json

Lines changed: 909 additions & 474 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@
3333
"@advanced-rest-client/oauth-authorization": "^4.0.2",
3434
"@advanced-rest-client/xhr-simple-request": "^3.0.0",
3535
"@anypoint-web-components/anypoint-button": "^1.0.14",
36-
"@api-components/amf-helper-mixin": "^4.0.24",
36+
"@api-components/amf-helper-mixin": "^4.1.1",
3737
"@api-components/api-console-ext-comm": "^3.0.0",
38-
"@api-components/api-documentation": "^4.1.1",
38+
"@api-components/api-documentation": "^5.0.0",
3939
"@api-components/api-navigation": "^4.1.0",
40-
"@api-components/api-request-panel": "^4.1.2",
40+
"@api-components/api-request-panel": "^5.0.1",
4141
"@api-components/raml-aware": "^3.0.0",
4242
"@polymer/app-layout": "^3.1.0",
4343
"@polymer/iron-media-query": "^3.0.0",
4444
"@polymer/paper-toast": "^3.0.0",
4545
"lit-element": "^2.3.1",
46-
"lit-element-router": "^1.2.5",
4746
"lit-html": "^1.2.1"
4847
},
4948
"devDependencies": {
@@ -58,32 +57,33 @@
5857
"@api-components/api-model-generator": "^0.2.8",
5958
"@commitlint/cli": "^8.3.5",
6059
"@commitlint/config-conventional": "^8.3.4",
61-
"@open-wc/building-rollup": "^0.22.11",
62-
"@open-wc/testing": "^2.5.8",
63-
"@open-wc/testing-karma": "^3.3.9",
60+
"@open-wc/building-rollup": "^1.2.0",
61+
"@open-wc/testing": "^2.5.15",
62+
"@open-wc/testing-karma": "^3.3.17",
6463
"@polymer/gen-typescript-declarations": "^1.6.2",
6564
"@polymer/iron-test-helpers": "^3.0.0",
6665
"amf-client-js": "^4.0.6",
6766
"body-parser": "^1.19.0",
6867
"deepmerge": "^4.2.1",
69-
"es-dev-server": "^1.46.0",
68+
"es-dev-server": "^1.47.0",
7069
"esm": "^3.2.25",
7170
"express": "^4.17.1",
7271
"fs-extra": "^9.0.0",
7372
"husky": "^4.2.1",
74-
"karma": "^4.4.1",
7573
"lint-staged": "^10.1.0",
7674
"multer": "^1.4.2",
7775
"node-cache": "^5.1.0",
7876
"rimraf": "^3.0.1",
79-
"rollup": "^2.3.1",
77+
"rollup": "^2.7.3",
8078
"rollup-plugin-cpy": "^2.0.1",
81-
"rollup-plugin-postcss": "^2.5.0",
79+
"rollup-plugin-postcss": "^3.1.1",
8280
"sinon": "^9.0.1",
8381
"tmp": "0.1.0",
8482
"uglify-js": "^3.8.1",
8583
"unzipper": "^0.10.10",
86-
"uuid": "^7.0.2"
84+
"uuid": "^7.0.2",
85+
"typescript": "^3.8.3",
86+
"typescript-lit-html-plugin": "^0.9.0"
8787
},
8888
"scripts": {
8989
"update-types": "NODE_OPTIONS=--max_old_space_size=2048 gen-typescript-declarations --deleteExisting --outDir .",

rollup.config.js

Lines changed: 82 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,92 @@
11
// https://open-wc.org/building/building-rollup.html#configuration
22

3-
import { createCompatibilityConfig } from '@open-wc/building-rollup';
3+
import { createSpaConfig } from '@open-wc/building-rollup';
4+
import merge from 'deepmerge';
45
import path from 'path';
56
import cpy from 'rollup-plugin-cpy';
67
import postcss from 'rollup-plugin-postcss';
78

8-
const config = createCompatibilityConfig({
9+
const baseConfig = createSpaConfig({
10+
developmentMode: process.env.ROLLUP_WATCH === 'true',
11+
injectServiceWorker: false,
12+
});
13+
14+
export default merge(baseConfig, {
915
input: path.resolve(__dirname, 'index.html'),
1016
context: 'window',
11-
indexHTMLPlugin: {
12-
minify: {
13-
minifyJS: true,
14-
removeComments: true
15-
}
16-
}
17+
output: {
18+
sourcemap: false,
19+
},
20+
plugins: [
21+
postcss(),
22+
cpy({
23+
files: [
24+
path.join('demo', 'vendor.js'),
25+
],
26+
dest: 'dist',
27+
options: {
28+
parents: false,
29+
},
30+
}),
31+
cpy({
32+
files: [
33+
path.join('demo', 'models', '*.json'),
34+
],
35+
dest: path.join('dist', 'models'),
36+
options: {
37+
parents: false,
38+
},
39+
}),
40+
],
1741
});
1842

19-
// export default config;
20-
21-
config[0].context = 'window';
22-
config[1].context = 'window';
23-
24-
export default [
25-
{
26-
...config[0],
27-
plugins: [
28-
...config[0].plugins,
29-
postcss()
30-
]
31-
},
32-
{
33-
...config[1],
34-
plugins: [
35-
...config[1].plugins,
36-
postcss(),
37-
cpy({
38-
files: [
39-
path.join('demo', 'vendor.js'),
40-
],
41-
dest: 'dist',
42-
options: {
43-
parents: false,
44-
},
45-
}),
46-
cpy({
47-
files: [
48-
path.join('demo', 'models', '*.json'),
49-
],
50-
dest: path.join('dist', 'models'),
51-
options: {
52-
parents: false,
53-
},
54-
}),
55-
],
56-
},
57-
];
43+
// const config = createCompatibilityConfig({
44+
// input: path.resolve(__dirname, 'index.html'),
45+
// context: 'window',
46+
// indexHTMLPlugin: {
47+
// minify: {
48+
// minifyJS: true,
49+
// removeComments: true
50+
// }
51+
// }
52+
// });
53+
//
54+
// // export default config;
55+
//
56+
// config[0].context = 'window';
57+
// config[1].context = 'window';
58+
//
59+
// export default [
60+
// {
61+
// ...config[0],
62+
// plugins: [
63+
// ...config[0].plugins,
64+
// postcss()
65+
// ]
66+
// },
67+
// {
68+
// ...config[1],
69+
// plugins: [
70+
// ...config[1].plugins,
71+
// postcss(),
72+
// cpy({
73+
// files: [
74+
// path.join('demo', 'vendor.js'),
75+
// ],
76+
// dest: 'dist',
77+
// options: {
78+
// parents: false,
79+
// },
80+
// }),
81+
// cpy({
82+
// files: [
83+
// path.join('demo', 'models', '*.json'),
84+
// ],
85+
// dest: path.join('dist', 'models'),
86+
// options: {
87+
// parents: false,
88+
// },
89+
// }),
90+
// ],
91+
// },
92+
// ];

0 commit comments

Comments
 (0)