Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JS glob + ignore for the cache glob step #5

Open
nekowinston opened this issue Dec 20, 2023 · 0 comments · May be fixed by #6
Open

Use JS glob + ignore for the cache glob step #5

nekowinston opened this issue Dec 20, 2023 · 0 comments · May be fixed by #6
Labels
enhancement New feature or request

Comments

@nekowinston
Copy link
Owner

nekowinston commented Dec 20, 2023

The current find ${{ inputs.directory }} -regex '.*\.[jt]sx*' -exec deno cache {} \; stuff is pretty... gross.
I'd like to make picking the files which deno caches more customizable and intuitive.

Ideally, this would be handled by the deno binary itself; e.g.:

Repo layout:

/
├── test/
│   ├── basic/
│   │   └── main.ts*
│   ├── customized/
│   │   ├── deno.json
│   │   ├── deno.lock
│   │   └── main.ts
│   └── problem-matcher/
│       ├── deno.json
│       ├── deno.lock
│       ├── foo.ts
│       ├── foo_test.ts
│       └── main.ts
├── .denoignore
└── deno.json

.denoignore:

test/problem-matcher
!test/problem-matcher/foo.ts
$ deno cache
-> caching test/basic/main.ts
-> caching test/customized/main.ts
-> caching test/problem-matcher/foo.ts

Working around the fact that this isn't supported by the binary, we could create a script that works in both Node (for actions) and Deno (for the dev), which effectively does this. The dev could add this script to the deno.json like

{
  "tasks": {
    "cache": "deno run -A https://esm.sh/gh/nekowinston/setup-deno/cache.ts"
  }
}

Which then calls deno cache on each file in the glob pattern, storing it in deno.lock.
The Node script would have the same files in its match, with improved customizability compared to just a single action input for a directory.

@nekowinston nekowinston added the enhancement New feature or request label Dec 20, 2023
@nekowinston nekowinston linked a pull request Dec 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant