Changes for tea/cli 0.19 (#101)

* Changes for tea/cli 0.19

* wip

* wip

* wip

* wip

* wip
This commit is contained in:
Max Howell 2023-01-14 15:57:43 -05:00 committed by GitHub
parent f51268d2b3
commit fe6eadedc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 40 deletions

View file

@ -2,7 +2,9 @@ name: ci-scripts
on: on:
pull_request: pull_request:
paths: [scripts/**.ts] paths:
- scripts/**.ts
- import-map.json
jobs: jobs:
typecheck: typecheck:
@ -11,9 +13,5 @@ jobs:
TEA_SECRET: ${{ secrets.TEA_SECRET }} TEA_SECRET: ${{ secrets.TEA_SECRET }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: teaxyz/setup@v0 - uses: teaxyz/setup@v0
with: - run: tea deno check --unstable --import-map=import-map.json scripts/*.ts
target: typecheck
env:
GITHUB_TOKEN: ${{ github.token }}

View file

@ -17,11 +17,11 @@ versioned.
See the contributing guide in [pantry.zero]. See the contributing guide in [pantry.zero].
   
# Meta # Meta
## Dependencies ## Dependencies
| Project | Version | | Project | Version |
@ -29,19 +29,5 @@ See the contributing guide in [pantry.zero].
| deno.land | ^1.27 | | deno.land | ^1.27 |
| tea.xyz | ^0 | | tea.xyz | ^0 |
## Build All
```sh
scripts/ls.ts | scripts/sort.ts | scripts/build.ts
```
## Typecheck
```sh
for x in $(find scripts -name '*.ts'); do
deno check --unstable --import-map=$SRCROOT/import-map.json $x
done
```
[pantry.zero]: https://github.com/teaxyz/pantry.zero#contributing [pantry.zero]: https://github.com/teaxyz/pantry.zero#contributing
[pantry.extra]: https://github.com/teaxyz/pantry.extra [pantry.extra]: https://github.com/teaxyz/pantry.extra

View file

@ -1,14 +1,14 @@
{ {
"imports": { "imports": {
"prefab": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/prefab/index.ts", "prefab": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/prefab/index.ts",
"semver": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/utils/semver.ts", "semver": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/utils/semver.ts",
"hooks": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/hooks/index.ts", "hooks": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/hooks/index.ts",
"utils": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/utils/index.ts", "utils": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/utils/index.ts",
"path": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/vendor/Path.ts", "path": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/vendor/Path.ts",
"prefab/": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/prefab/", "prefab/": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/prefab/",
"types": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/types.ts", "types": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/types.ts",
"hooks/": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/hooks/", "hooks/": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/hooks/",
"utils/": "https://raw.githubusercontent.com/teaxyz/cli/v0.18.1/src/utils/", "utils/": "https://raw.githubusercontent.com/teaxyz/cli/v0.19.1/src/utils/",
"deno/": "https://deno.land/std@0.156.0/", "deno/": "https://deno.land/std@0.156.0/",
"is_what": "https://deno.land/x/is_what@v4.1.7/src/index.ts", "is_what": "https://deno.land/x/is_what@v4.1.7/src/index.ts",
"cliffy/": "https://deno.land/x/cliffy@v0.25.2/", "cliffy/": "https://deno.land/x/cliffy@v0.25.2/",

View file

@ -11,6 +11,10 @@ provides:
- bin/bash - bin/bash
- bin/bashbug - bin/bashbug
interprets:
extensions: bash
args: [bash, -e]
build: build:
dependencies: dependencies:
tea.xyz/gx/make: '*' tea.xyz/gx/make: '*'

View file

@ -59,10 +59,10 @@ if (import.meta.main) {
if (Deno.env.get("GITHUB_ACTIONS")) { if (Deno.env.get("GITHUB_ACTIONS")) {
const projects = rv.map(x => x.project).join(":") const projects = rv.map(x => x.project).join(":")
console.log(`::set-output name=projects::${projects}`) console.log(`::set-output name=projects::${projects}`)
} else if (flags.json) { // } else if (flags.json) {
const obj = rv.map(({ path, project }) => ({ path: path.string, project })) // const obj = rv.map(({ path, project }) => ({ path: path.string, project }))
const out = JSON.stringify(obj, null, 2) // const out = JSON.stringify(obj, null, 2)
console.log(out) // console.log(out)
} else { } else {
console.log(rv.map(x => x.project).join("\n")) console.log(rv.map(x => x.project).join("\n"))
} }

View file

@ -19,7 +19,7 @@ import { hydrate } from "prefab"
import * as ARGV from "./utils/args.ts" import * as ARGV from "./utils/args.ts"
import { set_output } from "./utils/gha.ts"; import { set_output } from "./utils/gha.ts";
const flags = useFlags() // const flags = useFlags()
const pantry = usePantry() const pantry = usePantry()
const dry = await ARGV.toArray(ARGV.pkgs()) const dry = await ARGV.toArray(ARGV.pkgs())
@ -33,9 +33,9 @@ if (Deno.env.get("GITHUB_ACTIONS")) {
await set_output('pkgs', wet.dry.map(pkg.str)) await set_output('pkgs', wet.dry.map(pkg.str))
} else { } else {
const gas = wet.dry.map(pkg.str) const gas = wet.dry.map(pkg.str)
if (flags.json) { // if (flags.json) {
console.log(gas) // console.log(gas)
} else { // } else {
console.log(gas.join("\n")) console.log(gas.join("\n"))
} // }
} }

View file

@ -44,7 +44,7 @@ function assert_pkg(pkg: Package | PackageRequirement) {
} else { } else {
return { return {
project: pkg.project, project: pkg.project,
version: new SemVer(pkg.constraint), version: new SemVer(pkg.constraint, {tolerant: true}),
} }
} }
} }