@seatsio/seatsio-vue 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/build.yml +3 -3
- package/.github/workflows/release.yml +44 -0
- package/package.json +6 -6
- package/release.mjs +92 -0
- package/.github/workflows/publish.yml +0 -20
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "npm"
|
|
9
|
+
directory: "/"
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "monthly"
|
|
@@ -12,10 +12,10 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
16
|
-
- uses: actions/setup-node@
|
|
15
|
+
- uses: actions/checkout@v3
|
|
16
|
+
- uses: actions/setup-node@v3
|
|
17
17
|
with:
|
|
18
18
|
node-version: 16
|
|
19
19
|
registry-url: https://registry.npmjs.org/
|
|
20
20
|
- run: yarn install
|
|
21
|
-
- run: yarn build
|
|
21
|
+
- run: yarn build
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Very important!
|
|
2
|
+
# Make sure that the github token has read AND WRITE access on github.
|
|
3
|
+
# 1. hit https://github.com/seatsio/[REPO]/settings/actions
|
|
4
|
+
# 2. under "Workflow permissions", make sure "Read and write permissions" is checked instead of the (default?) read only.
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
name: Release
|
|
8
|
+
run-name: Release ${{ github.repository }}
|
|
9
|
+
on:
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
inputs:
|
|
12
|
+
versionToBump:
|
|
13
|
+
description: 'The version to bump. Major for incompatible API changes, minor for adding BC features'
|
|
14
|
+
required: true
|
|
15
|
+
type: choice
|
|
16
|
+
options:
|
|
17
|
+
- minor
|
|
18
|
+
- major
|
|
19
|
+
jobs:
|
|
20
|
+
release:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v3
|
|
24
|
+
- uses: fregante/setup-git-user@v2
|
|
25
|
+
- id: install-zx
|
|
26
|
+
run: npm i -g zx
|
|
27
|
+
- id: install-semver-tool
|
|
28
|
+
run: |
|
|
29
|
+
wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
|
|
30
|
+
chmod +x /usr/local/bin/semver
|
|
31
|
+
- run: zx ./release.mjs -v $VERSION_TO_BUMP
|
|
32
|
+
env:
|
|
33
|
+
VERSION_TO_BUMP: ${{ inputs.versionToBump }}
|
|
34
|
+
GH_TOKEN: ${{ github.token }}
|
|
35
|
+
- uses: actions/setup-node@v1
|
|
36
|
+
with:
|
|
37
|
+
node-version: 16
|
|
38
|
+
registry-url: https://registry.npmjs.org/
|
|
39
|
+
- run: yarn install
|
|
40
|
+
- run: yarn build
|
|
41
|
+
- run: yarn publish
|
|
42
|
+
env:
|
|
43
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
44
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatsio/seatsio-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/seatsio-vue.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@babel/core": "^7.
|
|
13
|
+
"@babel/core": "^7.21.3",
|
|
14
14
|
"@babel/preset-env": "^7.14.7",
|
|
15
|
-
"@rollup/plugin-alias": "^
|
|
16
|
-
"@rollup/plugin-babel": "^
|
|
17
|
-
"@rollup/plugin-commonjs": "^
|
|
18
|
-
"@rollup/plugin-node-resolve": "^
|
|
15
|
+
"@rollup/plugin-alias": "^4.0.3",
|
|
16
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
17
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
|
18
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
19
19
|
"@rollup/plugin-replace": "^2.4.2",
|
|
20
20
|
"@vue/cli-plugin-babel": "^5.0.8",
|
|
21
21
|
"@vue/cli-service": "^5.0.8",
|
package/release.mjs
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env zx
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Script to release the seats.io java lib.
|
|
5
|
+
* - changes the version number in README.md
|
|
6
|
+
* - changes the version number in build.gradle
|
|
7
|
+
* - creates the release in Gihub (using gh cli)
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* Prerequisites:
|
|
11
|
+
* - zx installed (https://github.com/google/zx)
|
|
12
|
+
* - gh cli installed (https://cli.github.com/)
|
|
13
|
+
* - semver cli installed (https://github.com/fsaintjacques/semver-tool)
|
|
14
|
+
*
|
|
15
|
+
* Usage:
|
|
16
|
+
* zx ./release.mjs -v major/minor -n "release notes"
|
|
17
|
+
* */
|
|
18
|
+
|
|
19
|
+
// don't output the commands themselves
|
|
20
|
+
$.verbose = false
|
|
21
|
+
|
|
22
|
+
const versionToBump = getVersionToBump()
|
|
23
|
+
const latestVersion = await fetchLatestReleasedVersionNumber()
|
|
24
|
+
const nextVersion = await determineNextVersionNumber(latestVersion)
|
|
25
|
+
|
|
26
|
+
await pullLastVersion()
|
|
27
|
+
.then(bumpVersionInFiles)
|
|
28
|
+
.then(commitAndPush)
|
|
29
|
+
.then(release)
|
|
30
|
+
|
|
31
|
+
function getVersionToBump() {
|
|
32
|
+
if (!argv.v || !(argv.v === 'minor' || argv.v === 'major')) {
|
|
33
|
+
throw new Error ("Please specify -v major/minor")
|
|
34
|
+
}
|
|
35
|
+
return argv.v
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function removeLeadingV(tagName) {
|
|
39
|
+
if (tagName.startsWith('v')) {
|
|
40
|
+
return tagName.substring(1)
|
|
41
|
+
}
|
|
42
|
+
return tagName
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function fetchLatestReleasedVersionNumber() {
|
|
46
|
+
let result = await $`gh release view --json tagName`
|
|
47
|
+
let tagName = JSON.parse(result).tagName
|
|
48
|
+
return removeLeadingV(tagName)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function determineNextVersionNumber(previous) {
|
|
52
|
+
return (await $`semver bump ${versionToBump} ${previous}`).stdout.trim()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function bumpVersionInFiles() {
|
|
56
|
+
await replaceInFile("package.json", `"version": "${latestVersion}",`, `"version": "${nextVersion}",`)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function replaceInFile(filename, latestVersion, nextVersion) {
|
|
60
|
+
return await fs.readFile(filename, 'utf8')
|
|
61
|
+
.then(text => {
|
|
62
|
+
if (text.indexOf(latestVersion) < 0) {
|
|
63
|
+
throw new Error('Not the correct version. Could not find ' + latestVersion + ' in ' + filename)
|
|
64
|
+
}
|
|
65
|
+
return text
|
|
66
|
+
})
|
|
67
|
+
.then(text => text.replace(latestVersion, nextVersion))
|
|
68
|
+
.then(text => fs.writeFileSync(filename, text))
|
|
69
|
+
.then(() => gitAdd(filename))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function pullLastVersion() {
|
|
73
|
+
await $`git checkout master`
|
|
74
|
+
await $`git pull origin master`
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function gitAdd(filename) {
|
|
78
|
+
return await $`git add ${filename}`
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function commitAndPush() {
|
|
82
|
+
await $`git commit -m "version bump"`
|
|
83
|
+
await $`git push origin master`
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function release() {
|
|
87
|
+
const newTag = 'v' + nextVersion
|
|
88
|
+
return await $`gh release create ${newTag} --generate-notes`.catch(error => {
|
|
89
|
+
console.error('something went wrong while creating the release. Please revert the version change!')
|
|
90
|
+
throw error
|
|
91
|
+
})
|
|
92
|
+
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
name: 'Publish'
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [created]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v2
|
|
12
|
-
- uses: actions/setup-node@v1
|
|
13
|
-
with:
|
|
14
|
-
node-version: 16
|
|
15
|
-
registry-url: https://registry.npmjs.org/
|
|
16
|
-
- run: yarn install
|
|
17
|
-
- run: yarn build
|
|
18
|
-
- run: yarn publish
|
|
19
|
-
env:
|
|
20
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|