Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
3fcae77
Use latest jsr std crypto
PaulThompson Mar 23, 2025
a838440
Open .denoversion to any <3 in ./dnit
PaulThompson Mar 23, 2025
bb8cd60
fix: override keyword in dnit.ts on loggers
PaulThompson Mar 23, 2025
37d9f90
fix: exceptions as unknown in adl runtime json.ts
PaulThompson Mar 23, 2025
47e49ef
ci: Use v2 throughout
PaulThompson Mar 23, 2025
1f52f41
fix: Use denoland/setup-deno@v2
PaulThompson Mar 25, 2025
03a0a84
ci: Try using any v2.x
PaulThompson Mar 25, 2025
9c1b1eb
fix: @setup-deno v2.x gets v2.2.4 so specify exactly that.
PaulThompson Mar 25, 2025
4d5972a
Update setup-deno for test
PaulThompson Mar 29, 2025
f6105cd
Update from deprecated @std/flags to @std/cli/parse-args
PaulThompson Mar 29, 2025
3a1efd4
Update path to jsr @std
PaulThompson Mar 29, 2025
190f858
Cleanup setupLogging
PaulThompson Mar 29, 2025
9662b91
Dev utils dnit lint, fmt, check (for this repo only)
PaulThompson Mar 29, 2025
4c43dc9
Update to jsr:@std/log@0.224.14
PaulThompson Mar 29, 2025
2f0986c
Update to jsr:@std/fs@1.0.15
PaulThompson Mar 29, 2025
ab17fc2
Update semver to @std/semver
PaulThompson Mar 29, 2025
118f2e4
Add allow-import on the launch args
PaulThompson Mar 29, 2025
02f9421
Bump version manually for dev on v2
PaulThompson Mar 29, 2025
3a44f5d
Switch to import map in deno.json - requires install with --config arg
PaulThompson Mar 29, 2025
8da3eb0
Require v2.1 at least
PaulThompson Mar 29, 2025
f9d33d7
Tidy comments in github workflow
PaulThompson Mar 29, 2025
1fb0842
Drop old example dir
PaulThompson Mar 29, 2025
6407556
Drop allow-import
PaulThompson Mar 29, 2025
ee4cb74
Re-support v1.x
PaulThompson Mar 29, 2025
3f18758
Revert "Re-support v1.x"
PaulThompson Mar 29, 2025
0225482
fixes for deno publish
PaulThompson Mar 29, 2025
fb728df
lint fixes
PaulThompson Apr 6, 2025
8df8ad6
Replace ADL with Zod for type definitions and serialization
PaulThompson Aug 4, 2025
5b9027a
Add error handling for manifest schema validation failures
PaulThompson Aug 4, 2025
6f87751
Add hello world example and fix README issues
PaulThompson Aug 4, 2025
c8238bc
Extract getOrCreateTaskManifest helper and start module restructuring
PaulThompson Aug 4, 2025
b75101f
Update imports for moved types module, all tests passing
PaulThompson Aug 4, 2025
b981194
Fix lint errors in core/types.ts by adding explicit type annotations
PaulThompson Aug 4, 2025
8247308
Complete module restructuring: split dnit.ts into focused modules
PaulThompson Aug 4, 2025
f3a9eea
Clean up unused imports in cli.ts
PaulThompson Aug 4, 2025
979cd25
Remove obsolete ADL tasks: genadl and updategenadlfix
PaulThompson Aug 4, 2025
748a0c9
Fix build tasks after ADL removal
PaulThompson Aug 4, 2025
516d93c
Extract TaskInterface to separate file for better organization
PaulThompson Aug 4, 2025
27e8174
Move TaskContext to taskInterface.ts for better organization
PaulThompson Aug 4, 2025
62be19d
Major refactoring: eliminate circular imports and improve code organi…
PaulThompson Aug 4, 2025
d02c6e2
Formatting
PaulThompson Aug 4, 2025
899a614
Move factory functions to their respective files
PaulThompson Aug 5, 2025
6c0d635
Complete additional code organization improvements
PaulThompson Aug 5, 2025
9ec6a8f
Fix lint issues and optimize imports
PaulThompson Aug 5, 2025
7e48ce0
Update files.md for refactored architecture
PaulThompson Aug 9, 2025
57b5675
Add comparison between current files.md and reorganise branch version
PaulThompson Aug 9, 2025
e9e1534
Fix circular dependencies and create import analyzer tool
PaulThompson Aug 9, 2025
f2b4c54
Update files.md documentation to reflect current architecture
PaulThompson Aug 9, 2025
e9ec63a
Move manifest types to interfaces directory
PaulThompson Aug 9, 2025
4aeea1d
Final organizational improvements
PaulThompson Aug 9, 2025
bce1574
Update dependencies to latest versions
PaulThompson Aug 9, 2025
6db3c50
Upgrade Zod to version 4.0.16
PaulThompson Aug 9, 2025
090a620
Standardize dnit/deps.ts to use import map approach
PaulThompson Aug 9, 2025
6a444d5
Fix final hardcoded dependency version in tests/basic.test.ts
PaulThompson Aug 9, 2025
3787b55
Add .gitignore for dnit manifest files
PaulThompson Aug 9, 2025
9dbfe18
git ignore test manifests
PaulThompson Aug 9, 2025
5624ddf
Modernize dnit/main.ts to eliminate deps.ts pattern
PaulThompson Aug 9, 2025
154fb94
Remove development helper files
PaulThompson Aug 9, 2025
6690fd7
Remove import analyser
PaulThompson Aug 9, 2025
d387004
Prepare for JSR publishing
PaulThompson Aug 9, 2025
3a45c4f
Add JSR publish exclusions
PaulThompson Aug 9, 2025
2f921ad
Remove legacy dnit.ts, use mod.ts as main export
PaulThompson Aug 9, 2025
6d4244a
Fix dnit check task to use mod.ts instead of dnit.ts
PaulThompson Aug 9, 2025
789457e
Lint & format
PaulThompson Aug 9, 2025
63af84f
Update GitHub Actions to test with Deno 2.4.3
PaulThompson Aug 9, 2025
c8011a3
Update README docs and fix import-map flag for Deno 2
PaulThompson Aug 9, 2025
4413654
Update README to document deno.json support
PaulThompson Aug 9, 2025
c55d9ad
Update README examples to use Deno 2 APIs
PaulThompson Aug 9, 2025
c3c9d5a
Use TaskName type in README documentation
PaulThompson Aug 9, 2025
28d468d
Add flavored types for nominal typing of string types
PaulThompson Aug 9, 2025
d72555f
Simplify flavored types to use single symbol and generic
PaulThompson Aug 9, 2025
581179e
Add reference link for flavored nominal typing pattern
PaulThompson Aug 9, 2025
37b9fe2
Add comment explaining symbol usage for flavored types
PaulThompson Aug 9, 2025
0eb211a
Integrate flavored types directly into Zod schemas
PaulThompson Aug 9, 2025
6328341
Add explicit types for JSR compatibility - keep flavored types separa…
PaulThompson Aug 9, 2025
78270ca
Flavored types implementation complete and JSR-ready
PaulThompson Aug 9, 2025
6e31445
Reorganize flavoring and manifest types into separate interface and i…
PaulThompson Aug 9, 2025
48a0f48
Remove Zod schema exports from public API - keep as internal implemen…
PaulThompson Aug 9, 2025
3171684
Remove unused IFileSystem and IStatResult interfaces
PaulThompson Aug 9, 2025
14dd388
Remove unused ILoggingSetup interface
PaulThompson Aug 9, 2025
565826d
Code updates and documentation changes
PaulThompson Aug 9, 2025
88d54f9
Remove asyncQueue from public interface, add schedule method
PaulThompson Aug 9, 2025
73c13ed
Make AsyncQueue schedule method generic per call, remove unnecessary …
PaulThompson Aug 9, 2025
ce586be
Add comprehensive test plan
PaulThompson Aug 9, 2025
633f79e
Add comprehensive file tracking system tests
PaulThompson Aug 9, 2025
8468d49
Update test plan - mark file tracking system tests as completed
PaulThompson Aug 9, 2025
008ef14
Add SHA1 hash validation test with known values
PaulThompson Aug 9, 2025
fb0c25b
Remove 'as any' type assertions from TrackedFile tests
PaulThompson Aug 9, 2025
115d5c3
Fix lint issues in file tracking tests
PaulThompson Aug 9, 2025
a5118ea
Add manifest system tests
PaulThompson Aug 9, 2025
8619084
Fix test import errors
PaulThompson Aug 9, 2025
a25dedf
Fix linting errors
PaulThompson Aug 9, 2025
1485d71
Mark Section 2: Manifest System Tests as completed
PaulThompson Aug 9, 2025
01ed1cc
Add comprehensive Task System tests
PaulThompson Aug 9, 2025
4623a66
Add utility tests for Section 7 of test plan
PaulThompson Aug 9, 2025
26e70bd
Mark Section 7: Utility Tests as completed
PaulThompson Aug 9, 2025
61006df
Implement targets.test.ts with comprehensive test coverage
PaulThompson Aug 9, 2025
67c4267
Add comprehensive Integration Tests for dependency resolution and up-…
PaulThompson Aug 9, 2025
0234c15
Fix type errors in git.test.ts and task.test.ts
PaulThompson Aug 9, 2025
64b0e4a
Adding tests
PaulThompson Aug 9, 2025
e4e394a
Implement comprehensive CLI tests (cli.test.ts)
PaulThompson Aug 9, 2025
59a61c9
Add comprehensive launch system tests
PaulThompson Aug 9, 2025
f85c893
Add comprehensive tab completion tests
PaulThompson Aug 10, 2025
9b9d70d
Update test plan to mark CLI tests complete
PaulThompson Aug 10, 2025
295ba06
Add comprehensive test suite review documentation
PaulThompson Aug 10, 2025
d53aeda
Add mock redundancy analysis to test review
PaulThompson Aug 10, 2025
f55cc15
remove old test plan
PaulThompson Aug 10, 2025
99e6d5e
Add mock vs execBasic analysis and refactoring recommendations
PaulThompson Aug 10, 2025
faf2ed3
Add comprehensive mock logger analysis - reveals 80+ redundant lines
PaulThompson Aug 10, 2025
0054245
Restructure test review with actionable todo list at top
PaulThompson Aug 10, 2025
26520ef
Remove redundant mock logger from TaskContext.test.ts
PaulThompson Aug 10, 2025
e3eecc4
Replace mock exec contexts with execBasic in TaskContext.test.ts
PaulThompson Aug 10, 2025
a76b6c5
Mark TaskContext.test.ts improvements as completed in test-review.md
PaulThompson Aug 10, 2025
bf4fd71
Mark TaskContext.test.ts as refactored in test file listing
PaulThompson Aug 10, 2025
4ed8799
Clean up redundant TaskContext.test.ts mentions in action items
PaulThompson Aug 10, 2025
c1d37c2
Remove specific counts from test-review.md, use qualitative terms
PaulThompson Aug 10, 2025
7a0af6c
Refactor task.test.ts: remove mock loggers, use execBasic
PaulThompson Aug 10, 2025
3bf523d
Mark task.test.ts as refactored in test-review.md
PaulThompson Aug 10, 2025
49380f9
Fix TrackedFile.test.ts: use real loggers instead of empty objects
PaulThompson Aug 10, 2025
30b2db6
Mark TrackedFile.test.ts and TrackedFilesAsync.test.ts as completed i…
PaulThompson Aug 10, 2025
a13c838
Mark manifest test files as already clean in test-review.md
PaulThompson Aug 10, 2025
f73dbff
Remove redundant mock logger from cli.test.ts
PaulThompson Aug 10, 2025
90ac269
Update test-review.md for CLI files completion
PaulThompson Aug 10, 2025
ecb4e2e
Remove redundant mock logger from tabcompletion.test.ts
PaulThompson Aug 10, 2025
89d4d95
Mark tabcompletion.test.ts as refactored in test-review.md
PaulThompson Aug 10, 2025
eae8acf
Refactor dependencies.test.ts - remove mock loggers, convert to execB…
PaulThompson Aug 10, 2025
303e863
Refactor uptodate.test.ts - remove mock loggers, convert to execBasic
PaulThompson Aug 10, 2025
8000de0
Update test-review.md - mark completed refactoring work
PaulThompson Aug 10, 2025
9844033
Refactor git.test.ts - remove mock loggers, improve context setup
PaulThompson Aug 10, 2025
2bf79fe
Complete test refactoring documentation - mark all files as processed
PaulThompson Aug 10, 2025
f52937a
Fix flaky test in basic.test.ts - replace uuid with crypto.randomUUID…
PaulThompson Aug 10, 2025
7c0411c
Mark flaky test as fixed in documentation
PaulThompson Aug 10, 2025
55f52f8
Fix race condition in clean task - await scheduled operations
PaulThompson Aug 10, 2025
c751d0b
Use proper logger for manifest warnings instead of console.warn
PaulThompson Aug 10, 2025
78b0771
Add .test/ directory to .gitignore
PaulThompson Aug 10, 2025
52f5524
Optimize test timing delays - reduce 1000ms to 10ms, use queueMicrota…
PaulThompson Aug 10, 2025
669b418
Improve cross-platform permission tests - use platform-specific paths…
PaulThompson Aug 10, 2025
3ba1507
Fix TypeScript errors - add void type parameter to Promise constructo…
PaulThompson Aug 10, 2025
95b6d5b
Remove test review documentation
PaulThompson Aug 10, 2025
201bf56
Add --config flag to source install instructions
PaulThompson Aug 10, 2025
1d843cc
Add --config flag to all install instructions
PaulThompson Aug 10, 2025
2024cf6
Update to version 2.0.0 and simplify install instructions
PaulThompson Aug 10, 2025
5ded463
Fix lint errors: remove unused imports and variables
PaulThompson Aug 10, 2025
9931aed
Format code and update dnit tasks
PaulThompson Aug 10, 2025
65c8f93
Fix manifest variable references in cli.test.ts
PaulThompson Aug 10, 2025
f29ac99
Fix Windows file system caching issue in 'task up to date' test
PaulThompson Aug 10, 2025
3f4e14b
Format Windows timing fix and add debug script
PaulThompson Aug 10, 2025
ae63a08
Add comprehensive debugging to 'task up to date' test for Windows CI
PaulThompson Aug 10, 2025
2ac574b
Fix lint error: replace 'any' type with proper TaskContext type
PaulThompson Aug 10, 2025
27984f0
Fix lint
PaulThompson Aug 10, 2025
22fb28a
Enhance Windows timestamp workaround with more aggressive cache flushing
PaulThompson Aug 10, 2025
db7e0e0
Fix Windows file system caching issue in TrackedFile.isUpToDate()
PaulThompson Aug 10, 2025
1a84f60
Remove custom uptodate function from test - use builtin Windows logic
PaulThompson Aug 10, 2025
cc6060f
Remove unused TaskContext import from basic.test.ts
PaulThompson Aug 10, 2025
9a540f5
Fix Windows up-to-date logic: use hash-only comparison
PaulThompson Aug 10, 2025
823379b
Fix Windows up-to-date checking to use hash-first then timestamp
PaulThompson Aug 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,41 @@ on:

jobs:
lint:
runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS
runs-on: ${{ matrix.os }}

strategy:
matrix:
deno: ["v1.42.x"]
deno: ["v2.4.3"]
os: [ubuntu-latest]

steps:
- name: Setup repo
uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.deno }} # tests across multiple Deno versions
deno-version: ${{ matrix.deno }}

- name: Run Deno lint
run: deno lint

test:
runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS
runs-on: ${{ matrix.os }}

strategy:
matrix:
deno: ["v1.42.0", "v1.38.0"]
deno: ["v2.4.3", "v2.2.4"]
os: [macOS-latest, windows-latest, ubuntu-latest]

steps:
- name: Setup repo
uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v1
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.deno }} # tests across multiple Deno versions
deno-version: ${{ matrix.deno }}

- name: Cache Dependencies
run: deno cache deps.ts
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Dnit manifest files (build state)
.manifest.json
*/.manifest.json

# Test directories
.test/
51 changes: 0 additions & 51 deletions ADLMap.ts

This file was deleted.

67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,33 @@ across many files or shared between projects.
### Pre-Requisites

- [Deno](https://deno.land/#installation)
- Requires deno v1.16.4 or greater
- Requires deno v2.1 or greater

### Install

It is recommended to use `deno install` to install the tool, which provides a
convenient entrypoint script and aliases the permission flags.

```
deno install --global --allow-read --allow-write --allow-run -f --name dnit https://deno.land/x/dnit@dnit-v1.14.4/main.ts
```

Install from source checkout:

```
deno install --global --allow-read --allow-write --allow-run -f --name dnit ./main.ts
deno install --global --allow-read --allow-write --allow-run -f --name dnit --config deno.json ./main.ts
```

(Install instructions from JSR will be added pending final release)

- Read, Write and Run permissions are required in order to operate on files and
execute tasks.

## Example

See the [example/](./example/) directory for a complete working hello world
example.

## Sample Usage

```ts
import {
file,
main,
task,
} from "https://deno.land/x/dnit@dnit-v1.14.4/dnit.ts";
import { file, main, task } from "jsr:@dnit/dnit@2.0.0";

/// A file to be tracked as a target and dependency:
export const msg = file({
Expand All @@ -48,9 +47,9 @@ export const helloWorld = task({
name: "helloWorld",
description: "foo",
action: async () => { /// Actions are typescript async ()=> Promise<void> functions.
await Deno.run({
cmd: ["./writeMsg.sh"],
}).status();
const command = new Deno.Command("./writeMsg.sh");
const { code } = await command.output();
if (code !== 0) throw new Error(`Command failed with code ${code}`);
},
deps: [
file({
Expand Down Expand Up @@ -122,7 +121,10 @@ export type FileParams = {

/// Optional function for how to hash the file. Defaults to the sha1 hash of the file contents.
/// A file is out of date if the file timestamp and the hash are different than that in the task manifest
gethash?: GetFileHash;
getHash?: GetFileHash;

/// Optional function for how to get the file timestamp. Defaults to the actual file timestamp
getTimestamp?: GetFileTimestamp;
};
```

Expand All @@ -134,38 +136,35 @@ Tasks are created by the exported `function task(taskParams: TaskParams): Task`
/** User definition of a task */
export type TaskParams = {
/// Name: (string) - The key used to initiate a task
name: A.TaskName;
name: TaskName;

/// Description (string) - Freeform text description shown on help
description?: string;

/// Action executed on execution of the task (async or sync)
action: Action;

/// Optional list of explicit task dependencies
task_deps?: Task[];

/// Optional list of explicit file dependencies
file_deps?: TrackedFile[];

/// Optional list of task or file dependencies
deps?: (Task | TrackedFile)[];
deps?: Dep[];

/// Targets (files which will be produced by execution of this task)
targets?: TrackedFile[];

/// Custom up-to-date definition - Can be used to make a task *less* up to date. Eg; use uptodate: runAlways to run always on request regardless of dependencies being up to date.
uptodate?: IsUpToDate;
};

/// The kinds of supported dependencies.
export type Dep = Task | TrackedFile | TrackedFilesAsync;
```

Tasks are passed to the exported
`export async function exec(cliArgs: string[], tasks: Task[]) : Promise<void>`
This exposes the tasks for execution by the CLI and executes them according to
the `cliArgs` passed in.
`export function main(cliArgs: string[], tasks: Task[]) : Promise<void>` This
exposes the tasks for execution by the CLI and executes them according to the
`cliArgs` passed in.

```ts
exec(Deno.args, tasks);
main(Deno.args, tasks);
```

## Larger Scale use of tasks
Expand All @@ -180,8 +179,10 @@ definitions across projects.
place to have a (deno) typescript tree for the task scripting, which
encourages tasks to be separated into modules and generally organised as a
typescript project tree.
- User scripts can have an `import_map.json` file in order to import tasks and
utils more flexibly.
- User scripts can use a `deno.json` file in the `dnit` directory for
configuration (import maps, TypeScript options, etc). For legacy
compatibility, standalone `import_map.json` or `.import_map.json` files are
also supported.
- The main `dnit` tool can be executed on its own (see section on
[Installation](#Installation) above)

Expand All @@ -195,8 +196,10 @@ The `dnit` tool searches for a user script to execute, in order to support the
- It starts from the current working directory and runs `findUserSource`
- `findUserSource` looks for subdirectory `dnit` and looks for sources `main.ts`
or `dnit.ts`
- It optionally looks for `import_map.json` or `.import_map.json` to use as
the import map.
- Deno will automatically discover and use any `deno.json` file in the `dnit`
directory or parent directories
- For legacy compatibility, it also looks for `import_map.json` or
`.import_map.json` to use as the import map
- If found then it changes working directory and executes the user script.
- If not found then it recurses into `findUserSource` in the parent directory.

Expand All @@ -206,7 +209,7 @@ Eg: with a file layout:
repo
dnit
main.ts
import_map.json
deno.json
src
project.ts
package.json
Expand Down
11 changes: 0 additions & 11 deletions adl-gen/.manifest

This file was deleted.

Loading
Loading