From 6483777bb8e079709755d151ce921bac8786acaf Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Mon, 7 May 2018 16:06:38 -0700 Subject: [PATCH] Make sure access config is correct for publishing Add READMEs to base and icon --- packages/base/README.md | 2 ++ packages/base/package.json | 3 ++ packages/button/package.json | 3 ++ packages/checkbox/package.json | 3 ++ packages/fab/package.json | 3 ++ packages/icon/README.md | 61 ++++++++++++++++++++++++++++++++++ packages/icon/package.json | 3 ++ packages/radio/package.json | 3 ++ packages/ripple/package.json | 3 ++ packages/switch/package.json | 3 ++ 10 files changed, 87 insertions(+) create mode 100644 packages/base/README.md create mode 100644 packages/icon/README.md diff --git a/packages/base/README.md b/packages/base/README.md new file mode 100644 index 000000000..64685a87a --- /dev/null +++ b/packages/base/README.md @@ -0,0 +1,2 @@ +# mwc-base +A suite of shared libraries and utility functions for [Material Components](https://material.io/components/)[Web Components](https://www.webcomponents.org/introduction) \ No newline at end of file diff --git a/packages/base/package.json b/packages/base/package.json index f036e757e..6ebac730a 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -9,5 +9,8 @@ "license": "Apache-2.0", "dependencies": { "@polymer/lit-element": "^0.4.0" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/button/package.json b/packages/button/package.json index f2d643227..e674af672 100644 --- a/packages/button/package.json +++ b/packages/button/package.json @@ -17,5 +17,8 @@ }, "devDependencies": { "@material/mwc-sass-render": "^0.0.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/checkbox/package.json b/packages/checkbox/package.json index 5003e6436..3db967298 100644 --- a/packages/checkbox/package.json +++ b/packages/checkbox/package.json @@ -15,5 +15,8 @@ }, "devDependencies": { "@material/mwc-sass-render": "^0.0.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/fab/package.json b/packages/fab/package.json index ddc6bda8f..dd1854c1d 100644 --- a/packages/fab/package.json +++ b/packages/fab/package.json @@ -17,5 +17,8 @@ }, "devDependencies": { "@material/mwc-sass-render": "^0.0.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/icon/README.md b/packages/icon/README.md new file mode 100644 index 000000000..919724dac --- /dev/null +++ b/packages/icon/README.md @@ -0,0 +1,61 @@ +# mwc-icon +A [Material Components](https://material.io/components/) icon implementation using [Web Components](https://www.webcomponents.org/introduction) + +## Getting started + + * The easiest way to try out mwc-icon is to use one of these online tools: + +* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/lit-element-example?file=index.js), [Glitch](https://glitch.com/edit/#!/hello-lit-element?path=index.html) + +* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/zezilad/edit?html,output), +[CodePen](https://codepen.io/sorvell/pen/BxZgPN). + +* You can also copy [this HTML file](https://gist.githubusercontent.com/sorvell/48f4b7be35c8748e8f6db5c66d36ee29/raw/2427328cf1ebae5077902a6bff5ddd8db45e83e4/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)). + +* When you're ready to use mwc-icon in a project, install it via [npm](https://www.npmjs.com/). To run the project in the browser, a module-compatible toolctain is required. We recommend installing the [Polymer CLI](https://github.com/Polymer/polymer-cli) and using its development server as follows. + + 1. Ensure the webcomponents polyfills are included in your HTML page + + - Install webcomponents polyfills + + ```npm i @webcomponents/webcomponentsjs``` + + - Add webcomponents polyfills to your HTML page + + `````` + + 1. Add mwc-icon to your project: + + ```npm i @material/mwc-icon``` + + 1. Import the mwc-icon definition into your HTML page: + + `````` + + Or into your module script: + + ```import {Icon} from "@material/mwc-icon"``` + + 1. Create an instance of mwc-icon in your HTML page, or via any framework that [supports rendering Custom Elements](https://custom-elements-everywhere.com/): + + ```sentiment_very_satisfied``` + + 1. Install the Polymer CLI: + + ```npm i -g polymer-cli@next``` + + 1. Run the development server and open a browser pointing to its URL: + + ```polymer serve``` + + > mwc-icon is published on [npm](https://www.npmjs.com/package/@material/mwc-icon) using JavaScript Modules. + This means it can take advantage of the standard native JavaScript module loader available in all current major browsers. + > + > However, since mwc-icon uses npm convention to reference dependencies by name, a light transform to rewrite specifiers to URLs is required to get it to run in the browser. The polymer-cli's development server `polymer serve` automatically handles this transform. + + Tools like [WebPack](https://webpack.js.org/) and [Rollup](https://rollupjs.org/) can also be used to serve and/or bundle mwc-icon. + +## Supported Browsers + +The last 2 versions of all modern browsers are supported, including +Chrome, Safari, Opera, Firefox, Edge. In addition, Internet Explorer 11 is also supported. \ No newline at end of file diff --git a/packages/icon/package.json b/packages/icon/package.json index 208aeae48..cce7f8909 100644 --- a/packages/icon/package.json +++ b/packages/icon/package.json @@ -14,5 +14,8 @@ }, "devDependencies": { "@material/mwc-sass-render": "^0.0.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/radio/package.json b/packages/radio/package.json index 065618f7b..6789bb45d 100644 --- a/packages/radio/package.json +++ b/packages/radio/package.json @@ -15,5 +15,8 @@ }, "devDependencies": { "@material/mwc-sass-render": "^0.0.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/ripple/package.json b/packages/ripple/package.json index 3bf391c9b..ef85a6dc7 100644 --- a/packages/ripple/package.json +++ b/packages/ripple/package.json @@ -15,5 +15,8 @@ }, "devDependencies": { "@material/mwc-sass-render": "^0.0.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/switch/package.json b/packages/switch/package.json index f4033ed6f..fc6b23ff7 100644 --- a/packages/switch/package.json +++ b/packages/switch/package.json @@ -15,5 +15,8 @@ "devDependencies": { "@material/mwc-sass-render": "^0.0.1", "@material/switch": "^0.35.0" + }, + "publishConfig": { + "access": "public" } }