mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-23 09:59:12 +00:00
Compare commits
177 Commits
@now/pytho
...
@now/build
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8043e25d6d | ||
|
|
73b4e7aea4 | ||
|
|
de7e063c9b | ||
|
|
e7c30deee8 | ||
|
|
7464fac792 | ||
|
|
252363cce4 | ||
|
|
d7dceeb2a1 | ||
|
|
6b5b9e8b2f | ||
|
|
addd036149 | ||
|
|
7ca672a470 | ||
|
|
3af0e99689 | ||
|
|
b14068de8a | ||
|
|
c9437e714a | ||
|
|
c0aff5cf4a | ||
|
|
9110b14bb4 | ||
|
|
40e4b69267 | ||
|
|
6c4934dcc4 | ||
|
|
d64e54d61a | ||
|
|
0b75bf07f7 | ||
|
|
a861a8f3f7 | ||
|
|
6407b17b7f | ||
|
|
558463a988 | ||
|
|
1a133995b8 | ||
|
|
a83eecf674 | ||
|
|
a932ed65fa | ||
|
|
e2ae497762 | ||
|
|
89989719c2 | ||
|
|
8166b8e1e7 | ||
|
|
1ceeac498c | ||
|
|
1c47d1360d | ||
|
|
ddcd0918e9 | ||
|
|
573b6b8110 | ||
|
|
40039d7f9b | ||
|
|
dcb37e92f5 | ||
|
|
fe7f875549 | ||
|
|
a516ed6fb8 | ||
|
|
ca2c5f85ef | ||
|
|
adb5a01cc0 | ||
|
|
6b4d39ab4d | ||
|
|
07ce3d2e34 | ||
|
|
93ffcf487b | ||
|
|
3631f0f4cf | ||
|
|
b67b5be8a9 | ||
|
|
bf67b1a29e | ||
|
|
ed86473f74 | ||
|
|
399a3cd114 | ||
|
|
d0fd09810a | ||
|
|
f298f2e894 | ||
|
|
569200ae0e | ||
|
|
c91495338d | ||
|
|
7eed5574e0 | ||
|
|
91e6b85cec | ||
|
|
3ae83172ec | ||
|
|
7c51446e5e | ||
|
|
400a5c73e8 | ||
|
|
ec917ace69 | ||
|
|
f5e0afdd7e | ||
|
|
c1b4c62714 | ||
|
|
5e4bdfbe11 | ||
|
|
bd4a0cbd32 | ||
|
|
7ff9adc90e | ||
|
|
b279f1ffae | ||
|
|
344cc103ee | ||
|
|
83249b3685 | ||
|
|
79e7a9f477 | ||
|
|
b3dce70271 | ||
|
|
cff8d8b8a0 | ||
|
|
da892100d9 | ||
|
|
72e87ee6e4 | ||
|
|
3f9afad167 | ||
|
|
1527447914 | ||
|
|
9ca35df5fb | ||
|
|
05b2e2216c | ||
|
|
167fd5750a | ||
|
|
4a3cd7ec72 | ||
|
|
9aef718917 | ||
|
|
3cdc261802 | ||
|
|
5c71f672b3 | ||
|
|
dbc5f73984 | ||
|
|
1d269fffc8 | ||
|
|
cc146ba0f5 | ||
|
|
f8a2519838 | ||
|
|
1781376d47 | ||
|
|
d9fda14969 | ||
|
|
a4de9272e7 | ||
|
|
9b9037de91 | ||
|
|
8d18c65e3e | ||
|
|
e7d7de61b6 | ||
|
|
11927883c3 | ||
|
|
57d25b184b | ||
|
|
95f716fb3f | ||
|
|
8dd52605be | ||
|
|
4b9c6a2a2a | ||
|
|
17f92a5ad3 | ||
|
|
0aab7cc509 | ||
|
|
b39622b271 | ||
|
|
1e9aeee8e9 | ||
|
|
49fac0dfad | ||
|
|
a668df829f | ||
|
|
3d4ef1f825 | ||
|
|
f986daa1cc | ||
|
|
549c8777ba | ||
|
|
51d7242fda | ||
|
|
36db0e5bab | ||
|
|
99368b4248 | ||
|
|
95daf0e292 | ||
|
|
8bfa9c1a42 | ||
|
|
4208dc0466 | ||
|
|
00ae011b95 | ||
|
|
a770991a81 | ||
|
|
f80a6d6392 | ||
|
|
30777384ec | ||
|
|
0c719b7f6a | ||
|
|
ff18788b20 | ||
|
|
752ab39787 | ||
|
|
c1df8c8bd1 | ||
|
|
25fd1df35d | ||
|
|
d32ab1e0d9 | ||
|
|
a69c460760 | ||
|
|
b985853f15 | ||
|
|
94e607a93a | ||
|
|
f97a81fa14 | ||
|
|
6e28438eb4 | ||
|
|
8fcdf3f458 | ||
|
|
dbf0cc3562 | ||
|
|
27ccfa7e7a | ||
|
|
f37edbc670 | ||
|
|
b7943e83d2 | ||
|
|
300ed5b952 | ||
|
|
9e6ebfb3ec | ||
|
|
f49620790c | ||
|
|
84065688b5 | ||
|
|
5a1012fb0f | ||
|
|
4b6143c293 | ||
|
|
b6601b0d9a | ||
|
|
2870a1dd49 | ||
|
|
6249f7e293 | ||
|
|
6f9545e097 | ||
|
|
8095ba5cf9 | ||
|
|
e02128e5a3 | ||
|
|
2567b8c8b8 | ||
|
|
5bfcdec471 | ||
|
|
6609686a2b | ||
|
|
709aaf2285 | ||
|
|
6b3908d4dc | ||
|
|
9d19d02a0a | ||
|
|
533b059947 | ||
|
|
2a7c1dc4e4 | ||
|
|
07a920ed18 | ||
|
|
db36c874a0 | ||
|
|
cc58af74d6 | ||
|
|
1bcb95a9f0 | ||
|
|
e6a0216faf | ||
|
|
283ef46ac5 | ||
|
|
b4b1857562 | ||
|
|
c46c56bbf9 | ||
|
|
62ce2f6cac | ||
|
|
631c7befad | ||
|
|
bc18c34d60 | ||
|
|
6b6a1891c1 | ||
|
|
8879b115ef | ||
|
|
99c4c32d6d | ||
|
|
857da7774b | ||
|
|
3407e6bd1a | ||
|
|
553ad240f0 | ||
|
|
964ce1bb5a | ||
|
|
995aa6eddf | ||
|
|
095805e3ad | ||
|
|
b461ed238c | ||
|
|
01e7124189 | ||
|
|
acd3ac2f98 | ||
|
|
b50e4209e1 | ||
|
|
147b4e870c | ||
|
|
df8327d14c | ||
|
|
fb4d4b5953 | ||
|
|
de3701c045 | ||
|
|
9f9b7934cb |
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@@ -8,6 +8,7 @@
|
||||
/packages/now-cli/src/util/dev/ @tootallnate @leo @styfle @AndyBitz
|
||||
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
|
||||
/packages/now-cli/src/commands/certs/ @javivelasco @mglagola @anatrajkovska
|
||||
/packages/now-cli/src/commands/env @styfle @lucleray
|
||||
/packages/now-client @leo @rdev
|
||||
/packages/now-build-utils @styfle @AndyBitz
|
||||
/packages/now-node @styfle @tootallnate @lucleray
|
||||
|
||||
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@@ -1,6 +1,6 @@
|
||||
# Contributing
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish to make via [GitHub Issue](https://github.com/zeit/now/issues/new) or [Spectrum](https://spectrum.chat/zeit) with the owners of this repository before submitting a Pull Request.
|
||||
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/zeit/now/discussions/new) with the owners of this repository before submitting a Pull Request.
|
||||
|
||||
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
|
||||
|
||||
|
||||
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Bug Report
|
||||
url: https://zeit.co/support/request
|
||||
about: Report a bug using the ZEIT Now support form
|
||||
- name: Feature Request
|
||||
url: https://github.com/zeit/now/discussions/new
|
||||
about: Request a feature to be added to the platform
|
||||
- name: Ask a Question
|
||||
url: https://github.com/zeit/now/discussions/new
|
||||
about: Ask questions and discuss with other community members
|
||||
6
.github/workflows/cancel.yml
vendored
6
.github/workflows/cancel.yml
vendored
@@ -1,7 +1,7 @@
|
||||
name: Cancel
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
branches:
|
||||
- '*'
|
||||
- '!master'
|
||||
|
||||
@@ -11,8 +11,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 3
|
||||
steps:
|
||||
- uses: styfle/cancel-workflow-action@0.2.0
|
||||
- uses: styfle/cancel-workflow-action@0.3.1
|
||||
with:
|
||||
workflow_id: 435869
|
||||
workflow_id: 849295, 849296, 849297, 849298
|
||||
access_token: ${{ secrets.GITHUB_WORKFLOW_TOKEN }}
|
||||
|
||||
|
||||
109
.github/workflows/continuous-integration.yml
vendored
109
.github/workflows/continuous-integration.yml
vendored
@@ -1,109 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test-unit:
|
||||
name: Unit Tests
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- uses: actions/setup-node@v1
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn run test-lint
|
||||
- run: yarn run test-unit --clean false
|
||||
- name: Upload Artifact
|
||||
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run once
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: test-unit-output
|
||||
path: packages/now-cli/.nyc_output
|
||||
|
||||
test-integration:
|
||||
name: Integration Tests
|
||||
timeout-minutes: 120
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn test-integration-once --clean false
|
||||
|
||||
test-now-cli:
|
||||
name: Now CLI Tests
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration --clean false
|
||||
|
||||
test-now-dev:
|
||||
name: "`now dev` Tests"
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration-now-dev --clean false
|
||||
|
||||
coverage:
|
||||
name: Coverage
|
||||
timeout-minutes: 10
|
||||
needs: [test-unit, test-now-cli, test-now-dev, test-integration]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: test-unit-output
|
||||
path: packages/now-cli/.nyc_output
|
||||
- run: yarn install
|
||||
- run: yarn workspace now run coverage
|
||||
5
.github/workflows/publish.yml
vendored
5
.github/workflows/publish.yml
vendored
@@ -20,7 +20,12 @@ jobs:
|
||||
run: yarn install --check-files --frozen-lockfile
|
||||
- name: Build
|
||||
run: yarn build
|
||||
env:
|
||||
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
- name: Publish
|
||||
run: yarn publish-from-github
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
|
||||
36
.github/workflows/test-integration-cli.yml
vendored
Normal file
36
.github/workflows/test-integration-cli.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: CLI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: CLI
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration-cli --clean false
|
||||
env:
|
||||
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||
33
.github/workflows/test-integration-dev.yml
vendored
Normal file
33
.github/workflows/test-integration-dev.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Dev
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration-dev --clean false
|
||||
25
.github/workflows/test-integration-once.yml
vendored
Normal file
25
.github/workflows/test-integration-once.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: E2E
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: E2E
|
||||
timeout-minutes: 120
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn test-integration-once --clean false
|
||||
env:
|
||||
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||
33
.github/workflows/test-unit.yml
vendored
Normal file
33
.github/workflows/test-unit.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Unit
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Unit
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- uses: actions/setup-node@v1
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn run test-lint
|
||||
- run: yarn run test-unit --clean false
|
||||
- run: yarn workspace now run coverage
|
||||
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run once
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@ coverage
|
||||
packages/now-cli/.builders
|
||||
packages/now-cli/assets
|
||||
packages/now-cli/src/util/dev/templates/*.ts
|
||||
packages/now-cli/src/util/constants.ts
|
||||
packages/now-cli/test/**/yarn.lock
|
||||
!packages/now-cli/test/dev/**/yarn.lock
|
||||
packages/now-cli/test/**/node_modules
|
||||
|
||||
20
README.md
20
README.md
@@ -1,34 +1,22 @@
|
||||

|
||||
|
||||
[](https://github.com/zeit/now/actions?workflow=CI)
|
||||
[](https://spectrum.chat/zeit)
|
||||
[](https://github.com/zeit/now/discussions)
|
||||
|
||||
## Usage
|
||||
|
||||
To install the latest version of Now CLI, visit [zeit.co/download](https://zeit.co/download) or run this command:
|
||||
|
||||
```
|
||||
npm i -g now
|
||||
```
|
||||
|
||||
To quickly start a new project, run the following commands:
|
||||
|
||||
```
|
||||
now init # Pick an example project to clone
|
||||
cd <PROJECT> # Change directory to the newly created project
|
||||
now # Deploy to the cloud
|
||||
```
|
||||
Get started by [Importing a Git Project](https://zeit.co/import) and use `git push` to deploy. Alternatively, you can [install Now CLI](https://zeit.co/download).
|
||||
|
||||
## Documentation
|
||||
|
||||
For details on how to use Now CLI, check out our [documentation](https://zeit.co/docs/now-cli).
|
||||
For details on how to use ZEIT Now, check out our [documentation](https://zeit.co/docs).
|
||||
|
||||
## Caught a Bug?
|
||||
|
||||
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
|
||||
2. Install dependencies with `yarn install`
|
||||
3. Compile the code: `yarn build`
|
||||
4. Link the package to the global module directory: `yarn link`
|
||||
4. Link the package to the global module directory: `cd ./packages/now-cli && yarn link`
|
||||
5. You can now start using `now` anywhere inside the command line
|
||||
|
||||
As always, you should use `yarn test-unit` to run the tests and see if your changes have broken anything.
|
||||
|
||||
@@ -5,7 +5,6 @@ import frameworkList, { Framework } from '../packages/frameworks';
|
||||
const frameworks = (frameworkList as Framework[]).map(frameworkItem => {
|
||||
const framework = {
|
||||
...frameworkItem,
|
||||
hasDetectors: Boolean(frameworkItem.detectors),
|
||||
detectors: undefined,
|
||||
};
|
||||
|
||||
|
||||
8
codecov.yml
Normal file
8
codecov.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
codecov:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
coverage:
|
||||
status:
|
||||
project: off
|
||||
patch: off
|
||||
|
||||
@@ -64,7 +64,7 @@ Contributing to Now Examples should be an enjoyable experience, as such we have
|
||||
|
||||
The guidelines cover important information such as the requirements for new examples and where to get help if you have any questions.
|
||||
|
||||
We have tried to make contributing to Now Examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [ZEIT Spectrum](https://spectrum.chat/zeit) where we will do our best to help you.
|
||||
We have tried to make contributing to Now Examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [GitHub Discussions](https://github.com/zeit/now/discussions) where we will do our best to help you.
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
@@ -80,6 +80,6 @@ Now Examples is an open source project released under the [MIT License](https://
|
||||
|
||||
## Get In Touch
|
||||
|
||||
If you have any questions that are not covered by raising an issue then please get in touch with us on the [ZEIT Spectrum](https://spectrum.chat/zeit). There you will find both members of the community and staff who are happy to help answer questions on anything ZEIT related.
|
||||
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/zeit/now/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything ZEIT related.
|
||||
|
||||
[](https://spectrum.chat/zeit)
|
||||
[](https://github.com/zeit/now/discussions)
|
||||
|
||||
14
examples/assemble/.gitattributes
vendored
14
examples/assemble/.gitattributes
vendored
@@ -1,14 +0,0 @@
|
||||
# Enforce Unix newlines
|
||||
*.* text eol=lf
|
||||
*.css text eol=lf
|
||||
*.html text eol=lf
|
||||
*.js text eol=lf
|
||||
*.json text eol=lf
|
||||
*.less text eol=lf
|
||||
*.md text eol=lf
|
||||
*.yml text eol=lf
|
||||
|
||||
*.jpg binary
|
||||
*.gif binary
|
||||
*.png binary
|
||||
*.jpeg binary
|
||||
47
examples/assemble/.gitignore
vendored
47
examples/assemble/.gitignore
vendored
@@ -1,47 +0,0 @@
|
||||
# Numerous always-ignore extensions
|
||||
.ruby-version
|
||||
*.diff
|
||||
*.err
|
||||
*.orig
|
||||
*.log
|
||||
*.rej
|
||||
*.swo
|
||||
*.swp
|
||||
*.zip
|
||||
*.vi
|
||||
*~
|
||||
|
||||
# OS or Editor folders
|
||||
*.esproj
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
._*
|
||||
.cache
|
||||
.DS_Store
|
||||
.idea
|
||||
.project
|
||||
.settings
|
||||
.tmproj
|
||||
nbproject
|
||||
Thumbs.db
|
||||
|
||||
# Komodo
|
||||
*.komodoproject
|
||||
.komodotools
|
||||
|
||||
# grunt-html-validation
|
||||
validation-status.json
|
||||
validation-report.json
|
||||
|
||||
# Folders to ignore
|
||||
tmp
|
||||
temp
|
||||
TODO.md
|
||||
vendor
|
||||
node_modules
|
||||
bower_components
|
||||
_gh_pages
|
||||
_site
|
||||
_draft
|
||||
.env
|
||||
.env.build
|
||||
@@ -1 +0,0 @@
|
||||
README.md
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* assemble-examples <https://github.com/assemble/assemble-examples>
|
||||
*
|
||||
* Copyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
module.exports = function(grunt) {
|
||||
'use strict';
|
||||
|
||||
grunt.initConfig({
|
||||
assemble: {
|
||||
options: {
|
||||
flatten: true,
|
||||
partials: ['templates/includes/*.hbs'],
|
||||
layoutdir: 'templates/layouts',
|
||||
layout: 'default.hbs',
|
||||
},
|
||||
site: {
|
||||
files: { 'public/index.js': ['templates/*.hbs'] },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Load the Assemble plugin.
|
||||
grunt.loadNpmTasks('assemble');
|
||||
|
||||
// The default task to run with the `grunt` command.
|
||||
grunt.registerTask('default', ['assemble']);
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
# Assemble Example
|
||||
|
||||
This directory is a brief example of a [Assemble](http://assemble.io/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Assemble project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/assemble)
|
||||
|
||||
_Live Example: https://assemble.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Assemble deployed with ZEIT Now, you can use [Now CLI](https://zeit.co/download) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init assemble
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Assemble project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
@@ -1,7 +0,0 @@
|
||||
# Blog post
|
||||
|
||||
> This is an example blog post
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"name": "assemble-example",
|
||||
"private": true,
|
||||
"description": "Example Assemble project.",
|
||||
"version": "0.1.1",
|
||||
"homepage": "https://github.com/jonschlinkert/assemble-example",
|
||||
"scripts": {
|
||||
"build": "grunt assemble"
|
||||
},
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jonschlinkert/assemble-example.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/assemble-example/issues"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/jonschlinkert/assemble-example/blob/master/LICENSE-MIT"
|
||||
}
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"assemble": "~0.4.37",
|
||||
"grunt": "~0.4.3",
|
||||
"grunt-cli": "^1.3.2"
|
||||
},
|
||||
"keywords": []
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: About
|
||||
description: This is the about page.
|
||||
---
|
||||
<h2>{{description}}</h2>
|
||||
|
||||
{{> button }}
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Blog
|
||||
---
|
||||
|
||||
{{md 'content/blog-post.md'}}
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: Home
|
||||
description: This is the home page.
|
||||
---
|
||||
<h2>{{description}}</h2>
|
||||
|
||||
{{> button }}
|
||||
@@ -1 +0,0 @@
|
||||
<a href="https://github.com/assemble/assemble" class="btn btn-default">Star Assemble on GitHub!</a>
|
||||
@@ -1,4 +0,0 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>{{title}}</title>
|
||||
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="http://getbootstrap.com/assets/css/docs.min.css">
|
||||
@@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{{> head }}
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
{{> body }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,35 +0,0 @@
|
||||
module.exports = api => {
|
||||
api.cache.using(() => {
|
||||
// cache based on the two env vars
|
||||
return (
|
||||
'babel:' +
|
||||
process.env.BABEL_TARGET +
|
||||
' protractor:' +
|
||||
process.env.IN_PROTRACTOR
|
||||
);
|
||||
});
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
['@babel/plugin-proposal-decorators', { legacy: true }],
|
||||
['@babel/plugin-proposal-class-properties', { loose: true }],
|
||||
],
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets:
|
||||
process.env.BABEL_TARGET === 'node'
|
||||
? {
|
||||
node: process.env.IN_PROTRACTOR ? '6' : 'current',
|
||||
}
|
||||
: {
|
||||
browsers: ['last 2 versions'],
|
||||
},
|
||||
loose: true,
|
||||
modules: process.env.BABEL_TARGET === 'node' ? 'commonjs' : false,
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
# 2 space indentation
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
41
examples/aurelia/.gitignore
vendored
41
examples/aurelia/.gitignore
vendored
@@ -1,41 +0,0 @@
|
||||
|
||||
# You may want to customise this file depending on your Operating System
|
||||
# and the editor that you use.
|
||||
#
|
||||
# We recommend that you use a Global Gitignore for files that are not related
|
||||
# to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)
|
||||
|
||||
# OS
|
||||
#
|
||||
# Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
|
||||
# Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
|
||||
# Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
|
||||
.DS_STORE
|
||||
Thumbs.db
|
||||
|
||||
# Editors
|
||||
#
|
||||
# Ref: https://github.com/github/gitignore/blob/master/Global
|
||||
# Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
|
||||
# Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
|
||||
.idea
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# Dependencies
|
||||
node_modules
|
||||
|
||||
# Compiled files
|
||||
/scripts
|
||||
/src/environment.js
|
||||
/src/environment.ts
|
||||
/dist
|
||||
/test/coverage-jest
|
||||
/test/coverage-karma
|
||||
|
||||
# Environment Variables
|
||||
.env
|
||||
.env.build
|
||||
@@ -1,2 +0,0 @@
|
||||
README.md
|
||||
yarn.lock
|
||||
@@ -1,27 +0,0 @@
|
||||
# Aurelia Example
|
||||
|
||||
This directory is a brief example of an [Aurelia](https://aurelia.io/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Aurelia project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/aurelia)
|
||||
|
||||
_Live Example: https://aurelia.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started deploying Aurelia with ZEIT Now, you can use the [Aurelia CLI](https://aurelia.io/docs/cli/basics/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ au new
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Aurelia project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "aurelia",
|
||||
"type": "project:application",
|
||||
"paths": {
|
||||
"root": "src",
|
||||
"resources": "resources",
|
||||
"elements": "resources/elements",
|
||||
"attributes": "resources/attributes",
|
||||
"valueConverters": "resources/value-converters",
|
||||
"bindingBehaviors": "resources/binding-behaviors"
|
||||
},
|
||||
"transpiler": {
|
||||
"id": "babel",
|
||||
"fileExtension": ".js"
|
||||
},
|
||||
"build": {
|
||||
"options": {
|
||||
"server": "dev",
|
||||
"extractCss": "prod",
|
||||
"coverage": false
|
||||
}
|
||||
},
|
||||
"platform": {
|
||||
"hmr": false,
|
||||
"open": false,
|
||||
"port": 8080,
|
||||
"output": "public"
|
||||
},
|
||||
"packageManager": "yarn"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export default {
|
||||
debug: true,
|
||||
testing: true,
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
export default {
|
||||
debug: false,
|
||||
testing: false,
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
export default {
|
||||
debug: true,
|
||||
testing: false,
|
||||
};
|
||||
@@ -1,44 +0,0 @@
|
||||
import { inject } from 'aurelia-dependency-injection';
|
||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class AttributeGenerator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const name = await this.ui.ensureAnswer(
|
||||
this.options.args[0],
|
||||
'What would you like to call the custom attribute?'
|
||||
);
|
||||
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let className = this.project.makeClassName(name);
|
||||
|
||||
this.project.attributes.add(
|
||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
||||
);
|
||||
|
||||
await this.project.commitChanges();
|
||||
await this.ui.log(`Created ${fileName}.`);
|
||||
}
|
||||
|
||||
generateSource(className) {
|
||||
return `import {inject} from 'aurelia-framework';
|
||||
|
||||
@inject(Element)
|
||||
export class ${className}CustomAttribute {
|
||||
constructor(element) {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
valueChanged(newValue, oldValue) {
|
||||
//
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "attribute",
|
||||
"description": "Creates a custom attribute class and places it in the project resources."
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
import { inject } from 'aurelia-dependency-injection';
|
||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class BindingBehaviorGenerator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const name = await this.ui.ensureAnswer(
|
||||
this.options.args[0],
|
||||
'What would you like to call the binding behavior?'
|
||||
);
|
||||
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let className = this.project.makeClassName(name);
|
||||
|
||||
this.project.bindingBehaviors.add(
|
||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
||||
);
|
||||
|
||||
await this.project.commitChanges();
|
||||
await this.ui.log(`Created ${fileName}.`);
|
||||
}
|
||||
|
||||
generateSource(className) {
|
||||
return `export class ${className}BindingBehavior {
|
||||
bind(binding, source) {
|
||||
//
|
||||
}
|
||||
|
||||
unbind(binding, source) {
|
||||
//
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "binding-behavior",
|
||||
"description": "Creates a binding behavior class and places it in the project resources."
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
import { inject } from 'aurelia-dependency-injection';
|
||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
||||
|
||||
var path = require('path');
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class ElementGenerator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const name = await this.ui.ensureAnswer(
|
||||
this.options.args[0],
|
||||
'What would you like to call the component?'
|
||||
);
|
||||
|
||||
const subFolders = await this.ui.ensureAnswer(
|
||||
this.options.args[1],
|
||||
"What sub-folder would you like to add it to?\nIf it doesn't exist it will be created for you.\n\nDefault folder is the source folder (src).",
|
||||
'.'
|
||||
);
|
||||
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let className = this.project.makeClassName(name);
|
||||
|
||||
this.project.root.add(
|
||||
ProjectItem.text(
|
||||
path.join(subFolders, fileName + '.js'),
|
||||
this.generateJSSource(className)
|
||||
),
|
||||
ProjectItem.text(
|
||||
path.join(subFolders, fileName + '.html'),
|
||||
this.generateHTMLSource(className)
|
||||
)
|
||||
);
|
||||
|
||||
await this.project.commitChanges();
|
||||
await this.ui.log(
|
||||
`Created ${name} in the '${path.join(
|
||||
this.project.root.name,
|
||||
subFolders
|
||||
)}' folder`
|
||||
);
|
||||
}
|
||||
|
||||
generateJSSource(className) {
|
||||
return `export class ${className} {
|
||||
constructor() {
|
||||
this.message = 'Hello world';
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
generateHTMLSource(className) {
|
||||
return `<template>
|
||||
<h1>\${message}</h1>
|
||||
</template>
|
||||
`;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "component",
|
||||
"description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)."
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
import { inject } from 'aurelia-dependency-injection';
|
||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class ElementGenerator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const name = await this.ui.ensureAnswer(
|
||||
this.options.args[0],
|
||||
'What would you like to call the custom element?'
|
||||
);
|
||||
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let className = this.project.makeClassName(name);
|
||||
|
||||
this.project.elements.add(
|
||||
ProjectItem.text(`${fileName}.js`, this.generateJSSource(className)),
|
||||
ProjectItem.text(`${fileName}.html`, this.generateHTMLSource(className))
|
||||
);
|
||||
|
||||
await this.project.commitChanges();
|
||||
await this.ui.log(`Created ${fileName}.`);
|
||||
}
|
||||
|
||||
generateJSSource(className) {
|
||||
return `import {bindable} from 'aurelia-framework';
|
||||
|
||||
export class ${className} {
|
||||
@bindable value;
|
||||
|
||||
valueChanged(newValue, oldValue) {
|
||||
//
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
generateHTMLSource(className) {
|
||||
return `<template>
|
||||
<h1>\${value}</h1>
|
||||
</template>
|
||||
`;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "element",
|
||||
"description": "Creates a custom element class and template, placing them in the project resources."
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
import { inject } from 'aurelia-dependency-injection';
|
||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class GeneratorGenerator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const name = await this.ui.ensureAnswer(
|
||||
this.options.args[0],
|
||||
'What would you like to call the generator?'
|
||||
);
|
||||
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let className = this.project.makeClassName(name);
|
||||
|
||||
this.project.generators.add(
|
||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
||||
);
|
||||
|
||||
await this.project.commitChanges();
|
||||
await this.ui.log(`Created ${fileName}.`);
|
||||
}
|
||||
|
||||
generateSource(className) {
|
||||
return `import {inject} from 'aurelia-dependency-injection';
|
||||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class ${className}Generator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
execute() {
|
||||
return this.ui
|
||||
.ensureAnswer(this.options.args[0], 'What would you like to call the new item?')
|
||||
.then(name => {
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let className = this.project.makeClassName(name);
|
||||
|
||||
this.project.elements.add(
|
||||
ProjectItem.text(\`\${fileName}.js\`, this.generateSource(className))
|
||||
);
|
||||
|
||||
return this.project.commitChanges()
|
||||
.then(() => this.ui.log(\`Created \${fileName}.\`));
|
||||
});
|
||||
}
|
||||
|
||||
generateSource(className) {
|
||||
return \`import {bindable} from 'aurelia-framework';
|
||||
|
||||
export class \${className} {
|
||||
@bindable value;
|
||||
|
||||
valueChanged(newValue, oldValue) {
|
||||
//
|
||||
}
|
||||
}
|
||||
\`
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "generator",
|
||||
"description": "Creates a generator class and places it in the project generators folder."
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import { inject } from 'aurelia-dependency-injection';
|
||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class TaskGenerator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const name = await this.ui.ensureAnswer(
|
||||
this.options.args[0],
|
||||
'What would you like to call the task?'
|
||||
);
|
||||
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let functionName = this.project.makeFunctionName(name);
|
||||
|
||||
this.project.tasks.add(
|
||||
ProjectItem.text(`${fileName}.js`, this.generateSource(functionName))
|
||||
);
|
||||
|
||||
await this.project.commitChanges();
|
||||
await this.ui.log(`Created ${fileName}.`);
|
||||
}
|
||||
|
||||
generateSource(functionName) {
|
||||
return `import gulp from 'gulp';
|
||||
import project from '../aurelia.json';
|
||||
|
||||
export default function ${functionName}() {
|
||||
return gulp.src(project.paths.???)
|
||||
.pipe(gulp.dest(project.paths.output));
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "task",
|
||||
"description": "Creates a task and places it in the project tasks folder."
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
import { inject } from 'aurelia-dependency-injection';
|
||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
||||
|
||||
@inject(Project, CLIOptions, UI)
|
||||
export default class ValueConverterGenerator {
|
||||
constructor(project, options, ui) {
|
||||
this.project = project;
|
||||
this.options = options;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const name = await this.ui.ensureAnswer(
|
||||
this.options.args[0],
|
||||
'What would you like to call the value converter?'
|
||||
);
|
||||
|
||||
let fileName = this.project.makeFileName(name);
|
||||
let className = this.project.makeClassName(name);
|
||||
|
||||
this.project.valueConverters.add(
|
||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
||||
);
|
||||
|
||||
await this.project.commitChanges();
|
||||
await this.ui.log(`Created ${fileName}.`);
|
||||
}
|
||||
|
||||
generateSource(className) {
|
||||
return `export class ${className}ValueConverter {
|
||||
toView(value) {
|
||||
//
|
||||
}
|
||||
|
||||
fromView(value) {
|
||||
//
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"name": "value-converter",
|
||||
"description": "Creates a value converter class and places it in the project resources."
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
import webpackConfig from '../../webpack.config';
|
||||
import webpack from 'webpack';
|
||||
import project from '../aurelia.json';
|
||||
import gulp from 'gulp';
|
||||
import del from 'del';
|
||||
import { CLIOptions, Configuration } from 'aurelia-cli';
|
||||
import configureEnvironment from './environment';
|
||||
|
||||
const analyze = CLIOptions.hasFlag('analyze');
|
||||
const buildOptions = new Configuration(project.build.options);
|
||||
const production = CLIOptions.getEnvironment() === 'prod';
|
||||
const server = buildOptions.isApplicable('server');
|
||||
const extractCss = buildOptions.isApplicable('extractCss');
|
||||
const coverage = buildOptions.isApplicable('coverage');
|
||||
|
||||
const config = webpackConfig({
|
||||
production,
|
||||
server,
|
||||
extractCss,
|
||||
coverage,
|
||||
analyze,
|
||||
});
|
||||
const compiler = webpack(config);
|
||||
|
||||
function buildWebpack(done) {
|
||||
if (CLIOptions.hasFlag('watch')) {
|
||||
compiler.watch({}, onBuild);
|
||||
} else {
|
||||
compiler.run(onBuild);
|
||||
compiler.hooks.done.tap('done', () => done());
|
||||
}
|
||||
}
|
||||
|
||||
function onBuild(err, stats) {
|
||||
if (!CLIOptions.hasFlag('watch') && err) {
|
||||
console.error(err.stack || err);
|
||||
if (err.details) console.error(err.details);
|
||||
process.exit(1);
|
||||
} else {
|
||||
process.stdout.write(
|
||||
stats.toString({ colors: require('supports-color') }) + '\n'
|
||||
);
|
||||
|
||||
if (!CLIOptions.hasFlag('watch') && stats.hasErrors()) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clearDist() {
|
||||
return del([config.output.path]);
|
||||
}
|
||||
|
||||
const build = gulp.series(clearDist, configureEnvironment, buildWebpack);
|
||||
|
||||
export { config, buildWebpack, build as default };
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"name": "build",
|
||||
"description": "Builds and processes all application assets.",
|
||||
"flags": [
|
||||
{
|
||||
"name": "analyze",
|
||||
"description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"description": "Sets the build environment.",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "watch",
|
||||
"description": "Watches source files for changes and refreshes the bundles automatically.",
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
import project from '../aurelia.json';
|
||||
import rename from 'gulp-rename';
|
||||
import gulp from 'gulp';
|
||||
import fs from 'fs';
|
||||
import through from 'through2';
|
||||
import { CLIOptions } from 'aurelia-cli';
|
||||
|
||||
function configureEnvironment() {
|
||||
let env = CLIOptions.getEnvironment();
|
||||
|
||||
return gulp
|
||||
.src(
|
||||
`aurelia_project/environments/${env}${project.transpiler.fileExtension}`
|
||||
)
|
||||
.pipe(rename(`environment${project.transpiler.fileExtension}`))
|
||||
.pipe(
|
||||
through.obj(function(file, _, cb) {
|
||||
// https://github.com/aurelia/cli/issues/1031
|
||||
fs.unlink(`${project.paths.root}/${file.relative}`, function() {
|
||||
cb(null, file);
|
||||
});
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(project.paths.root))
|
||||
.pipe(
|
||||
through.obj(function(file, enc, cb) {
|
||||
// https://github.com/webpack/watchpack/issues/25#issuecomment-287789288
|
||||
const now = Date.now() / 1000;
|
||||
const then = now - 10;
|
||||
fs.utimes(file.path, then, then, function(err) {
|
||||
if (err) throw err;
|
||||
});
|
||||
cb(null, file);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
export default configureEnvironment;
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from './test';
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "jest",
|
||||
"description": "Runs Jest and reports the results.",
|
||||
"flags": [
|
||||
{
|
||||
"name": "watch",
|
||||
"description": "Watches test files for changes and re-runs the tests automatically.",
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
import webpack from 'webpack';
|
||||
import Server from 'webpack-dev-server';
|
||||
import project from '../aurelia.json';
|
||||
import gulp from 'gulp';
|
||||
|
||||
import { config } from './build';
|
||||
import configureEnvironment from './environment';
|
||||
import { CLIOptions, reportWebpackReadiness } from 'aurelia-cli';
|
||||
|
||||
function runWebpack(done) {
|
||||
// https://webpack.github.io/docs/webpack-dev-server.html
|
||||
let opts = {
|
||||
host: 'localhost',
|
||||
publicPath: config.output.publicPath,
|
||||
filename: config.output.filename,
|
||||
hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
|
||||
port: CLIOptions.getFlagValue('port') || project.platform.port,
|
||||
contentBase: config.output.path,
|
||||
historyApiFallback: true,
|
||||
open: project.platform.open || CLIOptions.hasFlag('open'),
|
||||
stats: {
|
||||
colors: require('supports-color'),
|
||||
},
|
||||
...config.devServer,
|
||||
};
|
||||
|
||||
// Add the webpack-dev-server client to the webpack entry point
|
||||
// The path for the client to use such as `webpack-dev-server/client?http://${opts.host}:${opts.port}/` is not required
|
||||
// The path used is derived from window.location in the browser and output.publicPath in the webpack.config.
|
||||
if (project.platform.hmr || CLIOptions.hasFlag('hmr')) {
|
||||
config.plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||
config.entry.app.unshift(
|
||||
'webpack-dev-server/client',
|
||||
'webpack/hot/dev-server'
|
||||
);
|
||||
} else {
|
||||
// removed "<script src="/webpack-dev-server.js"></script>" from index.ejs in favour of this method
|
||||
config.entry.app.unshift('webpack-dev-server/client');
|
||||
}
|
||||
|
||||
const compiler = webpack(config);
|
||||
let server = new Server(compiler, opts);
|
||||
|
||||
server.listen(opts.port, opts.host, function(err) {
|
||||
if (err) throw err;
|
||||
|
||||
reportWebpackReadiness(opts);
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
const run = gulp.series(configureEnvironment, runWebpack);
|
||||
|
||||
export { run as default };
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "run",
|
||||
"description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.",
|
||||
"flags": [
|
||||
{
|
||||
"name": "analyze",
|
||||
"description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"description": "Sets the build environment.",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "hmr",
|
||||
"description": "Enable Hot Module Reload",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "port",
|
||||
"description": "Set port number of the dev server",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"description": "Open the default browser at the application location.",
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import jest from 'jest-cli';
|
||||
import path from 'path';
|
||||
import packageJson from '../../package.json';
|
||||
|
||||
import { CLIOptions } from 'aurelia-cli';
|
||||
|
||||
export default cb => {
|
||||
let options = packageJson.jest;
|
||||
|
||||
if (CLIOptions.hasFlag('watch')) {
|
||||
Object.assign(options, { watchAll: true });
|
||||
}
|
||||
|
||||
process.env.BABEL_TARGET = 'node';
|
||||
|
||||
jest
|
||||
.runCLI(options, [path.resolve(__dirname, '../../')])
|
||||
.then(({ results }) => {
|
||||
if (results.numFailedTests || results.numFailedTestSuites) {
|
||||
cb('Tests Failed');
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "test",
|
||||
"description": "Runs Jest and reports the results.",
|
||||
"flags": [
|
||||
{
|
||||
"name": "watch",
|
||||
"description": "Watches test files for changes and re-runs the tests automatically.",
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,12 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><%- htmlWebpackPlugin.options.metadata.title %></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<base href="<%- htmlWebpackPlugin.options.metadata.baseUrl %>">
|
||||
<!-- imported CSS are concatenated and added automatically -->
|
||||
</head>
|
||||
<body aurelia-app="main">
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2015",
|
||||
"lib": ["es2017", "dom"],
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
{
|
||||
"name": "aurelia",
|
||||
"description": "An Aurelia client application.",
|
||||
"version": "0.1.0",
|
||||
"repository": {
|
||||
"type": "???",
|
||||
"url": "???"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"aurelia-bootstrapper": "^2.3.2",
|
||||
"aurelia-animator-css": "^1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"aurelia-cli": "^1.0.2",
|
||||
"aurelia-testing": "^1.0.0",
|
||||
"aurelia-tools": "^2.0.0",
|
||||
"gulp": "^4.0.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"through2": "^3.0.0",
|
||||
"vinyl-fs": "^3.0.3",
|
||||
"promise-polyfill": "^8.1.0",
|
||||
"regenerator-runtime": "0.13.2",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"eslint": "latest",
|
||||
"babel-loader": "^8.0.5",
|
||||
"babel-plugin-istanbul": "^5.1.1",
|
||||
"@babel/plugin-proposal-decorators": "^7.4.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.4.0",
|
||||
"@babel/preset-env": "^7.4.2",
|
||||
"@babel/core": "^7.4.0",
|
||||
"@babel/register": "^7.4.0",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"copy-webpack-plugin": "^5.0.0",
|
||||
"mini-css-extract-plugin": "^0.4.3",
|
||||
"aurelia-webpack-plugin": "^3.0.0",
|
||||
"duplicate-package-checker-webpack-plugin": "^3.0.0",
|
||||
"webpack": "^4.27.0",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-dev-server": "^3.1.9",
|
||||
"expose-loader": "^0.7.5",
|
||||
"style-loader": "^0.23.1",
|
||||
"url-loader": "^1.1.2",
|
||||
"del": "^3.0.0",
|
||||
"css-loader": "^1.0.0",
|
||||
"file-loader": "^2.0.0",
|
||||
"json-loader": "^0.5.7",
|
||||
"html-loader": "^0.5.5",
|
||||
"istanbul-instrumenter-loader": "^3.0.1",
|
||||
"webpack-bundle-analyzer": "^3.0.4",
|
||||
"jest": "^24.1.0",
|
||||
"jest-cli": "^24.1.0",
|
||||
"jest-transform-stub": "^2.0.0",
|
||||
"aurelia-loader-nodejs": "^1.0.1",
|
||||
"aurelia-pal-nodejs": "^1.2.0",
|
||||
"babel-jest": "^24.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "au build",
|
||||
"start": "au run",
|
||||
"dev": "au run --port $PORT",
|
||||
"test": "au test"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.9.0"
|
||||
},
|
||||
"jest": {
|
||||
"moduleNameMapper": {
|
||||
"^aurelia-binding$": "<rootDir>/node_modules/aurelia-binding"
|
||||
},
|
||||
"modulePaths": [
|
||||
"<rootDir>/src",
|
||||
"<rootDir>/node_modules"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"json"
|
||||
],
|
||||
"transform": {
|
||||
"^.+\\.(css|less|sass|scss|styl|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "jest-transform-stub",
|
||||
"^.+\\.js$": "babel-jest"
|
||||
},
|
||||
"testRegex": "\\.spec\\.js$",
|
||||
"setupFiles": [
|
||||
"<rootDir>/test/jest-pretest.js"
|
||||
],
|
||||
"testEnvironment": "node",
|
||||
"collectCoverage": true,
|
||||
"collectCoverageFrom": [
|
||||
"src/**/*.js",
|
||||
"!**/*.spec.js",
|
||||
"!**/node_modules/**",
|
||||
"!**/test/**"
|
||||
],
|
||||
"coverageDirectory": "<rootDir>/test/coverage-jest",
|
||||
"coverageReporters": [
|
||||
"json",
|
||||
"lcov",
|
||||
"text",
|
||||
"html"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<template>
|
||||
<h1>${message}</h1>
|
||||
</template>
|
||||
@@ -1,3 +0,0 @@
|
||||
export class App {
|
||||
message = 'Hello World!';
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// regenerator-runtime is to support async/await syntax in ESNext.
|
||||
// If you don't use async/await, you can remove regenerator-runtime.
|
||||
import 'regenerator-runtime/runtime';
|
||||
import environment from './environment';
|
||||
import { PLATFORM } from 'aurelia-pal';
|
||||
|
||||
export function configure(aurelia) {
|
||||
aurelia.use
|
||||
.standardConfiguration()
|
||||
.feature(PLATFORM.moduleName('resources/index'));
|
||||
|
||||
aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');
|
||||
|
||||
if (environment.testing) {
|
||||
aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing'));
|
||||
}
|
||||
|
||||
aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export function configure(config) {
|
||||
//config.globalResources([]);
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,6 +0,0 @@
|
||||
import 'aurelia-polyfills';
|
||||
import { Options } from 'aurelia-loader-nodejs';
|
||||
import { globalize } from 'aurelia-pal-nodejs';
|
||||
import path from 'path';
|
||||
Options.relativeToDir = path.join(__dirname, 'unit');
|
||||
globalize();
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-var": 0
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import { bootstrap } from 'aurelia-bootstrapper';
|
||||
import { StageComponent } from 'aurelia-testing';
|
||||
import { PLATFORM } from 'aurelia-pal';
|
||||
|
||||
describe('Stage App Component', () => {
|
||||
let component;
|
||||
|
||||
beforeEach(() => {
|
||||
component = StageComponent.withResources(PLATFORM.moduleName('app')).inView(
|
||||
'<app></app>'
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => component.dispose());
|
||||
|
||||
it('should render message', done => {
|
||||
component
|
||||
.create(bootstrap)
|
||||
.then(() => {
|
||||
const view = component.element;
|
||||
expect(view.textContent.trim()).toBe('Hello World!');
|
||||
done();
|
||||
})
|
||||
.catch(e => {
|
||||
fail(e);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,224 +0,0 @@
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
|
||||
const project = require('./aurelia_project/aurelia.json');
|
||||
const {
|
||||
AureliaPlugin,
|
||||
ModuleDependenciesPlugin,
|
||||
} = require('aurelia-webpack-plugin');
|
||||
const { ProvidePlugin } = require('webpack');
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
|
||||
// config helpers:
|
||||
const ensureArray = config =>
|
||||
(config && (Array.isArray(config) ? config : [config])) || [];
|
||||
const when = (condition, config, negativeConfig) =>
|
||||
condition ? ensureArray(config) : ensureArray(negativeConfig);
|
||||
|
||||
// primary config:
|
||||
const title = 'Aurelia Navigation Skeleton';
|
||||
const outDir = path.resolve(__dirname, project.platform.output);
|
||||
const srcDir = path.resolve(__dirname, 'src');
|
||||
const testDir = path.resolve(__dirname, 'test', 'unit');
|
||||
const nodeModulesDir = path.resolve(__dirname, 'node_modules');
|
||||
const baseUrl = '/';
|
||||
|
||||
const cssRules = [{ loader: 'css-loader' }];
|
||||
|
||||
module.exports = ({
|
||||
production,
|
||||
server,
|
||||
extractCss,
|
||||
coverage,
|
||||
analyze,
|
||||
karma,
|
||||
} = {}) => ({
|
||||
resolve: {
|
||||
extensions: ['.js'],
|
||||
modules: [srcDir, 'node_modules'],
|
||||
// Enforce single aurelia-binding, to avoid v1/v2 duplication due to
|
||||
// out-of-date dependencies on 3rd party aurelia plugins
|
||||
alias: {
|
||||
'aurelia-binding': path.resolve(
|
||||
__dirname,
|
||||
'node_modules/aurelia-binding'
|
||||
),
|
||||
},
|
||||
},
|
||||
entry: {
|
||||
app: ['aurelia-bootstrapper'],
|
||||
},
|
||||
mode: production ? 'production' : 'development',
|
||||
output: {
|
||||
path: outDir,
|
||||
publicPath: baseUrl,
|
||||
filename: production
|
||||
? '[name].[chunkhash].bundle.js'
|
||||
: '[name].[hash].bundle.js',
|
||||
sourceMapFilename: production
|
||||
? '[name].[chunkhash].bundle.map'
|
||||
: '[name].[hash].bundle.map',
|
||||
chunkFilename: production
|
||||
? '[name].[chunkhash].chunk.js'
|
||||
: '[name].[hash].chunk.js',
|
||||
},
|
||||
optimization: {
|
||||
runtimeChunk: true, // separates the runtime chunk, required for long term cacheability
|
||||
// moduleIds is the replacement for HashedModuleIdsPlugin and NamedModulesPlugin deprecated in https://github.com/webpack/webpack/releases/tag/v4.16.0
|
||||
// changes module id's to use hashes be based on the relative path of the module, required for long term cacheability
|
||||
moduleIds: 'hashed',
|
||||
// Use splitChunks to breakdown the App/Aurelia bundle down into smaller chunks
|
||||
// https://webpack.js.org/plugins/split-chunks-plugin/
|
||||
splitChunks: {
|
||||
hidePathInfo: true, // prevents the path from being used in the filename when using maxSize
|
||||
chunks: 'initial',
|
||||
// sizes are compared against source before minification
|
||||
maxSize: 200000, // splits chunks if bigger than 200k, adjust as required (maxSize added in webpack v4.15)
|
||||
cacheGroups: {
|
||||
default: false, // Disable the built-in groups default & vendors (vendors is redefined below)
|
||||
// You can insert additional cacheGroup entries here if you want to split out specific modules
|
||||
// This is required in order to split out vendor css from the app css when using --extractCss
|
||||
// For example to separate font-awesome and bootstrap:
|
||||
// fontawesome: { // separates font-awesome css from the app css (font-awesome is only css/fonts)
|
||||
// name: 'vendor.font-awesome',
|
||||
// test: /[\\/]node_modules[\\/]font-awesome[\\/]/,
|
||||
// priority: 100,
|
||||
// enforce: true
|
||||
// },
|
||||
// bootstrap: { // separates bootstrap js from vendors and also bootstrap css from app css
|
||||
// name: 'vendor.font-awesome',
|
||||
// test: /[\\/]node_modules[\\/]bootstrap[\\/]/,
|
||||
// priority: 90,
|
||||
// enforce: true
|
||||
// },
|
||||
|
||||
// This is the HTTP/1.1 optimised cacheGroup configuration
|
||||
vendors: {
|
||||
// picks up everything from node_modules as long as the sum of node modules is larger than minSize
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendors',
|
||||
priority: 19,
|
||||
enforce: true, // causes maxInitialRequests to be ignored, minSize still respected if specified in cacheGroup
|
||||
minSize: 30000, // use the default minSize
|
||||
},
|
||||
vendorsAsync: {
|
||||
// vendors async chunk, remaining asynchronously used node modules as single chunk file
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendors.async',
|
||||
chunks: 'async',
|
||||
priority: 9,
|
||||
reuseExistingChunk: true,
|
||||
minSize: 10000, // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
|
||||
},
|
||||
commonsAsync: {
|
||||
// commons async chunk, remaining asynchronously used modules as single chunk file
|
||||
name: 'commons.async',
|
||||
minChunks: 2, // Minimum number of chunks that must share a module before splitting
|
||||
chunks: 'async',
|
||||
priority: 0,
|
||||
reuseExistingChunk: true,
|
||||
minSize: 10000, // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
performance: { hints: false },
|
||||
devServer: {
|
||||
contentBase: outDir,
|
||||
// serve index.html for all 404 (required for push-state)
|
||||
historyApiFallback: true,
|
||||
},
|
||||
devtool: production ? 'nosources-source-map' : 'cheap-module-eval-source-map',
|
||||
module: {
|
||||
rules: [
|
||||
// CSS required in JS/TS files should use the style-loader that auto-injects it into the website
|
||||
// only when the issuer is a .js/.ts file, so the loaders are not applied inside html templates
|
||||
{
|
||||
test: /\.css$/i,
|
||||
issuer: [{ not: [{ test: /\.html$/i }] }],
|
||||
use: extractCss
|
||||
? [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
},
|
||||
'css-loader',
|
||||
]
|
||||
: ['style-loader', ...cssRules],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
issuer: [{ test: /\.html$/i }],
|
||||
// CSS required in templates cannot be extracted safely
|
||||
// because Aurelia would try to require it again in runtime
|
||||
use: cssRules,
|
||||
},
|
||||
{ test: /\.html$/i, loader: 'html-loader' },
|
||||
{
|
||||
test: /\.js$/i,
|
||||
loader: 'babel-loader',
|
||||
exclude: nodeModulesDir,
|
||||
options: coverage ? { sourceMap: 'inline', plugins: ['istanbul'] } : {},
|
||||
},
|
||||
// embed small images and fonts as Data Urls and larger ones as files:
|
||||
{
|
||||
test: /\.(png|gif|jpg|cur)$/i,
|
||||
loader: 'url-loader',
|
||||
options: { limit: 8192 },
|
||||
},
|
||||
{
|
||||
test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
|
||||
loader: 'url-loader',
|
||||
options: { limit: 10000, mimetype: 'application/font-woff2' },
|
||||
},
|
||||
{
|
||||
test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
|
||||
loader: 'url-loader',
|
||||
options: { limit: 10000, mimetype: 'application/font-woff' },
|
||||
},
|
||||
// load these fonts normally, as files:
|
||||
{
|
||||
test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
|
||||
loader: 'file-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
...when(!karma, new DuplicatePackageCheckerPlugin()),
|
||||
new AureliaPlugin(),
|
||||
new ProvidePlugin({
|
||||
Promise: ['promise-polyfill', 'default'],
|
||||
}),
|
||||
new ModuleDependenciesPlugin({
|
||||
'aurelia-testing': ['./compile-spy', './view-spy'],
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.ejs',
|
||||
metadata: {
|
||||
// available in index.ejs //
|
||||
title,
|
||||
server,
|
||||
baseUrl,
|
||||
},
|
||||
}),
|
||||
// ref: https://webpack.js.org/plugins/mini-css-extract-plugin/
|
||||
...when(
|
||||
extractCss,
|
||||
new MiniCssExtractPlugin({
|
||||
// updated to match the naming conventions for the js files
|
||||
filename: production
|
||||
? 'css/[name].[contenthash].bundle.css'
|
||||
: 'css/[name].[hash].bundle.css',
|
||||
chunkFilename: production
|
||||
? 'css/[name].[contenthash].chunk.css'
|
||||
: 'css/[name].[hash].chunk.css',
|
||||
})
|
||||
),
|
||||
...when(
|
||||
production || server,
|
||||
new CopyWebpackPlugin([{ from: 'static', to: outDir, ignore: ['.*'] }])
|
||||
), // ignore dot (hidden) files
|
||||
...when(analyze, new BundleAnalyzerPlugin()),
|
||||
],
|
||||
});
|
||||
115
examples/brunch/app/assets/brunch-napkin.svg
Normal file
115
examples/brunch/app/assets/brunch-napkin.svg
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
|
||||
<rect x="65" y="68" fill="#7C7C7C" width="127" height="124"/>
|
||||
<rect x="83.392" y="22.163" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 266.9294 23.9747)" fill="#86AD8A" width="90.215" height="90.215"/>
|
||||
<path fill="#FFFFFF" d="M117.601,167.637c3.788-11.191,5.795-45.647,4.728-62.795c-0.128-2.057-0.333-4.445-0.692-6.351
|
||||
c-0.112-0.607-0.244-1.168-0.391-1.651c0-6.672,0-62.892,0-67.02c0-5.717,5.242-8.419,10.166,4.128
|
||||
c4.925,12.547,3.495,57.175,3.495,60.348c0,0.673-0.611,1.469-1.57,2.25c-0.383,0.247-0.73,0.499-1.051,0.754
|
||||
c-2.949,2.366-3.379,5.095-3.533,7.542c-1.067,17.148-1.554,51.604,2.234,62.795c4.438,13.112-4.004,14.759-6.691,14.759
|
||||
C121.605,182.395,113.163,180.748,117.601,167.637z"/>
|
||||
<path fill="#FFFFFF" d="M103.019,47.413c-0.472,0.049-1.062,9.387-1.257,16.131c-0.238,8.194-0.607,15.482-2.908,15.482
|
||||
c-1.728,0-2.8-2.853-2.517-10.094c0.407-10.427,0.395-21.519-0.219-21.519c-0.774,0-4.358,22.999-4.358,31.09
|
||||
c0,5.803,2.487,11.269,5.603,14.115c0.01,0.008,0.019,0.019,0.033,0.027c0.093,0.081,0.191,0.166,0.278,0.247
|
||||
c0.005,0.004,0.01,0.004,0.01,0.008c2.252,2.053,2.819,4.283,2.971,6.32c1.286,17.143-1.128,59.614-5.678,70.804
|
||||
c-5.33,13.108,4.811,14.759,8.042,14.759c3.227,0,13.368-1.651,8.037-14.759c-4.55-11.191-6.96-53.661-5.678-70.804
|
||||
c0.153-2.037,0.719-4.267,2.971-6.32c0-0.004,0.005-0.004,0.01-0.008c0.088-0.081,0.185-0.166,0.278-0.247
|
||||
c0.014-0.008,0.023-0.019,0.033-0.027c3.116-2.845,5.764-8.314,5.604-14.115c-0.635-23.017-3.263-31.09-4.037-31.09
|
||||
c-0.614,0-0.613,12.286-0.438,21.024c0.143,7.158-0.471,10.383-2.49,10.383c-1.923,0-2.504-6.972-2.748-15.368
|
||||
c-0.196-6.762-0.804-16.039-1.54-16.039"/>
|
||||
<path fill="#FFFFFF" d="M154.075,179.591c-2.546,0-10.532-1.562-6.332-13.967c3.585-10.59,5.483-50.779,4.474-67.007
|
||||
c-0.051-0.826-0.256-1.664-0.413-2.55c-0.443-2.504-3.543-4.555-5.338-6.356c-3.486-3.498-5.725-9.38-5.725-16.013
|
||||
c0-10.77,5.97-24.4,13.334-24.4c7.364,0,13.334,13.63,13.334,24.4c0,6.633-2.24,12.515-5.725,16.013
|
||||
c-1.795,1.801-4.895,3.852-5.338,6.356c-0.157,0.886-0.361,1.724-0.413,2.55c-1.01,16.227,0.889,56.416,4.474,67.007
|
||||
C164.607,178.03,156.621,179.591,154.075,179.591z"/>
|
||||
<polyline fill="#CECCAE" points="65,68 65,192 192,192 "/>
|
||||
<polygon fill="#3F894A" points="65,191.835 65,253 192,253 192,191.835 192,66.938 "/>
|
||||
<g>
|
||||
<g>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" x1="191.658" y1="82.55" x2="190.946" y2="83.253"/>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" stroke-dasharray="2.02,2.02" x1="189.509" y1="84.672" x2="66.629" y2="206.035"/>
|
||||
|
||||
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" x1="65.91" y1="206.745" x2="65.199" y2="207.448"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M85.353,211.117h6.328c0.827,0,1.665,0.067,2.513,0.201c0.848,0.135,1.608,0.414,2.28,0.838
|
||||
c0.672,0.424,1.22,1.014,1.644,1.768c0.424,0.756,0.636,1.753,0.636,2.994c0,1.116-0.331,2.089-0.993,2.916
|
||||
c-0.662,0.827-1.644,1.376-2.947,1.645v0.062c0.724,0.062,1.385,0.232,1.985,0.512c0.6,0.279,1.117,0.651,1.551,1.117
|
||||
c0.434,0.465,0.77,1.019,1.008,1.659c0.238,0.642,0.357,1.345,0.357,2.109c0,1.262-0.243,2.291-0.729,3.087
|
||||
c-0.486,0.797-1.097,1.422-1.83,1.877c-0.734,0.455-1.531,0.766-2.389,0.931c-0.858,0.166-1.66,0.248-2.404,0.248h-7.011V211.117z
|
||||
M87.4,220.609h4.25c1.055,0,1.913-0.129,2.575-0.388c0.662-0.259,1.179-0.574,1.551-0.946c0.373-0.372,0.621-0.771,0.745-1.194
|
||||
s0.186-0.812,0.186-1.163c0-0.765-0.129-1.401-0.388-1.908c-0.259-0.506-0.605-0.909-1.039-1.21
|
||||
c-0.435-0.299-0.941-0.512-1.52-0.636c-0.579-0.124-1.189-0.186-1.831-0.186H87.4V220.609z M87.4,231.219h4.684
|
||||
c1.199,0,2.166-0.145,2.9-0.435c0.734-0.289,1.298-0.651,1.691-1.085c0.393-0.435,0.656-0.895,0.791-1.381
|
||||
c0.134-0.485,0.202-0.926,0.202-1.318c0-0.807-0.155-1.499-0.465-2.078s-0.713-1.05-1.21-1.412c-0.496-0.361-1.06-0.625-1.69-0.791
|
||||
c-0.631-0.165-1.267-0.248-1.908-0.248H87.4V231.219z"/>
|
||||
<path fill="#FFFFFF" d="M103.73,222.781c0-0.269-0.011-0.595-0.031-0.978c-0.021-0.383-0.036-0.771-0.046-1.163
|
||||
c-0.011-0.393-0.026-0.76-0.047-1.102c-0.021-0.341-0.031-0.604-0.031-0.791h1.861c0.021,0.538,0.036,1.055,0.046,1.551
|
||||
c0.01,0.497,0.036,0.817,0.078,0.962c0.476-0.848,1.086-1.54,1.83-2.078c0.745-0.538,1.654-0.807,2.73-0.807
|
||||
c0.186,0,0.367,0.016,0.543,0.047c0.175,0.03,0.357,0.067,0.543,0.108l-0.217,1.83c-0.248-0.082-0.486-0.124-0.713-0.124
|
||||
c-0.807,0-1.504,0.129-2.094,0.388c-0.589,0.259-1.075,0.615-1.458,1.07s-0.667,0.987-0.853,1.598s-0.279,1.267-0.279,1.97v7.817
|
||||
h-1.861V222.781z"/>
|
||||
<path fill="#FFFFFF" d="M126,229.047c0,0.27,0.01,0.595,0.031,0.978c0.021,0.383,0.036,0.771,0.046,1.163
|
||||
c0.01,0.394,0.026,0.761,0.047,1.102c0.02,0.341,0.031,0.604,0.031,0.791h-1.861c-0.021-0.537-0.036-1.055-0.046-1.551
|
||||
c-0.011-0.497-0.036-0.817-0.078-0.962h-0.093c-0.373,0.786-0.993,1.463-1.861,2.032c-0.869,0.568-1.882,0.853-3.04,0.853
|
||||
c-1.117,0-2.032-0.176-2.746-0.527s-1.272-0.812-1.675-1.38c-0.403-0.569-0.678-1.226-0.822-1.971
|
||||
c-0.145-0.744-0.217-1.509-0.217-2.295v-8.531h1.861v8.438c0,0.58,0.051,1.144,0.155,1.691s0.284,1.039,0.543,1.474
|
||||
c0.258,0.434,0.621,0.78,1.086,1.039s1.07,0.388,1.815,0.388c0.682,0,1.329-0.119,1.938-0.356c0.61-0.238,1.137-0.6,1.582-1.086
|
||||
s0.796-1.097,1.055-1.83c0.258-0.734,0.388-1.598,0.388-2.591v-7.166H126V229.047z"/>
|
||||
<path fill="#FFFFFF" d="M130.584,222.781c0-0.269-0.01-0.595-0.029-0.978c-0.021-0.383-0.037-0.771-0.047-1.163
|
||||
c-0.012-0.393-0.027-0.76-0.047-1.102c-0.021-0.341-0.031-0.604-0.031-0.791h1.861c0.02,0.538,0.035,1.055,0.047,1.551
|
||||
c0.01,0.497,0.035,0.817,0.076,0.962h0.094c0.373-0.785,0.992-1.463,1.861-2.032c0.869-0.568,1.883-0.853,3.041-0.853
|
||||
c1.115,0,2.025,0.176,2.729,0.527s1.258,0.812,1.66,1.381c0.404,0.568,0.684,1.225,0.838,1.97c0.154,0.744,0.232,1.51,0.232,2.295
|
||||
v8.531h-1.861v-8.438c0-0.579-0.051-1.143-0.154-1.691c-0.104-0.547-0.285-1.039-0.543-1.473c-0.26-0.435-0.621-0.781-1.086-1.04
|
||||
c-0.465-0.258-1.07-0.388-1.814-0.388c-0.684,0-1.33,0.119-1.939,0.357c-0.609,0.237-1.137,0.6-1.582,1.085
|
||||
c-0.445,0.486-0.797,1.097-1.055,1.831c-0.26,0.734-0.389,1.598-0.389,2.59v7.166h-1.861V222.781z"/>
|
||||
<path fill="#FFFFFF" d="M159.28,230.971c-0.703,0.849-1.5,1.474-2.389,1.877c-0.89,0.403-1.852,0.604-2.885,0.604
|
||||
c-1.097,0-2.11-0.186-3.041-0.559c-0.931-0.372-1.727-0.894-2.389-1.566c-0.662-0.672-1.179-1.468-1.551-2.389
|
||||
c-0.372-0.92-0.559-1.928-0.559-3.024c0-1.096,0.187-2.104,0.559-3.024s0.889-1.717,1.551-2.389s1.458-1.194,2.389-1.566
|
||||
c0.931-0.373,1.944-0.559,3.041-0.559c1.055,0,2.031,0.217,2.931,0.651c0.9,0.435,1.701,1.045,2.404,1.83l-1.489,1.117
|
||||
c-0.537-0.6-1.127-1.07-1.768-1.412c-0.642-0.341-1.334-0.512-2.078-0.512c-0.869,0-1.655,0.155-2.358,0.466
|
||||
c-0.703,0.31-1.303,0.729-1.799,1.256s-0.874,1.148-1.133,1.861c-0.259,0.714-0.388,1.474-0.388,2.28s0.129,1.566,0.388,2.28
|
||||
c0.259,0.713,0.637,1.334,1.133,1.861s1.096,0.946,1.799,1.256c0.703,0.311,1.489,0.466,2.358,0.466
|
||||
c0.785,0,1.504-0.181,2.155-0.543c0.651-0.361,1.215-0.843,1.69-1.442L159.28,230.971z"/>
|
||||
<path fill="#FFFFFF" d="M161.925,209.628h1.861v11.633h0.062c0.372-0.785,0.992-1.463,1.861-2.032
|
||||
c0.868-0.568,1.882-0.853,3.04-0.853c1.116,0,2.026,0.176,2.729,0.527s1.257,0.812,1.66,1.381c0.403,0.568,0.683,1.225,0.837,1.97
|
||||
c0.155,0.744,0.233,1.51,0.233,2.295v8.531h-1.861v-8.438c0-0.579-0.052-1.143-0.155-1.691c-0.104-0.547-0.285-1.039-0.543-1.473
|
||||
c-0.259-0.435-0.62-0.781-1.086-1.04c-0.465-0.258-1.07-0.388-1.814-0.388c-0.683,0-1.329,0.119-1.939,0.357
|
||||
c-0.609,0.237-1.137,0.6-1.582,1.085c-0.444,0.486-0.796,1.097-1.055,1.831s-0.388,1.598-0.388,2.59v7.166h-1.861V209.628z"/>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
@@ -10,7 +10,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="brunch">
|
||||
<a href="http://brunch.io"><img src="http://brunch.io/images/logo.png" alt="Brunch"></a>
|
||||
<p>Bon Appétit.</p>
|
||||
<img src="/brunch-napkin.svg" alt="Brunch">
|
||||
<h4>Bon Appétit.</h4>
|
||||
<h6>A <a href="http://brunch.io" target="_blank">Brunch</a> website deployed on <a href="https://zeit.co" target="_blank">ZEIT Now</a></h6>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
margin: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.brunch {
|
||||
font-family: -apple-system, Sans-Serif;
|
||||
text-align: center;
|
||||
font-size: 24pt;
|
||||
color: #3f894a;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
5
examples/charge/.gitignore
vendored
5
examples/charge/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
tmp
|
||||
target
|
||||
node_modules
|
||||
.env
|
||||
.env.build
|
||||
@@ -1,2 +0,0 @@
|
||||
README.md
|
||||
yarn.lock
|
||||
@@ -1,27 +0,0 @@
|
||||
# Charge.js Example
|
||||
|
||||
This directory is a brief example of a [Charge.js](https://charge.js.org/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Charge.js project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/charge)
|
||||
|
||||
_Live Example: https://charge.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Charge.js, you can use [Now CLI](https://zeit.co/download) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init charge
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Charge.js project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "charge-example",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"start": "charge serve source",
|
||||
"dev": "charge serve source --port $PORT",
|
||||
"build": "charge build source public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@static/charge": "^1.5.0"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import About from './pages/about.html.mdx';
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
<>
|
||||
<h1>Welcome to my new Charge site!</h1>
|
||||
<About />
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function Layout({ children }) {
|
||||
return children;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import Layout from '../layout.html.jsx';
|
||||
|
||||
Everything between the import and export in the source is **just markdown** using [MDX](https://mdxjs.com/)!
|
||||
|
||||
export default ({ children }) => <Layout>{children}</Layout>;
|
||||
4
examples/docz/.gitignore
vendored
4
examples/docz/.gitignore
vendored
@@ -1,4 +0,0 @@
|
||||
node_modules
|
||||
.env
|
||||
.env.build
|
||||
.docz
|
||||
@@ -1,2 +0,0 @@
|
||||
README.md
|
||||
yarn.lock
|
||||
@@ -1,29 +0,0 @@
|
||||
# Docz Example
|
||||
|
||||
This directory is a brief example of a [Docz](https://www.docz.site/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Docz project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/docz)
|
||||
|
||||
_Live Example: https://docz.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Docz for deployment with ZEIT Now, you can use the [Now CLI](https://zeit.co/download) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init docz
|
||||
```
|
||||
|
||||
> The only change made is to add `dest: '/public'` to the `doczrc.js` file.
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Docz project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
@@ -1,4 +0,0 @@
|
||||
export default {
|
||||
dest: '/public',
|
||||
public: '/pub',
|
||||
};
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: Hello world
|
||||
route: /
|
||||
---
|
||||
|
||||
# Hello world!
|
||||
|
||||
I'm a documentation page, using MDX, created using [docz](https://docz.site) and deployed with [ZEIT Now](https://zeit.co/now)!
|
||||
|
||||
You can learn how to deploy a docz project from [the now-examples GitHub repository](https://github.com/zeit/now/tree/master/examples/docz)!
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "my-docz-project",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "docz dev --port=$PORT",
|
||||
"build": "docz build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"docz": "1.2.0",
|
||||
"docz-theme-default": "1.2.0"
|
||||
}
|
||||
}
|
||||
6
examples/dojo/.dojorc
Normal file
6
examples/dojo/.dojorc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"build-app": {},
|
||||
"test-intern": {},
|
||||
"create-app": {},
|
||||
"create-widget": {}
|
||||
}
|
||||
4
examples/dojo/.gitignore
vendored
Normal file
4
examples/dojo/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
_build/
|
||||
output/
|
||||
.cert/
|
||||
25
examples/dojo/README.md
Normal file
25
examples/dojo/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Dojo Example
|
||||
|
||||
This directory is a brief example of a [Dojo](https://dojo.io) site that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Dojo project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/dojo)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Dojo on Now, you can use the [Dojo CLI](https://github.com/dojo/cli) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init dojo
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
Once initialized, you can deploy the Dojo example with just a single command:
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
26
examples/dojo/package.json
Normal file
26
examples/dojo/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "dojo",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "dojo build --mode dev --watch --serve",
|
||||
"build": "dojo build --mode dist",
|
||||
"build:dev": "dojo build --mode dev",
|
||||
"test": "dojo test",
|
||||
"test:unit": "dojo build --mode unit && dojo test --unit --config local",
|
||||
"test:functional": "dojo build --mode functional && dojo test --functional --config local",
|
||||
"test:all": "dojo build --mode unit && dojo build --mode functional && dojo test --all --config local"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dojo/framework": "^6.0.0",
|
||||
"@dojo/themes": "^6.0.0",
|
||||
"@dojo/widgets": "^6.0.0",
|
||||
"tslib": "~1.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@dojo/cli": "^6.0.0",
|
||||
"@dojo/cli-build-app": "^6.0.0",
|
||||
"@dojo/cli-test-intern": "^6.0.0",
|
||||
"@types/node": "~9.6.5",
|
||||
"typescript": "~3.4.5"
|
||||
}
|
||||
}
|
||||
3
examples/dojo/src/App.m.css
Normal file
3
examples/dojo/src/App.m.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
1
examples/dojo/src/App.m.css.d.ts
vendored
Normal file
1
examples/dojo/src/App.m.css.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const root: string;
|
||||
27
examples/dojo/src/App.ts
Normal file
27
examples/dojo/src/App.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { create, v, w } from '@dojo/framework/core/vdom';
|
||||
import theme from '@dojo/framework/core/middleware/theme';
|
||||
import Outlet from '@dojo/framework/routing/Outlet';
|
||||
import dojo from '@dojo/themes/dojo';
|
||||
|
||||
import Menu from './widgets/Menu';
|
||||
import Home from './widgets/Home';
|
||||
import About from './widgets/About';
|
||||
import Profile from './widgets/Profile';
|
||||
|
||||
import * as css from './App.m.css';
|
||||
|
||||
const factory = create({ theme });
|
||||
|
||||
export default factory(function App({ middleware: { theme } }) {
|
||||
if (!theme.get()) {
|
||||
theme.set(dojo);
|
||||
}
|
||||
return v('div', { classes: [css.root] }, [
|
||||
w(Menu, {}),
|
||||
v('div', [
|
||||
w(Outlet, { key: 'home', id: 'home', renderer: () => w(Home, {}) }),
|
||||
w(Outlet, { key: 'about', id: 'about', renderer: () => w(About, {}) }),
|
||||
w(Outlet, { key: 'profile', id: 'profile', renderer: () => w(Profile, { username: 'Dojo User' }) })
|
||||
])
|
||||
]);
|
||||
});
|
||||
11
examples/dojo/src/index.html
Normal file
11
examples/dojo/src/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>dojo</title>
|
||||
<meta name="theme-color" content="#222127">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
6
examples/dojo/src/main.css
Normal file
6
examples/dojo/src/main.css
Normal file
@@ -0,0 +1,6 @@
|
||||
/* Put your styles and imports here */
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
13
examples/dojo/src/main.ts
Normal file
13
examples/dojo/src/main.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import renderer, { w } from '@dojo/framework/core/vdom';
|
||||
import Registry from '@dojo/framework/core/Registry';
|
||||
import { registerRouterInjector } from '@dojo/framework/routing/RouterInjector';
|
||||
import '@dojo/themes/dojo/index.css';
|
||||
|
||||
import routes from './routes';
|
||||
import App from './App';
|
||||
|
||||
const registry = new Registry();
|
||||
registerRouterInjector(routes, registry);
|
||||
|
||||
const r = renderer(() => w(App, {}));
|
||||
r.mount({ registry });
|
||||
15
examples/dojo/src/routes.ts
Normal file
15
examples/dojo/src/routes.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export default [
|
||||
{
|
||||
path: 'home',
|
||||
outlet: 'home',
|
||||
defaultRoute: true
|
||||
},
|
||||
{
|
||||
path: 'about',
|
||||
outlet: 'about'
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
outlet: 'profile'
|
||||
}
|
||||
];
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user