Skip to content

Commit a76f2a8

Browse files
authored
use .ts; Fixes #160 (#167)
1 parent 168158a commit a76f2a8

File tree

8 files changed

+44
-33
lines changed

8 files changed

+44
-33
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
env:
6363
VERBOSE: ${{ matrix.verbose }}
6464
- run: tea --env
65-
- run: tea --env xc check
6665
# ^^ tea -E necessary because we run the install script and not the action
6766
# so no additions to PATH or magic is installed
6867
- run: which tea
@@ -107,7 +106,6 @@ jobs:
107106
- run: test v$VERSION = v${{ steps.tea.outputs.version }}
108107
- run: tea --env
109108
- run: which tea
110-
- run: tea xc check
111109
- run: node --eval 'console.log(1)'
112110

113111
chaste:

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,5 @@ $ sh <(curl -Ssf tea.xyz) gum spin -- sleep 5
7878
* `sh <(curl tea.xyz) --version 1.2.3` install a specific version of tea
7979

8080

81-
82-
&nbsp;
83-
84-
# Tasks
85-
86-
## Check
87-
88-
Run this with `xc check`.
89-
90-
```sh
91-
node --check ./action.js
92-
```
93-
94-
9581
[`action.yml`]: ./action.yml
9682
[tea.xyz]: https://tea.xyz

action.js renamed to action.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const { plumbing, hooks, Path, utils, semver, SemVer } = require("@teaxyz/lib")
1+
const { porcelain, hooks, Path, utils, semver, SemVer } = require("@teaxyz/lib")
22
const { getExecOutput, exec } = require("@actions/exec")
3-
const { install, link, resolve, hydrate } = plumbing
43
const { useConfig, useSync, useCellar } = hooks
54
const core = require('@actions/core')
5+
const { install } = porcelain
66
const path = require('path')
77
const os = require("os")
88

@@ -27,7 +27,7 @@ async function go() {
2727
const pkgs = [`tea.xyz${vtea}`]
2828
for (let key in process.env) {
2929
if (key.startsWith("INPUT_+")) {
30-
const value = process.env[key]
30+
const value = process.env[key]!
3131
if (key == 'INPUT_+') {
3232
for (const item of value.split(/\s+/)) {
3333
if (item.trim()) {
@@ -52,14 +52,8 @@ async function go() {
5252
UserAgent: 'tea.setup/0.1.0', //TODO version
5353
options: { compression: 'gz' }
5454
})
55-
await useSync()
56-
const { pkgs: tree } = await hydrate(pkgs.map(utils.pkg.parse))
57-
const { pending } = await resolve(tree)
58-
for (const pkg of pending) {
59-
core.info(`installing ${utils.pkg.str(pkg)}`)
60-
const installation = await install(pkg)
61-
await link(installation)
62-
}
55+
56+
await install(pkgs)
6357

6458
const tea = await useCellar().resolve({project: 'tea.xyz', constraint: new semver.Range('*')})
6559
const teafile = tea.path.join('bin/tea').string
@@ -112,7 +106,7 @@ async function go() {
112106

113107
if (os.platform() != 'darwin') {
114108
const sh = path.join(path.dirname(__filename), "install-pre-reqs.sh")
115-
if (process.getuid() == 0) {
109+
if (process.getuid && process.getuid() == 0) {
116110
await exec(sh)
117111
} else {
118112
await exec('sudo', [sh])

dist/out/index.js

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

package-lock.json

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"@teaxyz/lib": "^0.4.2"
66
},
77
"devDependencies": {
8-
"@vercel/ncc": "^0.36.1"
8+
"@types/node": "^20.2.5",
9+
"@vercel/ncc": "^0.36.1",
10+
"typescript": "^5.1.3"
911
}
1012
}

scripts/dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tea npm install --include=dev
88

99
rm -rf dist
1010

11-
tea npx -- ncc build action.js --minify --out dist/out
11+
tea npx -- ncc build action.ts --minify --out dist/out
1212

1313
cp -R node_modules/koffi/build dist
1414

tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2016",
4+
"module": "commonjs",
5+
"esModuleInterop": true,
6+
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
8+
"skipLibCheck": true
9+
}
10+
}

0 commit comments

Comments
 (0)