-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Gleb Khmyznikov <gleb.khmyznikov@gmail.com> Co-authored-by: Jaylyn Barbee <jaylyn.1b@gmail.com> Co-authored-by: Jaylyn Barbee <51131738+Jaylyn-Barbee@users.noreply.github.com> Co-authored-by: Nikola Metulev <nmetulev@users.noreply.github.com> Co-authored-by: Mara'ah Lee <maraahlee@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adolf Daniel <10156724+adolfdaniel@users.noreply.github.com> Co-authored-by: Justin Willis (HE / HIM) <juwillis@microsoft.com> Co-authored-by: Zach Teutsch <88554871+zateutsch@users.noreply.github.com> Co-authored-by: Beth Pan <xupa@microsoft.com> Co-authored-by: vipul-bhojwani <67650372+vipul-bhojwani@users.noreply.github.com> Co-authored-by: Amrutha Srinivasan <amrutha.srinivasan95@gmail.com> Co-authored-by: Federico Navarrete <darklord.navarrete@gmail.com> Co-authored-by: Toby Liu <ybot1122@gmail.com> Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com> Co-authored-by: Amrutha Srinivasan <amsrin@microsoft.com> Co-authored-by: Jonas Thelemann <e-mail@jonas-thelemann.de> Co-authored-by: Siraj Chokshi <19193347+SirajChokshi@users.noreply.github.com>
- Loading branch information
1 parent
891c5b1
commit a4f7bc4
Showing
49 changed files
with
7,603 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,84 @@ | ||
name: PWABuilder CLI Main CI/CD | ||
|
||
on: | ||
push: | ||
paths: | ||
-"apps/cli/**" | ||
branches: | ||
-main | ||
-starter-cli-dev | ||
pull_request: | ||
paths: | ||
-"apps/cli/**" | ||
branches: | ||
-main | ||
-starter-cli-dev | ||
workflow_dispatch: | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: apps/cli | ||
|
||
outputs: | ||
latest-version: ${{steps.latest-version.outputs.version}} | ||
package-version: ${{steps.package-version.outputs.current-version}} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Get latest version from npm | ||
id: latest-version | ||
run: echo ::set-output name=version::$(npm show @pwabuilder/cli version) | ||
|
||
- name: Get current package version | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@master | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: version | ||
if: needs.version.outputs.latest-version != needs.version.outputs.package-version | ||
defaults: | ||
run: | ||
working-directory: apps/cli | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Replace tokens | ||
# You may pin to the exact commit or the version. | ||
# uses: cschleiden/replace-tokens@4f7e3d67f3ff2317ae650842145cdbaefba65189 | ||
uses: cschleiden/replace-tokens@v1.1 | ||
with: | ||
files: '["**/usage-analytics.ts"]' | ||
env: | ||
ANALYTICS_CODE: ${{secrets.CLI_ANALYTICS_CODE}} | ||
|
||
- name: Build | ||
run: | | ||
npm install | ||
- name: Publish | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }} | ||
name: PWABuilder CLI Main CI/CD | ||
|
||
on: | ||
push: | ||
paths: | ||
-"apps/cli/**" | ||
branches: | ||
-main | ||
-starter-cli-dev | ||
pull_request: | ||
paths: | ||
-"apps/cli/**" | ||
branches: | ||
-main | ||
-starter-cli-dev | ||
workflow_dispatch: | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: apps/cli | ||
|
||
outputs: | ||
latest-version: ${{steps.latest-version.outputs.version}} | ||
package-version: ${{steps.package-version.outputs.current-version}} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Get latest version from npm | ||
id: latest-version | ||
run: echo ::set-output name=version::$(npm show @pwabuilder/cli version) | ||
|
||
- name: Get current package version | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@master | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: version | ||
if: needs.version.outputs.latest-version != needs.version.outputs.package-version | ||
defaults: | ||
run: | ||
working-directory: apps/cli | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Replace tokens | ||
# You may pin to the exact commit or the version. | ||
# uses: cschleiden/replace-tokens@4f7e3d67f3ff2317ae650842145cdbaefba65189 | ||
uses: cschleiden/replace-tokens@v1.1 | ||
with: | ||
files: '["**/usage-analytics.ts"]' | ||
env: | ||
ANALYTICS_CODE: ${{secrets.CLI_ANALYTICS_CODE}} | ||
|
||
- name: Build | ||
run: | | ||
npm install | ||
- name: Publish | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
layout: post | ||
title: Use the PWABuilder CLI to Create a New Progressive Web App | ||
excerpt: Announcing PWABuilder's new CLI. Create, develop, and test from an easy-to-use PWA template. | ||
description: Announcing PWABuilder's new CLI. Create, develop, and test from an easy-to-use PWA template. | ||
date: 2023-04-19 | ||
updatedDate: 2023-04-19 | ||
trending: true | ||
featured: true | ||
image: | ||
isPost: true | ||
backUrl: '/' | ||
author: | ||
name: Zach Teutsch | ||
twitter: https://twitter.com/devteutsch | ||
title: PWABuilder Engineer | ||
tags: | ||
- CLI | ||
- PWA Starter | ||
- PWA | ||
- PWA template | ||
--- | ||
|
||
PWABuilder is launching a brand new CLI that can create a new templated [Progressive Web App](https://docs.pwabuilder.com/#/home/pwa-intro) for you and have you developing in just seconds. | ||
The CLI makes use of our existing [PWA Starter template](https://docs.pwabuilder.com/#/home/pwa-intro) to give you a lightweight groundwork to start building your first progressive web app on. We wanted to make sure that developers can dive in with development as quickly and as smoothly as possible. | ||
|
||
You’ll need [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to get started, and you can install the CLI globally with this command: | ||
|
||
``` | ||
npm install -g @pwabuilder/cli | ||
``` | ||
|
||
From there, it’s just one command to create your first app: | ||
|
||
``` | ||
pwa create my-first-pwa | ||
``` | ||
|
||
<img src="pwa-create.png.png" alt="PWABuilder CLI create command output after executing."></img> | ||
|
||
And then one more command to start running and developing your app, with live-reload for changes! | ||
|
||
``` | ||
pwa start | ||
``` | ||
|
||
Your PWA will then open in the browser window! | ||
|
||
<img src="open-pwa.png" alt="PWA Starter open in a new browser window."></img> | ||
|
||
|
||
For more guidance on using the CLI, check out our documentation [here.](https://docs.pwabuilder.com/#/starter/quick-start) For feedback and issues, head over to our [Github repo](https://github.com/pwa-builder/PWABuilder). We’re always open ideas and direct contributions from the community! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# PWABuilder CLI | ||
|
||
The [PWABuilder](https://www.pwabuilder.com/) CLI allows you to create a new Progressive Web App from the command line. | ||
|
||
## Installing | ||
|
||
To install with npm: | ||
|
||
`npm install -g @pwabuilder/cli` | ||
|
||
The `-g` flag indicates a global installation and will allow you to use the CLI from any directory. | ||
|
||
## Basic Usage | ||
|
||
## create | ||
|
||
The CLI's primary purpose to create new Progressive Web Apps. To create a new app, open a command line of your choice and run: | ||
|
||
`pwa create` | ||
|
||
This command will prompt you for a name, but you can skip prompting by providing a name: | ||
|
||
`pwa create <app-name>` | ||
|
||
### Using Templates | ||
|
||
PWABuilder currently offers two different PWA templates: | ||
|
||
* **default** - The original PWA Starter template. This template has [full documentation]() available and is our recommended choice. | ||
* **basic** - A simplified version of the PWA Starter template. This template has fewer dependencies and is closer to VanillaJS than the default template. | ||
|
||
You can specify a template with the `-t|--template` option: | ||
|
||
`pwa create <app-name> -t=basic` | ||
|
||
## start | ||
|
||
When run from a valid PWA Starter directory, the start command will use Vite to host your PWA on a development server: | ||
|
||
`pwa start` | ||
|
||
You can pass arguments to vite with the `--viteArgs` options: | ||
|
||
`pwa start --viteArgs="<argument string here>"` | ||
|
||
See [Vite's Config Reference](https://vitejs.dev/config/) for more details. | ||
|
||
## build | ||
|
||
When run from a valid PWA Starter directory, the build command will use Vite to build and pack your app for production: | ||
|
||
`pwa build` | ||
|
||
You can pass arguments to Vite with the `--viteArgs` options: | ||
|
||
`pwa build --viteArgs="<argument string here>"` | ||
|
||
See [Vite's Config Reference](https://vitejs.dev/config/) for more details. | ||
|
||
## Resources | ||
|
||
* [PWABuilder Website](https://www.pwabuilder.com/) | ||
|
||
* [Full PWABuilder Documentation](https://docs.pwabuilder.com/#/) | ||
|
||
* [PWA Starter Documentation](https://docs.pwabuilder.com/#/starter/quick-start) |
Oops, something went wrong.