Skip to content

Commit a0b8321

Browse files
committed
Init
0 parents  commit a0b8321

File tree

420 files changed

+113161
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

420 files changed

+113161
-0
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
lib/
3+
node_modules/
4+
jest.config.js

.eslintrc.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
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": ["error", {"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+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
.DS_Store

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": false,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": false,
9+
"arrowParens": "avoid"
10+
}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Hello world javascript action
2+
3+
This action prints "Hello World" or "Hello" + the name of a person to greet to the log.
4+
5+
## Inputs
6+
7+
### `who-to-greet`
8+
9+
**Required** The name of the person to greet. Default `"World"`.
10+
11+
## Outputs
12+
13+
### `time`
14+
15+
The time we greeted you.
16+
17+
## Example usage
18+
19+
```yaml
20+
uses: actions/[email protected]
21+
with:
22+
who-to-greet: 'Mona the Octocat'
23+
```

__tests__/main.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {wait} from '../src/wait'
2+
import * as process from 'process'
3+
import * as cp from 'child_process'
4+
import * as path from 'path'
5+
import {expect, test} from '@jest/globals'
6+
7+
test('throws invalid number', async () => {
8+
const input = parseInt('foo', 10)
9+
await expect(wait(input)).rejects.toThrow('milliseconds not a number')
10+
})
11+
12+
test('wait 500 ms', async () => {
13+
const start = new Date()
14+
await wait(500)
15+
const end = new Date()
16+
var delta = Math.abs(end.getTime() - start.getTime())
17+
expect(delta).toBeGreaterThan(450)
18+
})
19+
20+
// shows how the runner will run a javascript action with env / stdout protocol
21+
test('test runs', () => {
22+
process.env['INPUT_MILLISECONDS'] = '500'
23+
const np = process.execPath
24+
const ip = path.join(__dirname, '..', 'lib', 'main.js')
25+
const options: cp.ExecFileSyncOptions = {
26+
env: process.env
27+
}
28+
console.log(cp.execFileSync(np, [ip], options).toString())
29+
})

action.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'SimpleLocalize'
2+
description: 'Manage localization files with SimpleLocalize Github Action'
3+
author: "SimpleLocalize"
4+
branding:
5+
icon: 'download-cloud'
6+
color: 'blue'
7+
inputs:
8+
command:
9+
description: 'Choose a command'
10+
required: true
11+
default: 'status'
12+
cli-version:
13+
description: 'Choose a command'
14+
required: true
15+
default: 'status'
16+
api-key:
17+
description: 'Project API Key'
18+
required: false
19+
default: ''
20+
download-path:
21+
description: 'Where files should be downloaded'
22+
required: false
23+
default: './messages.json'
24+
download-format:
25+
description: 'Choose a localization files format'
26+
required: false
27+
default: 'multi-language-json'
28+
download-options:
29+
description: 'Choose additional download options'
30+
required: false
31+
default: ''
32+
upload-path:
33+
description: 'Which files should be uploaded'
34+
required: false
35+
default: './messages.json'
36+
upload-format:
37+
description: 'Choose a localization files format'
38+
required: false
39+
default: 'multi-language-json'
40+
upload-options:
41+
description: 'Choose additional upload options'
42+
required: false
43+
default: ''
44+
customer-ids:
45+
description: 'Download translations for given customerIds'
46+
required: false
47+
default: ''
48+
runs:
49+
using: 'node16'
50+
main: 'dist/index.js'

logo.png

17 KB
Loading

node_modules/.bin/uuid

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)