Skip to content

Commit cd99906

Browse files
authored
Merge pull request #2 from trailmix/next
log
2 parents 13ad956 + 2960efb commit cd99906

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3374
-1896
lines changed

.codecov.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ coverage:
1313
- color
1414
- config
1515
- log
16-
- watch
16+
# - watch
1717
common:
1818
target: 40%
1919
threshold: 10%
@@ -23,24 +23,6 @@ coverage:
2323
precision: 2
2424
round: down
2525
range: '70...100'
26-
# flag_management:
27-
# # this section will govern all default rules of Flags
28-
# default_rules:
29-
# carryforward: true
30-
# ignore:
31-
# - "**/*_test.ts"
32-
# - "**/*_test.tsx"
33-
# paths:
34-
# - "src/**"
35-
# statuses:
36-
# - name_prefix: default_project
37-
# type: project
38-
# target: auto
39-
# threshold: 1%
40-
# - name_prefix: default_patch
41-
# type: patch
42-
# target: percent
43-
# threshold: 80%
4426
ignore:
4527
- "**/*_test.ts"
4628
- "**/*_test.tsx"
@@ -57,12 +39,9 @@ flags:
5739
log:
5840
paths:
5941
- src/log/
60-
watch:
61-
paths:
62-
- src/watch/
63-
# test:
42+
# watch:
6443
# paths:
65-
# - test/
44+
# - src/watch/
6645

6746
parsers:
6847
gcov:

.docker/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ FROM alpine:3.13.2 AS organizer
33
# Installation files
44
WORKDIR /out/usr/src/install
55
COPY src src
6-
COPY test test
76
COPY mod.ts .
87
COPY import_map.json .
9-
COPY trailmix.config.ts .
10-
COPY trilom.config.ts .
118

12-
FROM hayd/alpine-deno:1.8.1 AS runner
9+
FROM hayd/alpine-deno:1.9.0 AS runner
1310
COPY --from=organizer /out /
1411

1512
# Install

.github/workflows/ci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,28 @@ jobs:
1919
fetch-depth: 0
2020

2121
- name: Setup deno
22-
uses: denolib/setup-deno@v2
22+
uses: denoland/setup-deno@main
2323
with:
24-
deno-version: v1.8.1
24+
deno-version: v1.9.0
2525

26-
- name: Run tests (ubuntu)
27-
if: matrix.os == 'ubuntu-latest'
28-
run: deno test --unstable --allow-write --allow-read --allow-env --import-map=import_map.json --coverage=./coverage/output
26+
- name: Run tests (linux/win)
27+
if: matrix.os != 'macos-latest'
28+
run: deno test --unstable --allow-write --allow-read --allow-env --import-map=import_map.json --coverage=coverage/output
2929

30-
- name: Run tests (win/mac)
30+
- name: Run tests (darwin)
3131
if: matrix.os != 'ubuntu-latest'
3232
run: deno test --unstable --allow-write --allow-read --allow-env --import-map=import_map.json
3333

34-
- name: Generate codecov report
35-
if: matrix.os == 'ubuntu-latest'
36-
run: deno coverage --unstable ./coverage --lcov > ./coverage/lcov.info
34+
- name: Generate codecov report (linux/win)
35+
if: matrix.os != 'macos-latest'
36+
run: deno coverage --exclude="(_|.)conf(ig){0,1}\.(ts|js|tsx)" --unstable ./coverage --lcov > ./coverage/lcov.info
3737

38-
- name: Push codecov report
38+
- name: Push codecov report (linux)
3939
if: matrix.os == 'ubuntu-latest'
40-
run: bash <(curl -s https://codecov.io/bash) -F color,common,config -c
40+
run: bash <(curl -s https://codecov.io/bash) -F color,common,config,log -c
41+
42+
- name: Push codecov report (win)
43+
if: matrix.os == 'windows-latest'
44+
run: |
45+
choco install codecov
46+
codecov.exe --flag common -f coverage/lcov.info

CONTRIBUTE.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,67 @@
11
# Contribute
22

3+
## Coverage
4+
5+
Here are some tips for dealing with coverage gutters.
6+
7+
The goal is to allow it to look like the example below. The extension needs to
8+
be installed, and enabled. I typically press **F1** and type "Display Coverage"
9+
and enter or **SHIFT + CMD + 7** for a shortcut.
10+
11+
Assuming you have a valid coverage report at _./coverage/lcov.info_ (change in
12+
_.vscode/settings.json_ or other) then this will display as below.
13+
14+
As you make changes, you need to update the coverage reports so the gutters stay
15+
consistent with your work. See the example below for how to do that.
16+
![gutters-f1](https://trailmix-images.s3.amazonaws.com/utilities/f1.png)
17+
18+
![gutters](https://trailmix-images.s3.amazonaws.com/utilities/gutters.png)
19+
20+
```bash
21+
# remove old coverage reports
22+
rm -rf coverage
23+
# run a test OR
24+
deno test --allow-write --allow-read --allow-env --unstable --import-map=import_map.json --fail-fast --coverage=./coverage/output src/common/file_test.ts
25+
# run all tests
26+
deno test --allow-write --allow-read --allow-env --unstable --import-map=import_map.json --fail-fast --coverage=./coverage/output
27+
# generage lcov.info, must have exclude as the default doesn't have the _
28+
deno coverage --exclude="(_|.)conf(ig){0,1}\.(ts|js|tsx)" --exclude="_test\.(ts|js)" --unstable ./coverage --lcov > ./coverage/lcov.info
29+
# at this point you would reload you coverage with SHIFT+CMD+7 or F1 + "Display Coverage" + enter
30+
# optionally, generate a coverage report to view in a browser
31+
genhtml -o coverage/html ./coverage/lcov.info
32+
```
33+
34+
## Docker
35+
336
```bash
437
# docker should be installed
538
docker build -t trailmix -f .docker/Dockerfile .
639

740
# now run tests
841
docker run trailmix deno test --unstable --allow-write --allow-read --allow-env --import-map=import_map.json
942
```
43+
44+
## imports
45+
46+
### std/path
47+
48+
| function | from | to |
49+
| :---------------- | :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------ |
50+
| MATH | | |
51+
| resolve | 'a/b/../d/c','b','c' | /Users/trilom/repos/utilities/a/d/c/b/c |
52+
| resolve(absolute) | '/a/b/../d/c','b','c' | /a/d/c/b/c |
53+
| normalize | 'a/b/../d/c' | a/d/c |
54+
| join | 'a/b/../d/c','b','c' | a/d/c/b/c |
55+
| isAbsolute | /a/b/c | true |
56+
| isAbsolute(false) | a/b/c | false |
57+
| relative | /Users/trilom/repos/utilities,/Users/trilom | ../../ |
58+
| dirname | /Users/trilom/repos/utilities/trailmix.config.ts | /Users/trilom/repos/utilities |
59+
| basename | /Users/trilom/repos/utilities/trailmix.config.ts | trailmix.config.ts |
60+
| basename(no ext) | /Users/trilom/repos/utilities/trailmix.config.ts, | .ts trailmix.config |
61+
| extname | /Users/trilom/repos/utilities/trailmix.config.ts | .ts |
62+
| CONVERT | | |
63+
| fromFileUrl | file:///Users/trilom/repos/utilities/trailmix.config.ts | /Users/trilom/repos/utilities/trailmix.config.ts |
64+
| toFileUrl | /Users/trilom/repos/utilities/trailmix.config.ts | file:///Users/trilom/repos/utilities/trailmix.config.ts |
65+
| OBJECT | | |
66+
| parse | /Users/trilom/repos/utilities/trailmix.config.ts | {root: "/",dir: "/Users/bkillian/trailmix/utilities",base: "trailmix.config.ts",ext: ".ts",name: "trailmix.config"} |
67+
| format | {root: "/",dir: "/Users/trilom/repos/utilities",base: "trailmix.config.ts",ext: ".ts",name: "trailmix.config"} | /Users/trilom/repos/utilities/trailmix.config.ts |

0 commit comments

Comments
 (0)