Skip to content

Commit

Permalink
feat: replace polymer CLI with web-dev-server
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrich authored and blackfalcon committed Nov 20, 2020
1 parent cb6921a commit 6e4774f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 30 deletions.
12 changes: 1 addition & 11 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const getVersionData = async () => {
versions['srChangelog'] = await latestVersion('@semantic-release/changelog');
versions['srGit'] = await latestVersion('@semantic-release/git');
versions['srNpm'] = await latestVersion('@semantic-release/npm');
versions['webDevServer'] = await latestVersion('@web/dev-server');
versions['autoprefixer'] = await latestVersion('autoprefixer');
versions['chalk'] = await latestVersion('chalk');
versions['concat'] = await latestVersion('concat');
Expand Down Expand Up @@ -364,7 +365,6 @@ Creating a Design System People Love.
let isGitRepo = false;
let isMainBranch = false;
let isBuilt = false;
let isPolymerInstalled = false;
let assetsAreCommitted = false;

if (!params.test) {
Expand All @@ -388,16 +388,6 @@ Creating a Design System People Love.
}
isMainBranch = true;

process.stdout.write(`\nSetting up Polymer`);
loadingLoop(() => isPolymerInstalled);
try {
await exec('npm i polymer polymer-cli -g', { cwd: params.dir });
log(chalk.green('\nPolymer successfully installed globally!'));
} catch ({ message }) {
log(chalk.red(message));
}
isPolymerInstalled = true;

process.stdout.write(`\nInstalling dependencies`);
loadingLoop(() => areDependenciesInstalled);
try {
Expand Down
8 changes: 4 additions & 4 deletions docs/gettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Auro WC-Generator makes it really easy to get started building HTML Custom E

When using the WC-Generator, you will get the following scaffolding:

1. Polymer server and demo page support
1. Dev server and demo page support
1. Lit-Element web component scaffolding js file
1. Sass and PostCSS pre-configured support
1. Sass template Auro Design Tokens, breakpoints and core CSS ready
Expand Down Expand Up @@ -37,13 +37,13 @@ By default, the WC-Generator will assume `auro` as the namespace for the WC, `@a

When building the new web component, there are two servers you can use to test your component.

Running `npm run serve` will start the polymer server where you can view your web component demo at http://localhost:3001/demo/.
Running `npm run serve` will start the dev server where you can view your web component demo at http://localhost:3001/demo/.

Running `npm run bundle:test` will start a Rollup server of bundled assets that you can view at http://localhost:10001/docs/. You can use the server to test the bundled output in modern and legacy browsers.

## Editing your Polymer demo
## Editing your demo

While building a web component, being able to see the component in the browser is essential. Located in `/demo/index.html` is a Polymer pre-configured demo file. Use the following pattern to set up your web component in the demo HTML.
While building a web component, being able to see the component in the browser is essential. Located in `/demo/index.html` is a pre-configured demo file. Use the following pattern to set up your web component in the demo HTML.

```html
<demo-snippet>
Expand Down
1 change: 0 additions & 1 deletion template/.npmignore.temp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
demo/
gulpfile.js
index.html
polymer.json
scripts/
test/

Expand Down
4 changes: 1 addition & 3 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ Please be sure to review the [contribution guidelines](https://auro.alaskaair.co

### Start development environment

Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open three different shell sessions. One is for the **Gulp tasks**, the second is for a series of **npm tasks** and the last is to run the **Polymer server**.

**Peer dependency:** Please make sure Polymer is installed globally in order to run the Polymer server. See [Auro Component Development Details](https://github.com/AlaskaAirlines/auro_docs/blob/master/src/TECH_DETAILS.md) for more information.
Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open three different shell sessions. One is for the **Gulp tasks**, the second is for a series of **npm tasks** and the last is to run the **dev server**.

```shell
// shell terminal one
Expand Down
2 changes: 1 addition & 1 deletion template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!--
Visit demo/index.html to see live examples of your element running.
This page will automatically redirect you there when run in the browser
with `polymer serve`.
with `npm run serve`.
-->
</body>
</html>
4 changes: 2 additions & 2 deletions template/package.temp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
"@open-wc/testing": "^[openwcTesting]",
"@open-wc/testing-karma": "^[openwcKarma]",
"@polymer/iron-demo-helpers": "^3.1.0",
"@polymer/polymer": "^3.3.1",
"@rollup/plugin-alias": "^[rollupPluginAlias]",
"@rollup/plugin-babel": "^[rollupPluginBabel]",
"@rollup/plugin-commonjs": "^[rollupPluginCommonJs]",
"@rollup/plugin-node-resolve": "^[rollupPluginNode]",
"@semantic-release/changelog": "^[srChangelog]",
"@semantic-release/git": "^[srGit]",
"@semantic-release/npm": "^[srNpm]",
"@web/dev-server": "^[webDevServer]",
"@webcomponents/webcomponentsjs": "^[webcomponentsjs]",
"autoprefixer": "^[autoprefixer]",
"babel-loader": "^[babelLoader]",
Expand Down Expand Up @@ -115,7 +115,7 @@
"sassBuild:component": "node-sass ./src/ --output ./src/",
"sassBuild:watch": "nodemon -e scss --watch src --exec npm run sassBuild:dev",
"postCss:component": "node ./scripts/postCss.js",
"serve": "polymer serve --port 3001 --hostname 0.0.0.0"
"serve": "web-dev-server --open demo/ --node-resolve --watch"
},
"husky": {
"hooks": {
Expand Down
8 changes: 0 additions & 8 deletions template/polymer.json

This file was deleted.

0 comments on commit 6e4774f

Please sign in to comment.