Skip to content

Commit 8cdbba8

Browse files
authored
Update dependencies and release 2.0.0 (#120)
1 parent 74f2609 commit 8cdbba8

25 files changed

+8795
-10151
lines changed

Diff for: .eslintrc.json

+56-54
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
11
{
2-
"plugins": ["jest", "@typescript-eslint"],
3-
"extends": ["plugin:github/recommended"],
4-
"parser": "@typescript-eslint/parser",
5-
"parserOptions": {
6-
"ecmaVersion": 9,
7-
"sourceType": "module",
8-
"project": "./tsconfig.json"
9-
},
10-
"rules": {
11-
"i18n-text/no-en": "off",
12-
"eslint-comments/no-use": "off",
13-
"import/no-namespace": "off",
14-
"no-unused-vars": "off",
15-
"@typescript-eslint/no-unused-vars": "error",
16-
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
17-
"@typescript-eslint/no-require-imports": "error",
18-
"@typescript-eslint/array-type": "error",
19-
"@typescript-eslint/await-thenable": "error",
20-
"@typescript-eslint/ban-ts-comment": "error",
21-
"camelcase": "off",
22-
"@typescript-eslint/consistent-type-assertions": "error",
23-
"@typescript-eslint/explicit-function-return-type": ["warn", {"allowExpressions": true}],
24-
"@typescript-eslint/func-call-spacing": ["error", "never"],
25-
"@typescript-eslint/no-array-constructor": "error",
26-
"@typescript-eslint/no-empty-interface": "error",
27-
"@typescript-eslint/no-explicit-any": "error",
28-
"@typescript-eslint/no-extraneous-class": "error",
29-
"@typescript-eslint/no-for-in-array": "error",
30-
"@typescript-eslint/no-inferrable-types": "error",
31-
"@typescript-eslint/no-misused-new": "error",
32-
"@typescript-eslint/no-namespace": "error",
33-
"@typescript-eslint/no-non-null-assertion": "warn",
34-
"@typescript-eslint/no-unnecessary-qualifier": "error",
35-
"@typescript-eslint/no-unnecessary-type-assertion": "error",
36-
"@typescript-eslint/no-useless-constructor": "error",
37-
"@typescript-eslint/no-var-requires": "error",
38-
"@typescript-eslint/prefer-for-of": "warn",
39-
"@typescript-eslint/prefer-function-type": "warn",
40-
"@typescript-eslint/prefer-includes": "error",
41-
"@typescript-eslint/prefer-string-starts-ends-with": "error",
42-
"@typescript-eslint/promise-function-async": "error",
43-
"@typescript-eslint/require-array-sort-compare": "error",
44-
"@typescript-eslint/restrict-plus-operands": "error",
45-
"semi": "off",
46-
"@typescript-eslint/semi": ["error", "never"],
47-
"@typescript-eslint/type-annotation-spacing": "error",
48-
"@typescript-eslint/unbound-method": "error"
49-
},
50-
"env": {
51-
"node": true,
52-
"es6": true,
53-
"jest/globals": true
54-
}
55-
}
2+
"plugins": ["jest", "@typescript-eslint"],
3+
"extends": ["plugin:github/recommended"],
4+
"parser": "@typescript-eslint/parser",
5+
"parserOptions": {
6+
"ecmaVersion": 9,
7+
"sourceType": "module",
8+
"project": "./tsconfig.json"
9+
},
10+
"rules": {
11+
"i18n-text/no-en": "off",
12+
"eslint-comments/no-use": "off",
13+
"import/no-namespace": "off",
14+
"no-unused-vars": "off",
15+
"@typescript-eslint/no-unused-vars": "error",
16+
"@typescript-eslint/explicit-member-accessibility": [
17+
"error",
18+
{
19+
"accessibility": "no-public"
20+
}
21+
],
22+
"@typescript-eslint/no-require-imports": "error",
23+
"@typescript-eslint/array-type": "error",
24+
"@typescript-eslint/await-thenable": "error",
25+
"@typescript-eslint/ban-ts-comment": "error",
26+
"camelcase": "off",
27+
"@typescript-eslint/consistent-type-assertions": "error",
28+
"@typescript-eslint/func-call-spacing": ["error", "never"],
29+
"@typescript-eslint/no-array-constructor": "error",
30+
"@typescript-eslint/no-empty-interface": "error",
31+
"@typescript-eslint/no-explicit-any": "error",
32+
"@typescript-eslint/no-extraneous-class": "error",
33+
"@typescript-eslint/no-for-in-array": "error",
34+
"@typescript-eslint/no-inferrable-types": "error",
35+
"@typescript-eslint/no-misused-new": "error",
36+
"@typescript-eslint/no-namespace": "error",
37+
"@typescript-eslint/no-non-null-assertion": "warn",
38+
"@typescript-eslint/no-unnecessary-qualifier": "error",
39+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
40+
"@typescript-eslint/no-useless-constructor": "error",
41+
"@typescript-eslint/no-var-requires": "error",
42+
"@typescript-eslint/prefer-for-of": "warn",
43+
"@typescript-eslint/prefer-function-type": "warn",
44+
"@typescript-eslint/prefer-includes": "error",
45+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
46+
"@typescript-eslint/promise-function-async": "error",
47+
"@typescript-eslint/require-array-sort-compare": "error",
48+
"@typescript-eslint/restrict-plus-operands": "error",
49+
"@typescript-eslint/type-annotation-spacing": "error",
50+
"@typescript-eslint/unbound-method": "error"
51+
},
52+
"env": {
53+
"node": true,
54+
"es6": true,
55+
"jest/globals": true
56+
}
57+
}

Diff for: .github/workflows/check-dist.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ on:
1010
branches:
1111
- main
1212
paths-ignore:
13-
- '**.md'
13+
- "**.md"
1414
pull_request:
1515
paths-ignore:
16-
- '**.md'
16+
- "**.md"
1717
workflow_dispatch:
1818

1919
jobs:
2020
check-dist:
2121
if: startsWith(github.head_ref, 'auto-update') == false
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525

26-
- name: Set Node.js 16.x
27-
uses: actions/setup-node@v3
26+
- name: Set Node.js 20.x
27+
uses: actions/setup-node@v4
2828
with:
29-
node-version: 16.x
29+
node-version: 20.x
3030

3131
- name: Install dependencies
3232
run: npm ci
@@ -46,7 +46,7 @@ jobs:
4646
id: diff
4747

4848
# If index.js was different than expected, upload the expected version as an artifact
49-
- uses: actions/upload-artifact@v2
49+
- uses: actions/upload-artifact@v4
5050
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
5151
with:
5252
name: dist

Diff for: .github/workflows/test.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: 'build-test'
1+
name: "build-test"
22
on: # rebuild any PRs and main branch changes
33
pull_request:
44
push:
55
branches:
66
- main
7-
- 'releases/*'
7+
- "releases/*"
88
workflow_dispatch:
99

1010
jobs:
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v3
24-
- name: 'Create Autocomplete PR'
24+
- name: "Create Autocomplete PR"
2525
id: simple-spec
2626
uses: ./
2727
with:
@@ -31,22 +31,22 @@ jobs:
3131
integration: commander
3232
repo-name: push-to-fig-autocomplete-action
3333
repo-org: withfig
34-
pr-body: 'Integration test (simple-spec)'
34+
pr-body: "Integration test (simple-spec)"
3535
diff-based-versioning: false
3636
- name: Close Pull Request
3737
uses: peter-evans/close-pull@v2
3838
with:
3939
token: ${{ secrets.FIG_BOT_TOKEN }}
4040
pull-request-number: ${{ steps.simple-spec.outputs.pr-number }}
41-
comment: 'Closing created PR'
41+
comment: "Closing created PR"
4242
delete-branch: true
4343

4444
test-diff-based-versioning:
4545
if: startsWith(github.head_ref, 'auto-update') == false
4646
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v3
49-
- name: 'Create Autocomplete PR'
49+
- name: "Create Autocomplete PR"
5050
id: diff-based-versioning
5151
uses: ./
5252
with:
@@ -56,13 +56,13 @@ jobs:
5656
integration: commander
5757
repo-name: push-to-fig-autocomplete-action
5858
repo-org: withfig
59-
pr-body: 'Integration test (diff-based-versioning)'
59+
pr-body: "Integration test (diff-based-versioning)"
6060
diff-based-versioning: true
6161
new-spec-version: 1.1.0
6262
- name: Close Pull Request
6363
uses: peter-evans/close-pull@v2
6464
with:
6565
token: ${{ secrets.FIG_BOT_TOKEN }}
6666
pull-request-number: ${{ steps.diff-based-versioning.outputs.pr-number }}
67-
comment: 'Closing created PR'
67+
comment: "Closing created PR"
6868
delete-branch: true

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ Thumbs.db
9696

9797
# Ignore built ts files
9898
__tests__/runner/*
99-
lib/**/*
99+
lib/**/*

Diff for: .prettierrc.json

-10
This file was deleted.

Diff for: CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
## Change action.yml
32

43
The action.yml defines the inputs and output for your action.
@@ -16,9 +15,9 @@ import * as core from '@actions/core';
1615
...
1716

1817
async function run() {
19-
try {
18+
try {
2019
...
21-
}
20+
}
2221
catch (error) {
2322
core.setFailed(error.message);
2423
}
@@ -31,9 +30,10 @@ See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/R
3130

3231
## Publish to a distribution branch
3332

34-
Actions are run from GitHub repos so we will checkin the packed dist folder.
33+
Actions are run from GitHub repos so we will checkin the packed dist folder.
3534

3635
Then run [ncc](https://github.com/zeit/ncc) and push the results:
36+
3737
```bash
3838
$ npm run package
3939
$ git add dist
@@ -43,7 +43,7 @@ $ git push origin releases/v1
4343

4444
Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project.
4545

46-
Your action is now published! :rocket:
46+
Your action is now published! :rocket:
4747

4848
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
4949

Diff for: README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
<a href="https://github.com/actions/typescript-action/actions"><img alt="typescript-action status" src="https://github.com/actions/typescript-action/workflows/build-test/badge.svg"></a>
33
</p>
44

5-
65
## Usage
76

87
```yml
9-
name: 'Publish version'
8+
name: "Publish version"
109
on:
1110
push:
12-
tags:
13-
- 'v*'
11+
tags:
12+
- "v*"
1413
workflow_dispatch:
1514

1615
jobs:
@@ -22,7 +21,8 @@ jobs:
2221
- name: Generate the spec
2322
run:
2423
## Execute commands to generate the spec through some official or third party integration
25-
- name: Create Autocomplete PR
24+
- name:
25+
Create Autocomplete PR
2626
## Create the autocomplete PR using this action
2727
uses: withfig/publish-to-fig-autocomplete@v1
2828
with:
@@ -44,9 +44,10 @@ jobs:
4444
- `pr-body`: set a custom PR body description
4545

4646
We also provide support for third party autocomplete repos via the following inputs:
47+
4748
- `repo-org`: name of the organization/user that stores the third party autocomplete repository (default: `withfig`)
4849
- `repo-name`: name of the third party autocomplete repository (default: `autocomplete`)
49-
- `diff-based-versioning`: use new diff-based versioning (default: false) (__requires__: `new-spec-version` to be set if `diff-based-versioning` is true)
50+
- `diff-based-versioning`: use new diff-based versioning (default: false) (**requires**: `new-spec-version` to be set if `diff-based-versioning` is true)
5051
- `new-spec-version`: the new spec version (only required when using diff-based-versioning)
5152
- `use-minor-base`: create a new version file per each minor version (only used with diff-based-versioning) (default: `false`)
5253

Diff for: action.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
name: 'Update Fig Autocomplete spec'
2-
description: 'Action to automatically open a new PR to the withfig/autocomplete repo'
3-
author: 'Fig'
1+
name: "Update Fig Autocomplete spec"
2+
description: "Action to automatically open a new PR to the withfig/autocomplete repo"
3+
author: "Fig"
44
inputs:
55
token:
6-
description: 'GitHub access token'
6+
description: "GitHub access token"
77
default: ${{ github.token }}
88
autocomplete-spec-name:
99
required: true
10-
description: 'The spec name in the autocomplete repo. Do not include extension and do not include src/ at the beginning'
10+
description: "The spec name in the autocomplete repo. Do not include extension and do not include src/ at the beginning"
1111
spec-path:
1212
required: true
13-
description: 'The path to the spec in the actual repo'
13+
description: "The path to the spec in the actual repo"
1414
integration:
15-
description: 'The official Fig integration name used to autogenerate the spec'
15+
description: "The official Fig integration name used to autogenerate the spec"
1616
pr-body:
17-
description: 'The created PR description'
17+
description: "The created PR description"
1818
diff-based-versioning:
19-
description: 'Use new diff-based versioning'
20-
default: false
19+
description: "Use new diff-based versioning"
20+
default: "false"
2121
# Diff based versioning params
2222
new-spec-version:
23-
description: 'The new spec version (only required when using diff-based-versioning)'
23+
description: "The new spec version (only required when using diff-based-versioning)"
2424
use-minor-base:
25-
descripttion: 'Create a new version file per each minor version'
26-
default: false
25+
description: "Create a new version file per each minor version"
26+
default: "false"
2727
# Optional params
2828
repo-org:
29-
description: 'The name of the organization that contains the repo in which to create the PR'
30-
default: 'withfig'
31-
repo-name:
32-
description: 'The name of the repo in which to create the PR'
33-
default: 'autocomplete'
29+
description: "The name of the organization that contains the repo in which to create the PR"
30+
default: "withfig"
31+
repo-name:
32+
description: "The name of the repo in which to create the PR"
33+
default: "autocomplete"
3434
runs:
35-
using: 'node16'
36-
main: 'dist/index.js'
35+
using: "node20"
36+
main: "dist/index.js"

Diff for: dist/index.js

+1,649-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)