A task runner and repo management tool for the web ecosystem, written in Rust.
📦 Build and prepare packages for npm distribution using standardized configurations and practices. Gotta pack 'em all!
🚀 A collection of type-safe cross-platform packages for building robust server-side and client-side systems.
🎮 A collection of lightweight, up-to-date, pre-generated, specification compliant, localized emoji JSON datasets, regex patterns, and more.
🌀 React library to safely render HTML, filter attributes, autowrap text with matchers, render emoji characters, and much more.
Docusaurus plugin that provides source code API documentation powered by TypeDoc.
deps(moon): Update to v1. (#35)
Can you see if this is resolved with v1? Be sure the task has platform: system
.
v1 now wraps system tasks in a shell. Can you see if the bin is found now?
Is your feature request related to a problem? Please describe.
I have the need to define a task in .moon/tasks.yml
which dynamically include the current system timestamp in a command argument. e.g.
deploy:
command: 'cdk'
args:
- 'deploy'
- '--all'
- '--require-approval=never'
- '--app "deploy --target=$projectRoot"'
- '--output $workspaceRoot/.cdk/$project/$(date +%s)'
deps:
- ~:build
The $(date +%s)
portion is problematic as we're not in a sh
or bash
shell and there doesn't appear to be a way to get that kind of data.
Describe the solution you'd like
The quick and dirty fix for our needs would be to create a new token variable $timestamp
that was set to the system timestamp/epoch. It doesn't have to be high resolution, but I certainly wouldn't complain if it was.
Describe alternatives you've considered
I'm not sure at the moment how to get around this. A nice alternative might be something like a @shell
function that would allow executing shell commands and returning the stdout output. Something like @shell($(date +%s))
would get the job done.
Additional context
Landed in v1
@mrobinsn Can you try v1?
Is your feature request related to a problem? Please describe.
It's not convenient to run a code block in tasks currently, which is quite common if we want moon to be "language agnostic and easily pluggable in the future."
Describe the solution you'd like
Add running code block support for tasks, like
tasks:
build:
shell: bash # It will be better if we can change to other shells, support syntax like `['bash', '-c']` or `bash -c`
load-dotenv: true # load a `.env` file automatically for the following code block
run: | # Writing multi-line commands for better readability
npm ci
npm run build
echo 'Done'
REF: https://docs.github.com/en/github-ae@latest/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Describe alternatives you've considered
Additional context
System tasks now support shells in v1. I'm going to close this as we won't support multi-commands in a single task.
i would like to be able to use execute any shell command in a selectable shell. most users have several cli utilities install that are only available in a certain shell with a profile)
shell: powershell os: win 11 moon: 0.8.0
.moon/project.yml
tasks:
clean:
command: 'rimraf'
type: 'system'
args:
- ' dist'
current error message
$ moon run types:clean
▪▪▪▪ types:clean
ERROR Process failure for rimraf: program not found
rimraf is installed globally with npm
also why cant the command value be a 'sentence' (string with whitespaces), to write the full command of something? if you need any further information please let me know.
Long time coming, but system tasks now run in a shell in v1.
Release
It's happening!
$timestamp
token - https://github.com/moonrepo/moon/issues/705system
commands in a shellDevelopment branch for https://github.com/moonrepo/moon/issues/708
fix: Improve default/empty task input handling. (#747)
Test stuff.
Add flags and global inputs.
Fix tests.
More tests.
Rename flag.
Fixes https://github.com/moonrepo/moon/issues/746
This implementation is far too complicated, I need to rewrite it. The problem is that inputs come from multiple sources -- global inputs, implicit inputs, local inputs -- and how they all merge together still feels like undefined functionality.
Rename flag.
Fix tests.
More tests.
Digging into this here: https://github.com/moonrepo/moon/pull/747/files
Will get this in for the release today.
Add flags and global inputs.
docs: Add how it works sections. (#745)
Start on cheat sheet.
Update blog.
Add lang how it works.
Update deps.
Add project graph.
Change headers.
Start on dep graph.
Add dep graph.
Update deps.
Delete resolutions.
Fix build.
Trying to provide more knowledge about how moon's internals work.
@lagz0ne Good callout. I kind of just assumed everyone had git, so I'll add it to the docs.