Skip to content

Commit a073dbc

Browse files
authored
refactor: version aware package manager usage, fix #4, fix #2, fix #6 (#5)
* refactor: version aware package manager usage, fix #4, fix #2 * fix version parsing * fix ng-cli recipe * add tests back * fix test * add covector * add changefile * fix tests ? * remove useless console.logs * simplify test * add yarn to tests * [skip ci] change yarn test job name * fix vue-cli recipe * exit test on error * fix solid * fix vuecli tests * try exclude in yarn tests * remove excludes * fix svelte yarn test * fix typo * fix vuecli * fix yarn svelte test * fix vuecli tests again * remove vuecli from tests * revert `pm` to `packageManager`
1 parent 62ea72e commit a073dbc

37 files changed

Lines changed: 960 additions & 1210 deletions

.changes/config.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"gitSiteUrl": "https://www.github.com/tauri-apps/create-tauri-app/",
3+
"timeout": 3600000,
4+
"pkgManagers": {
5+
"javascript": {
6+
"version": true,
7+
"getPublishedVersion": "npm view ${ pkgFile.pkg.name } version",
8+
"prepublish": [
9+
{
10+
"command": "yarn",
11+
"dryRunCommand": true
12+
},
13+
{
14+
"command": "echo \"# Yarn Audit\n\"",
15+
"dryRunCommand": true,
16+
"pipe": true
17+
},
18+
{
19+
"command": "echo '<details>\n<summary>click to view</summary>\n\n```'",
20+
"dryRunCommand": true,
21+
"pipe": true
22+
},
23+
{
24+
"command": "yarn audit",
25+
"dryRunCommand": true,
26+
"runFromRoot": true,
27+
"pipe": true
28+
},
29+
{
30+
"command": "echo '```\n\n</details>\n'",
31+
"dryRunCommand": true,
32+
"pipe": true
33+
},
34+
{
35+
"command": "npm pack",
36+
"dryRunCommand": true
37+
}
38+
],
39+
"publish": [
40+
"sleep 15s",
41+
{
42+
"command": "echo \"# Yarn Package Publish\"",
43+
"dryRunCommand": true,
44+
"pipe": true
45+
},
46+
{
47+
"command": "echo '```'",
48+
"dryRunCommand": true,
49+
"pipe": true
50+
},
51+
{
52+
"command": "yarn publish --access public --loglevel silly",
53+
"dryRunCommand": "npm publish --dry-run --access public",
54+
"pipe": true
55+
},
56+
{
57+
"command": "echo '```'",
58+
"dryRunCommand": true,
59+
"pipe": true
60+
}
61+
],
62+
"postpublish": [
63+
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f",
64+
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f",
65+
"git push --tags -f"
66+
]
67+
}
68+
},
69+
"packages": {
70+
"create-tauri-app": {
71+
"path": ".",
72+
"manaer": "javascript"
73+
}
74+
}
75+
}

.changes/readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changes
2+
3+
##### via https://github.com/jbolda/covector
4+
5+
As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend it represents the overall change for our sanity.
6+
7+
When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.
8+
9+
Use the following format:
10+
11+
```md
12+
---
13+
"create-tauri-app": patch
14+
---
15+
16+
Change summary goes here
17+
```
18+
19+
Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.
20+
21+
Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).
22+
23+
Given a version number MAJOR.MINOR.PATCH, increment the:
24+
25+
- MAJOR version when you make incompatible API changes,
26+
- MINOR version when you add functionality in a backwards compatible manner, and
27+
- PATCH version when you make backwards compatible bug fixes.
28+
29+
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).

.changes/version-aware-pm.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-tauri-app": "patch"
3+
---
4+
5+
* `create-tauri-app` handles different package managers usage better now.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
name: covector status
6+
on: [pull_request]
7+
8+
jobs:
9+
covector:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: covector status
17+
uses: jbolda/covector/packages/action@covector-v0
18+
id: covector
19+
with:
20+
command: "status"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
name: version or publish
6+
7+
on:
8+
push:
9+
branches:
10+
- dev
11+
12+
jobs:
13+
version-or-publish:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 65
16+
outputs:
17+
change: ${{ steps.covector.outputs.change }}
18+
commandRan: ${{ steps.covector.outputs.commandRan }}
19+
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
- uses: actions/setup-node@v2
26+
with:
27+
node-version: 14
28+
registry-url: 'https://registry.npmjs.org'
29+
cache: yarn
30+
cache-dependency-path: yarn.lock
31+
32+
- name: git config
33+
run: |
34+
git config --global user.name "${{ github.event.pusher.name }}"
35+
git config --global user.email "${{ github.event.pusher.email }}"
36+
- name: covector version or publish (publish when no change files present)
37+
uses: jbolda/covector/packages/action@covector-v0
38+
id: covector
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
with:
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
command: 'version-or-publish'
44+
createRelease: true
45+
- name: Create Pull Request With Versions Bumped
46+
if: steps.covector.outputs.commandRan == 'version'
47+
uses: tauri-apps/create-pull-request@v3.4.1
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
branch: release/version-updates
51+
title: Apply Version Updates From Current Changes
52+
commit-message: 'apply version updates'
53+
labels: 'version updates'
54+
body: ${{ steps.covector.outputs.change }}

.github/workflows/test-cta.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
name: test create-tauri-app
6+
env:
7+
RUST_BACKTRACE: 1
8+
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
9+
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
10+
TAURI_RECIPE: 'vanillajs,vite,cra,svelte,solid,ngcli,cljs'
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
platform:
16+
default: 'ubuntu'
17+
18+
pull_request:
19+
20+
jobs:
21+
create-recipe-with-npm:
22+
name: 'node@${{ matrix.node }} + npm@${{ matrix.manager }}'
23+
runs-on: ${{ github.event.inputs.platform || 'ubuntu' }}-latest
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
node: ['14', '16']
29+
manager: ['7']
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: install stable
34+
uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: stable
37+
- uses: volta-cli/action@v1
38+
with:
39+
node-version: ${{ matrix.node }}
40+
npm-version: ${{ matrix.manager }}
41+
yarn-version: 1.22.5
42+
- name: install webkit2gtk
43+
if: (github.event.inputs.platform || 'ubuntu') == 'ubuntu'
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
47+
- run: yarn
48+
- run: yarn build
49+
- run: yarn test
50+
env:
51+
TAURI_RUN_MANAGER: 'npm'
52+
53+
create-recipe-with-yarn:
54+
name: 'node@${{ matrix.node }} + yarn'
55+
runs-on: ${{ github.event.inputs.platform || 'ubuntu' }}-latest
56+
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
node: ['14', '16']
61+
manager: ['7']
62+
63+
steps:
64+
- uses: actions/checkout@v2
65+
- name: install stable
66+
uses: actions-rs/toolchain@v1
67+
with:
68+
toolchain: stable
69+
- uses: volta-cli/action@v1
70+
with:
71+
node-version: ${{ matrix.node }}
72+
npm-version: ${{ matrix.manager }}
73+
yarn-version: 1.22.5
74+
- name: install webkit2gtk
75+
if: (github.event.inputs.platform || 'ubuntu') == 'ubuntu'
76+
run: |
77+
sudo apt-get update
78+
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
79+
- run: yarn
80+
- run: yarn build
81+
- run: yarn test
82+
env:
83+
TAURI_RUN_MANAGER: 'yarn'
File renamed without changes.

jest.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)