Skip to content

Commit

Permalink
Use velociraptor vr to run tasks and nest.land for dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tiloio committed Dec 31, 2021
1 parent 24c0ca1 commit 2d11938
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"deno.lint": true,
"deno.unstable": true,
"deno.suggest.imports.hosts": {
"https://deno.land": true
"https://deno.land": true,
"https://x.nest.land": true
}
}
34 changes: 0 additions & 34 deletions Drakefile.ts

This file was deleted.

18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ Test randomizing helps you to build randomized objects for your tests.

## 🏗 Install

### Deno ([deno.land](https://deno.land/x/test_randomizing@0.2.0))
### Deno ([nest.land](https://nest.land/package/test_randomizing) and [deno.land](https://deno.land/x/test_randomizing))

```javascript
import {
freezeMerge,
merge,
RandomFn,
} from "https://deno.land/x/[email protected]";
} from "https://x.nest.land/[email protected]/mod.ts";
// or
import {
freezeMerge,
merge,
RandomFn,
} from "https://deno.land/x/[email protected]/mod.ts";
```

### Node.js ([npm.js](https://www.npmjs.com/package/test-randomizing))
Expand Down Expand Up @@ -47,7 +53,7 @@ import {
DeepPartial,
freezeMerge,
RandomFn,
} from "https://deno.land/x/test_randomizing@0.2.1/mod.ts";
} from "https://x.nest.land/test_randomizing@0.4.0/mod.ts";
import { faker } from "https://deno.land/x/[email protected]/mod.ts";
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";

Expand Down Expand Up @@ -179,8 +185,4 @@ Copyright (c) 2021 Ti/o

# Development

Use alias `drake` to run all commands like `drake test` and `drake build`.

```sh
alias drake="deno run -A Drakefile.ts"
```
Use `vr` ([Velociraptor](https://velociraptor.run/)) to run all commands like `vr check` and `vr publish`.
24 changes: 24 additions & 0 deletions egg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://x.nest.land/[email protected]/src/schema.json",
"name": "test_randomizing",
"entry": "./mod.ts",
"description": "Test Randomizing helps you to build randomized objects or class instances for your tests.",
"homepage": "https://github.com/tiloio/test-randomizing",
"version": "0.4.0",
"releaseType": "minor",
"unstable": false,
"unlisted": false,
"files": [
"./LICENSE",
"./README.md",
"./src/**/*"
],
"ignore": [
"./npm",
"./examples"
],
"checkFormat": "deno fmt src",
"checkTests": "deno test src",
"checkInstallation": true,
"check": true
}
6 changes: 4 additions & 2 deletions examples/deno/generate-email.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import {
DeepPartial,
freezeMerge,
RandomFn,
} from "https://deno.land/x/[email protected]/mod.ts";
} from "https://x.nest.land/[email protected]/mod.ts";
// or via deno.land "https://deno.land/x/[email protected]/mod.ts"
// or via Arweave "https://arweave.net/EQhts80yFWrBc7dZBpauJyD9J4sRDmHl2vlUSJKr_rQ/mod.ts"
import { faker } from "https://deno.land/x/[email protected]/mod.ts";
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import { assertEquals } from "https://deno.land/x/[email protected]/testing/asserts.ts";
import { generateEmail } from "./generate-email.ts";

const randomPerson: RandomFn<Person> = (override?: DeepPartial<Person>) =>
Expand Down
36 changes: 36 additions & 0 deletions scripts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { ScriptsConfiguration } from "https://arweave.net/c_Zr-jv4RfZ1ERXdE3PMCT7GjMSGXAT1wKnhPbC4Cmg/mod.ts";
import eggJson from "./egg.json" assert { type: "json" };

const srcDir = "src";
const version = eggJson.version;

const test = `deno test ${srcDir}`;
const lint = `deno lint ${srcDir}`;
const fmt = `deno fmt ${srcDir}`;
const publishNest = `egg publish`;
const buildNpm = `deno run -A ./build_npm.ts ${version}`;
const publishNpm = `cd ./npm && npm publish`;

const check = {
cmd: {
pll: [test, fmt, lint],
},
gitHook: "pre-commit",
};
export default <ScriptsConfiguration> {
scripts: {
test,
testWatch: {
cmd: test,
watch: true,
},
lint,
fmt,
check,
buildNpm,
publishNpm,
releaseNpm: [check, buildNpm, publishNpm],
publishNest,
release: [publishNest, buildNpm, publishNpm],
},
};
1 change: 0 additions & 1 deletion version.ts

This file was deleted.

0 comments on commit 2d11938

Please sign in to comment.