@elg/tscodegen 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +6 -6
- package/CHANGELOG.md +17 -0
- package/README.md +6 -5
- package/coverage/coverage-final.json +6 -1
- package/dist/CodeBuilder.d.ts +4 -1
- package/dist/CodeBuilder.js +41 -33
- package/dist/CodeFile.js +28 -30
- package/dist/codelock.js +7 -10
- package/dist/index.js +6 -2
- package/dist/sections/docblock.js +4 -5
- package/dist/sections/manual.js +3 -4
- package/dist/types/ManualSectionMap.d.ts +1 -1
- package/eslint.config.mjs +49 -0
- package/package.json +25 -19
- package/test-reports/junit/junit.xml +1 -125
package/.circleci/config.yml
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
version: 2
|
|
1
|
+
version: 2.1
|
|
2
2
|
|
|
3
3
|
jobs:
|
|
4
4
|
build:
|
|
5
5
|
working_directory: ~/tscodegen
|
|
6
6
|
docker:
|
|
7
|
-
- image:
|
|
7
|
+
- image: cimg/node:lts
|
|
8
8
|
steps:
|
|
9
9
|
- checkout
|
|
10
10
|
- restore_cache:
|
|
11
11
|
keys:
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
12
|
+
- v3-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
|
13
|
+
- v3-node-{{ arch }}-{{ .Branch }}-
|
|
14
|
+
- v3-node-{{ arch }}-
|
|
15
15
|
- run:
|
|
16
16
|
name: Install Dependencies
|
|
17
17
|
command: yarn --frozen-lockfile --cache-folder ~/.cache/yarn --non-interactive
|
|
18
18
|
- save_cache:
|
|
19
|
-
key:
|
|
19
|
+
key: v3-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
|
20
20
|
paths:
|
|
21
21
|
- ~/.cache/yarn
|
|
22
22
|
- node_modules
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.0] - 2026-03-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `CodeBuilder.format` now accepts an optional `prettierOptions` parameter to customize Prettier formatting without resolving config from disk.
|
|
13
|
+
|
|
14
|
+
### Breaking
|
|
15
|
+
|
|
16
|
+
- **Prettier 3 only:** `peerDependencies.prettier` is now `3.x` (was `2.x || 3.x`).
|
|
17
|
+
- Added `@prettier/sync` as a runtime dependency for Prettier 3 compatibility.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Bumped dev dependencies to latest: TypeScript 5.x, ESLint 10.x, Jest 30.x, Prettier 3.x, and related tooling.
|
|
22
|
+
- TypeScript target updated from ES2015 to ES2018.
|
|
23
|
+
- Migrated ESLint to flat config (`eslint.config.mjs`).
|
|
24
|
+
|
|
8
25
|
## [0.2.0] - 2020-06-08
|
|
9
26
|
|
|
10
27
|
### Added
|
package/README.md
CHANGED
|
@@ -71,17 +71,18 @@ new CodeFile("./file.ts")
|
|
|
71
71
|
.addBlock("class Steam extends Water", (builder) =>
|
|
72
72
|
builder
|
|
73
73
|
.addBlock("constructor()", (builder) =>
|
|
74
|
-
builder.addLine("this.boil();")
|
|
74
|
+
builder.addLine("this.boil();"),
|
|
75
75
|
)
|
|
76
76
|
.addLine()
|
|
77
77
|
.addBlock("boil()", (b) =>
|
|
78
78
|
b.addManualSection("boil_body", (builder) =>
|
|
79
|
-
builder.add("this.temp = 100;")
|
|
80
|
-
)
|
|
81
|
-
)
|
|
79
|
+
builder.add("this.temp = 100;"),
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
82
|
)
|
|
83
|
-
.format()
|
|
83
|
+
.format(),
|
|
84
84
|
)
|
|
85
|
+
.lock()
|
|
85
86
|
.saveToFile();
|
|
86
87
|
```
|
|
87
88
|
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{}
|
|
1
|
+
{"/Users/e-liang/a/tscodegen/src/CodeFile.ts": {"path":"/Users/e-liang/a/tscodegen/src/CodeFile.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":44}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":67}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":58}},"4":{"start":{"line":10,"column":2},"end":{"line":10,"column":35}},"5":{"start":{"line":11,"column":2},"end":{"line":11,"column":29}},"6":{"start":{"line":12,"column":2},"end":{"line":12,"column":21}},"7":{"start":{"line":13,"column":2},"end":{"line":13,"column":46}},"8":{"start":{"line":16,"column":4},"end":{"line":16,"column":42}},"9":{"start":{"line":17,"column":4},"end":{"line":23,"column":null}},"10":{"start":{"line":18,"column":6},"end":{"line":18,"column":76}},"11":{"start":{"line":19,"column":6},"end":{"line":19,"column":54}},"12":{"start":{"line":20,"column":6},"end":{"line":22,"column":31}},"13":{"start":{"line":30,"column":4},"end":{"line":30,"column":42}},"14":{"start":{"line":40,"column":20},"end":{"line":41,"column":null}},"15":{"start":{"line":43,"column":4},"end":{"line":43,"column":44}},"16":{"start":{"line":44,"column":4},"end":{"line":44,"column":62}},"17":{"start":{"line":45,"column":4},"end":{"line":45,"column":16}},"18":{"start":{"line":58,"column":4},"end":{"line":62,"column":6}},"19":{"start":{"line":63,"column":4},"end":{"line":63,"column":16}},"20":{"start":{"line":70,"column":4},"end":{"line":70,"column":30}},"21":{"start":{"line":81,"column":4},"end":{"line":84,"column":null}},"22":{"start":{"line":82,"column":6},"end":{"line":82,"column":74}},"23":{"start":{"line":83,"column":6},"end":{"line":83,"column":54}},"24":{"start":{"line":9,"column":0},"end":{"line":9,"column":13}}},"fnMap":{"0":{"name":"(anonymous_3)","decl":{"start":{"line":15,"column":2},"end":{"line":15,"column":14}},"loc":{"start":{"line":15,"column":36},"end":{"line":24,"column":3}}},"1":{"name":"(anonymous_4)","decl":{"start":{"line":29,"column":2},"end":{"line":29,"column":8}},"loc":{"start":{"line":29,"column":8},"end":{"line":31,"column":3}}},"2":{"name":"(anonymous_5)","decl":{"start":{"line":39,"column":2},"end":{"line":39,"column":7}},"loc":{"start":{"line":39,"column":61},"end":{"line":46,"column":3}}},"3":{"name":"(anonymous_6)","decl":{"start":{"line":57,"column":2},"end":{"line":57,"column":6}},"loc":{"start":{"line":57,"column":25},"end":{"line":64,"column":3}}},"4":{"name":"(anonymous_7)","decl":{"start":{"line":69,"column":2},"end":{"line":69,"column":10}},"loc":{"start":{"line":69,"column":10},"end":{"line":71,"column":3}}},"5":{"name":"(anonymous_8)","decl":{"start":{"line":80,"column":2},"end":{"line":80,"column":12}},"loc":{"start":{"line":80,"column":26},"end":{"line":85,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":4},"end":{"line":23,"column":null}},"type":"if","locations":[{"start":{"line":17,"column":4},"end":{"line":23,"column":null}},{"start":{"line":17,"column":4},"end":{"line":23,"column":null}}]},"1":{"loc":{"start":{"line":22,"column":7},"end":{"line":22,"column":9}},"type":"cond-expr","locations":[{"start":{"line":22,"column":7},"end":{"line":22,"column":9}},{"start":{"line":22,"column":7},"end":{"line":22,"column":30}}]},"2":{"loc":{"start":{"line":20,"column":10},"end":{"line":22,"column":9}},"type":"binary-expr","locations":[{"start":{"line":20,"column":10},"end":{"line":22,"column":9}},{"start":{"line":22,"column":7},"end":{"line":22,"column":9}}]},"3":{"loc":{"start":{"line":57,"column":23},"end":{"line":57,"column":25}},"type":"default-arg","locations":[{"start":{"line":57,"column":23},"end":{"line":57,"column":25}}]},"4":{"loc":{"start":{"line":58,"column":33},"end":{"line":58,"column":null}},"type":"cond-expr","locations":[{"start":{"line":58,"column":33},"end":{"line":58,"column":null}},{"start":{"line":60,"column":37},"end":{"line":60,"column":42}}]},"5":{"loc":{"start":{"line":58,"column":33},"end":{"line":58,"column":null}},"type":"binary-expr","locations":[{"start":{"line":58,"column":33},"end":{"line":58,"column":null}},{"start":{"line":58,"column":33},"end":{"line":58,"column":null}}]},"6":{"loc":{"start":{"line":80,"column":21},"end":{"line":80,"column":26}},"type":"default-arg","locations":[{"start":{"line":80,"column":21},"end":{"line":80,"column":26}}]},"7":{"loc":{"start":{"line":81,"column":4},"end":{"line":84,"column":null}},"type":"if","locations":[{"start":{"line":81,"column":4},"end":{"line":84,"column":null}},{"start":{"line":81,"column":4},"end":{"line":84,"column":null}}]},"8":{"loc":{"start":{"line":81,"column":8},"end":{"line":81,"column":13}},"type":"binary-expr","locations":[{"start":{"line":81,"column":8},"end":{"line":81,"column":13}},{"start":{"line":81,"column":17},"end":{"line":81,"column":66}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0],"4":[0,0],"5":[0,0],"6":[0],"7":[0,0],"8":[0,0]}}
|
|
2
|
+
,"/Users/e-liang/a/tscodegen/src/codelock.ts": {"path":"/Users/e-liang/a/tscodegen/src/codelock.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":null}},"2":{"start":{"line":7,"column":0},"end":{"line":7,"column":56}},"3":{"start":{"line":21,"column":19},"end":{"line":21,"column":46}},"4":{"start":{"line":22,"column":2},"end":{"line":24,"column":null}},"5":{"start":{"line":23,"column":4},"end":{"line":23,"column":21}},"6":{"start":{"line":26,"column":24},"end":{"line":26,"column":44}},"7":{"start":{"line":27,"column":2},"end":{"line":29,"column":null}},"8":{"start":{"line":28,"column":4},"end":{"line":28,"column":21}},"9":{"start":{"line":32,"column":19},"end":{"line":32,"column":58}},"10":{"start":{"line":34,"column":27},"end":{"line":35,"column":76}},"11":{"start":{"line":36,"column":2},"end":{"line":41,"column":null}},"12":{"start":{"line":37,"column":4},"end":{"line":40,"column":6}},"13":{"start":{"line":43,"column":29},"end":{"line":45,"column":11}},"14":{"start":{"line":46,"column":2},"end":{"line":51,"column":null}},"15":{"start":{"line":47,"column":4},"end":{"line":50,"column":6}},"16":{"start":{"line":53,"column":2},"end":{"line":53,"column":19}},"17":{"start":{"line":19,"column":0},"end":{"line":19,"column":16}},"18":{"start":{"line":65,"column":23},"end":{"line":67,"column":10}},"19":{"start":{"line":68,"column":2},"end":{"line":71,"column":22}},"20":{"start":{"line":89,"column":15},"end":{"line":89,"column":55}},"21":{"start":{"line":93,"column":2},"end":{"line":103,"column":null}},"22":{"start":{"line":94,"column":4},"end":{"line":98,"column":41}},"23":{"start":{"line":100,"column":4},"end":{"line":102,"column":32}},"24":{"start":{"line":105,"column":2},"end":{"line":105,"column":52}},"25":{"start":{"line":84,"column":0},"end":{"line":84,"column":16}},"26":{"start":{"line":115,"column":24},"end":{"line":115,"column":51}},"27":{"start":{"line":116,"column":2},"end":{"line":118,"column":null}},"28":{"start":{"line":117,"column":4},"end":{"line":117,"column":17}},"29":{"start":{"line":119,"column":2},"end":{"line":125,"column":4}},"30":{"start":{"line":114,"column":0},"end":{"line":114,"column":16}}},"fnMap":{"0":{"name":"getCodelockInfo","decl":{"start":{"line":19,"column":16},"end":{"line":19,"column":31}},"loc":{"start":{"line":19,"column":50},"end":{"line":54,"column":1}}},"1":{"name":"computeHash","decl":{"start":{"line":64,"column":9},"end":{"line":64,"column":20}},"loc":{"start":{"line":64,"column":69},"end":{"line":72,"column":1}}},"2":{"name":"lockCode","decl":{"start":{"line":84,"column":16},"end":{"line":84,"column":24}},"loc":{"start":{"line":87,"column":20},"end":{"line":106,"column":1}}},"3":{"name":"verifyLock","decl":{"start":{"line":114,"column":16},"end":{"line":114,"column":26}},"loc":{"start":{"line":114,"column":45},"end":{"line":126,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":22,"column":2},"end":{"line":24,"column":null}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":24,"column":null}},{"start":{"line":22,"column":2},"end":{"line":24,"column":null}}]},"1":{"loc":{"start":{"line":27,"column":2},"end":{"line":29,"column":null}},"type":"if","locations":[{"start":{"line":27,"column":2},"end":{"line":29,"column":null}},{"start":{"line":27,"column":2},"end":{"line":29,"column":null}}]},"2":{"loc":{"start":{"line":35,"column":68},"end":{"line":35,"column":70}},"type":"cond-expr","locations":[{"start":{"line":35,"column":68},"end":{"line":35,"column":70}},{"start":{"line":35,"column":68},"end":{"line":35,"column":76}}]},"3":{"loc":{"start":{"line":34,"column":27},"end":{"line":35,"column":70}},"type":"binary-expr","locations":[{"start":{"line":34,"column":27},"end":{"line":35,"column":70}},{"start":{"line":35,"column":68},"end":{"line":35,"column":70}}]},"4":{"loc":{"start":{"line":36,"column":2},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":36,"column":2},"end":{"line":41,"column":null}},{"start":{"line":36,"column":2},"end":{"line":41,"column":null}}]},"5":{"loc":{"start":{"line":45,"column":3},"end":{"line":45,"column":5}},"type":"cond-expr","locations":[{"start":{"line":45,"column":3},"end":{"line":45,"column":5}},{"start":{"line":45,"column":3},"end":{"line":45,"column":11}}]},"6":{"loc":{"start":{"line":43,"column":29},"end":{"line":45,"column":5}},"type":"binary-expr","locations":[{"start":{"line":43,"column":29},"end":{"line":45,"column":5}},{"start":{"line":45,"column":3},"end":{"line":45,"column":5}}]},"7":{"loc":{"start":{"line":46,"column":2},"end":{"line":51,"column":null}},"type":"if","locations":[{"start":{"line":46,"column":2},"end":{"line":51,"column":null}},{"start":{"line":46,"column":2},"end":{"line":51,"column":null}}]},"8":{"loc":{"start":{"line":66,"column":32},"end":{"line":66,"column":57}},"type":"cond-expr","locations":[{"start":{"line":66,"column":32},"end":{"line":66,"column":57}},{"start":{"line":66,"column":60},"end":{"line":66,"column":64}}]},"9":{"loc":{"start":{"line":87,"column":18},"end":{"line":87,"column":20}},"type":"default-arg","locations":[{"start":{"line":87,"column":18},"end":{"line":87,"column":20}}]},"10":{"loc":{"start":{"line":93,"column":2},"end":{"line":103,"column":null}},"type":"if","locations":[{"start":{"line":93,"column":2},"end":{"line":103,"column":null}},{"start":{"line":93,"column":2},"end":{"line":103,"column":null}}]},"11":{"loc":{"start":{"line":116,"column":2},"end":{"line":118,"column":null}},"type":"if","locations":[{"start":{"line":116,"column":2},"end":{"line":118,"column":null}},{"start":{"line":116,"column":2},"end":{"line":118,"column":null}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0},"f":{"0":0,"1":0,"2":0,"3":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0],"10":[0,0],"11":[0,0]}}
|
|
3
|
+
,"/Users/e-liang/a/tscodegen/src/index.ts": {"path":"/Users/e-liang/a/tscodegen/src/index.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":41}}},"fnMap":{},"branchMap":{},"s":{"0":0,"1":0,"2":0},"f":{},"b":{}}
|
|
4
|
+
,"/Users/e-liang/a/tscodegen/src/sections/docblock.ts": {"path":"/Users/e-liang/a/tscodegen/src/sections/docblock.ts","statementMap":{"0":{"start":{"line":1,"column":28},"end":{"line":1,"column":70}},"1":{"start":{"line":13,"column":30},"end":{"line":13,"column":71}},"2":{"start":{"line":14,"column":2},"end":{"line":16,"column":null}},"3":{"start":{"line":15,"column":4},"end":{"line":15,"column":21}},"4":{"start":{"line":18,"column":22},"end":{"line":18,"column":53}},"5":{"start":{"line":19,"column":2},"end":{"line":27,"column":4}},"6":{"start":{"line":23,"column":21},"end":{"line":23,"column":55}},"7":{"start":{"line":12,"column":0},"end":{"line":12,"column":16}},"8":{"start":{"line":39,"column":2},"end":{"line":41,"column":null}},"9":{"start":{"line":40,"column":4},"end":{"line":40,"column":16}},"10":{"start":{"line":42,"column":2},"end":{"line":42,"column":47}},"11":{"start":{"line":38,"column":0},"end":{"line":38,"column":16}},"12":{"start":{"line":51,"column":42},"end":{"line":54,"column":15}},"13":{"start":{"line":53,"column":19},"end":{"line":53,"column":43}},"14":{"start":{"line":55,"column":19},"end":{"line":55,"column":65}},"15":{"start":{"line":56,"column":2},"end":{"line":56,"column":18}},"16":{"start":{"line":50,"column":0},"end":{"line":50,"column":16}},"17":{"start":{"line":70,"column":2},"end":{"line":70,"column":69}},"18":{"start":{"line":66,"column":0},"end":{"line":66,"column":16}}},"fnMap":{"0":{"name":"getFileDocblock","decl":{"start":{"line":12,"column":16},"end":{"line":12,"column":31}},"loc":{"start":{"line":12,"column":44},"end":{"line":28,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":23,"column":11},"end":{"line":23,"column":12}},"loc":{"start":{"line":23,"column":21},"end":{"line":23,"column":55}}},"2":{"name":"removeFileDocblock","decl":{"start":{"line":38,"column":16},"end":{"line":38,"column":34}},"loc":{"start":{"line":38,"column":47},"end":{"line":43,"column":1}}},"3":{"name":"createDocblock","decl":{"start":{"line":50,"column":16},"end":{"line":50,"column":30}},"loc":{"start":{"line":50,"column":54},"end":{"line":57,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":53,"column":9},"end":{"line":53,"column":10}},"loc":{"start":{"line":53,"column":19},"end":{"line":53,"column":43}}},"5":{"name":"prependFileDocblock","decl":{"start":{"line":66,"column":16},"end":{"line":66,"column":35}},"loc":{"start":{"line":68,"column":25},"end":{"line":71,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":13,"column":63},"end":{"line":13,"column":65}},"type":"cond-expr","locations":[{"start":{"line":13,"column":63},"end":{"line":13,"column":65}},{"start":{"line":13,"column":63},"end":{"line":13,"column":71}}]},"1":{"loc":{"start":{"line":13,"column":30},"end":{"line":13,"column":65}},"type":"binary-expr","locations":[{"start":{"line":13,"column":30},"end":{"line":13,"column":65}},{"start":{"line":13,"column":63},"end":{"line":13,"column":65}}]},"2":{"loc":{"start":{"line":14,"column":2},"end":{"line":16,"column":null}},"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":16,"column":null}},{"start":{"line":14,"column":2},"end":{"line":16,"column":null}}]},"3":{"loc":{"start":{"line":39,"column":2},"end":{"line":41,"column":null}},"type":"if","locations":[{"start":{"line":39,"column":2},"end":{"line":41,"column":null}},{"start":{"line":39,"column":2},"end":{"line":41,"column":null}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0]}}
|
|
5
|
+
,"/Users/e-liang/a/tscodegen/src/sections/manual.ts": {"path":"/Users/e-liang/a/tscodegen/src/sections/manual.ts","statementMap":{"0":{"start":{"line":4,"column":2},"end":{"line":4,"column":94}},"1":{"start":{"line":11,"column":2},"end":{"line":15,"column":null}},"2":{"start":{"line":12,"column":4},"end":{"line":14,"column":6}},"3":{"start":{"line":17,"column":29},"end":{"line":17,"column":47}},"4":{"start":{"line":18,"column":2},"end":{"line":19,"column":71}},"5":{"start":{"line":21,"column":2},"end":{"line":21,"column":101}},"6":{"start":{"line":6,"column":0},"end":{"line":6,"column":16}},"7":{"start":{"line":25,"column":21},"end":{"line":25,"column":54}},"8":{"start":{"line":26,"column":43},"end":{"line":26,"column":45}},"9":{"start":{"line":27,"column":2},"end":{"line":32,"column":5}},"10":{"start":{"line":28,"column":4},"end":{"line":30,"column":null}},"11":{"start":{"line":29,"column":6},"end":{"line":29,"column":13}},"12":{"start":{"line":31,"column":4},"end":{"line":31,"column":64}},"13":{"start":{"line":33,"column":2},"end":{"line":33,"column":24}},"14":{"start":{"line":24,"column":0},"end":{"line":24,"column":16}},"15":{"start":{"line":42,"column":2},"end":{"line":44,"column":4}},"16":{"start":{"line":43,"column":4},"end":{"line":43,"column":39}},"17":{"start":{"line":41,"column":0},"end":{"line":41,"column":16}}},"fnMap":{"0":{"name":"createManualSection","decl":{"start":{"line":6,"column":16},"end":{"line":6,"column":35}},"loc":{"start":{"line":8,"column":21},"end":{"line":22,"column":1}}},"1":{"name":"extractManualSections","decl":{"start":{"line":24,"column":16},"end":{"line":24,"column":37}},"loc":{"start":{"line":24,"column":50},"end":{"line":34,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":27,"column":26},"end":{"line":27,"column":27}},"loc":{"start":{"line":27,"column":54},"end":{"line":32,"column":3}}},"3":{"name":"emptyManualSections","decl":{"start":{"line":41,"column":16},"end":{"line":41,"column":35}},"loc":{"start":{"line":41,"column":48},"end":{"line":45,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":42,"column":42},"end":{"line":42,"column":43}},"loc":{"start":{"line":43,"column":4},"end":{"line":43,"column":39}}}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":2},"end":{"line":15,"column":null}},"type":"if","locations":[{"start":{"line":11,"column":2},"end":{"line":15,"column":null}},{"start":{"line":11,"column":2},"end":{"line":15,"column":null}}]},"1":{"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":29}},"type":"binary-expr","locations":[{"start":{"line":11,"column":6},"end":{"line":11,"column":29}},{"start":{"line":11,"column":33},"end":{"line":11,"column":54}}]},"2":{"loc":{"start":{"line":19,"column":38},"end":{"line":19,"column":65}},"type":"cond-expr","locations":[{"start":{"line":19,"column":38},"end":{"line":19,"column":65}},{"start":{"line":19,"column":68},"end":{"line":19,"column":70}}]},"3":{"loc":{"start":{"line":28,"column":4},"end":{"line":30,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":30,"column":null}},{"start":{"line":28,"column":4},"end":{"line":30,"column":null}}]}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0]}}
|
|
6
|
+
}
|
package/dist/CodeBuilder.d.ts
CHANGED
|
@@ -36,8 +36,11 @@ export declare class CodeBuilder {
|
|
|
36
36
|
addManualSection(sectionKey: string, sectionBuilder: (manualSectionBuilder: CodeBuilder) => CodeBuilder): this;
|
|
37
37
|
/**
|
|
38
38
|
* Formats the stored code with Prettier.
|
|
39
|
+
*
|
|
40
|
+
* @param prettierOptions Optional Prettier configuration object. If provided,
|
|
41
|
+
* this will be used directly and no config will be resolved from disk.
|
|
39
42
|
*/
|
|
40
|
-
format(): this;
|
|
43
|
+
format(prettierOptions?: import("prettier").Options): this;
|
|
41
44
|
/**
|
|
42
45
|
* Returns the stored code.
|
|
43
46
|
*/
|
package/dist/CodeBuilder.js
CHANGED
|
@@ -1,45 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
15
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
15
|
};
|
|
18
|
-
var
|
|
16
|
+
var _CodeBuilder_gennedCode, _CodeBuilder_hasManualSections, _CodeBuilder_existingManualSections;
|
|
19
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
18
|
exports.CodeBuilder = void 0;
|
|
21
|
-
const
|
|
19
|
+
const sync_1 = __importDefault(require("@prettier/sync"));
|
|
22
20
|
const manual_1 = require("./sections/manual");
|
|
23
21
|
const docblock_1 = require("./sections/docblock");
|
|
24
22
|
class CodeBuilder {
|
|
25
23
|
constructor(manualSections) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
__classPrivateFieldSet(this,
|
|
24
|
+
_CodeBuilder_gennedCode.set(this, "");
|
|
25
|
+
_CodeBuilder_hasManualSections.set(this, false);
|
|
26
|
+
_CodeBuilder_existingManualSections.set(this, void 0);
|
|
27
|
+
__classPrivateFieldSet(this, _CodeBuilder_existingManualSections, manualSections, "f");
|
|
30
28
|
}
|
|
31
29
|
/**
|
|
32
30
|
* Simply appends `code`.
|
|
33
31
|
*/
|
|
34
32
|
add(code) {
|
|
35
|
-
__classPrivateFieldSet(this,
|
|
33
|
+
__classPrivateFieldSet(this, _CodeBuilder_gennedCode, __classPrivateFieldGet(this, _CodeBuilder_gennedCode, "f") + code, "f");
|
|
36
34
|
return this;
|
|
37
35
|
}
|
|
38
36
|
/**
|
|
39
37
|
* Appends `code` and a newline. Call without arguments to insert a newline.
|
|
40
38
|
*/
|
|
41
39
|
addLine(code = "") {
|
|
42
|
-
__classPrivateFieldSet(this,
|
|
40
|
+
__classPrivateFieldSet(this, _CodeBuilder_gennedCode, __classPrivateFieldGet(this, _CodeBuilder_gennedCode, "f") + (code + "\n"), "f");
|
|
43
41
|
return this;
|
|
44
42
|
}
|
|
45
43
|
/**
|
|
@@ -49,7 +47,7 @@ class CodeBuilder {
|
|
|
49
47
|
* @param docblockContent Plain docblock content (i.e. without "*"s at the start of each line)
|
|
50
48
|
*/
|
|
51
49
|
addDocblock(docblockContent) {
|
|
52
|
-
return this.addLine(docblock_1.createDocblock(docblockContent));
|
|
50
|
+
return this.addLine((0, docblock_1.createDocblock)(docblockContent));
|
|
53
51
|
}
|
|
54
52
|
/**
|
|
55
53
|
* Add a block of code, i.e. code with braces around them.
|
|
@@ -59,8 +57,8 @@ class CodeBuilder {
|
|
|
59
57
|
* in the block.
|
|
60
58
|
*/
|
|
61
59
|
addBlock(codeBeforeBlock, blockBuilder) {
|
|
62
|
-
const builtBlockBuilder = blockBuilder(new CodeBuilder(__classPrivateFieldGet(this,
|
|
63
|
-
__classPrivateFieldSet(this,
|
|
60
|
+
const builtBlockBuilder = blockBuilder(new CodeBuilder(__classPrivateFieldGet(this, _CodeBuilder_existingManualSections, "f")));
|
|
61
|
+
__classPrivateFieldSet(this, _CodeBuilder_hasManualSections, __classPrivateFieldGet(this, _CodeBuilder_hasManualSections, "f") || builtBlockBuilder.hasManualSections(), "f");
|
|
64
62
|
return this.add(codeBeforeBlock)
|
|
65
63
|
.addLine(" {")
|
|
66
64
|
.addLine(builtBlockBuilder.toString())
|
|
@@ -76,35 +74,45 @@ class CodeBuilder {
|
|
|
76
74
|
*/
|
|
77
75
|
addManualSection(sectionKey, sectionBuilder) {
|
|
78
76
|
let sectionContent;
|
|
79
|
-
if (__classPrivateFieldGet(this,
|
|
80
|
-
sectionContent = __classPrivateFieldGet(this,
|
|
77
|
+
if (__classPrivateFieldGet(this, _CodeBuilder_existingManualSections, "f")[sectionKey]) {
|
|
78
|
+
sectionContent = __classPrivateFieldGet(this, _CodeBuilder_existingManualSections, "f")[sectionKey];
|
|
81
79
|
}
|
|
82
80
|
else {
|
|
83
|
-
sectionContent = sectionBuilder(new CodeBuilder(__classPrivateFieldGet(this,
|
|
81
|
+
sectionContent = sectionBuilder(new CodeBuilder(__classPrivateFieldGet(this, _CodeBuilder_existingManualSections, "f"))).toString();
|
|
84
82
|
}
|
|
85
|
-
__classPrivateFieldSet(this,
|
|
86
|
-
return this.addLine(manual_1.createManualSection(sectionKey, sectionContent));
|
|
83
|
+
__classPrivateFieldSet(this, _CodeBuilder_hasManualSections, true, "f");
|
|
84
|
+
return this.addLine((0, manual_1.createManualSection)(sectionKey, sectionContent));
|
|
87
85
|
}
|
|
88
86
|
/**
|
|
89
87
|
* Formats the stored code with Prettier.
|
|
88
|
+
*
|
|
89
|
+
* @param prettierOptions Optional Prettier configuration object. If provided,
|
|
90
|
+
* this will be used directly and no config will be resolved from disk.
|
|
90
91
|
*/
|
|
91
|
-
format() {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
format(prettierOptions) {
|
|
93
|
+
var _a;
|
|
94
|
+
let options = prettierOptions;
|
|
95
|
+
if (!options) {
|
|
96
|
+
options = (_a = sync_1.default.resolveConfig(process.cwd())) !== null && _a !== void 0 ? _a : {};
|
|
97
|
+
}
|
|
98
|
+
__classPrivateFieldSet(this, _CodeBuilder_gennedCode, sync_1.default.format(__classPrivateFieldGet(this, _CodeBuilder_gennedCode, "f"), {
|
|
99
|
+
...options,
|
|
100
|
+
parser: "typescript",
|
|
101
|
+
}), "f");
|
|
94
102
|
return this;
|
|
95
103
|
}
|
|
96
104
|
/**
|
|
97
105
|
* Returns the stored code.
|
|
98
106
|
*/
|
|
99
107
|
toString() {
|
|
100
|
-
return __classPrivateFieldGet(this,
|
|
108
|
+
return __classPrivateFieldGet(this, _CodeBuilder_gennedCode, "f");
|
|
101
109
|
}
|
|
102
110
|
/**
|
|
103
111
|
* Whether this built code contains at least one manual section.
|
|
104
112
|
*/
|
|
105
113
|
hasManualSections() {
|
|
106
|
-
return __classPrivateFieldGet(this,
|
|
114
|
+
return __classPrivateFieldGet(this, _CodeBuilder_hasManualSections, "f");
|
|
107
115
|
}
|
|
108
116
|
}
|
|
109
117
|
exports.CodeBuilder = CodeBuilder;
|
|
110
|
-
|
|
118
|
+
_CodeBuilder_gennedCode = new WeakMap(), _CodeBuilder_hasManualSections = new WeakMap(), _CodeBuilder_existingManualSections = new WeakMap();
|
package/dist/CodeFile.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
15
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
15
|
};
|
|
18
|
-
var
|
|
16
|
+
var _CodeFile_sourceFilePath, _CodeFile_originalFileContents, _CodeFile_fileContents, _CodeFile_manualSectionsAllowed;
|
|
19
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
18
|
exports.CodeFile = void 0;
|
|
21
19
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -28,22 +26,22 @@ const manual_1 = require("./sections/manual");
|
|
|
28
26
|
class CodeFile {
|
|
29
27
|
constructor(sourceFilePath) {
|
|
30
28
|
var _a;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
__classPrivateFieldSet(this,
|
|
29
|
+
_CodeFile_sourceFilePath.set(this, void 0);
|
|
30
|
+
_CodeFile_originalFileContents.set(this, "");
|
|
31
|
+
_CodeFile_fileContents.set(this, "");
|
|
32
|
+
_CodeFile_manualSectionsAllowed.set(this, void 0);
|
|
33
|
+
__classPrivateFieldSet(this, _CodeFile_sourceFilePath, sourceFilePath, "f");
|
|
36
34
|
if (fs_1.default.existsSync(sourceFilePath)) {
|
|
37
|
-
__classPrivateFieldSet(this,
|
|
38
|
-
__classPrivateFieldSet(this,
|
|
39
|
-
__classPrivateFieldSet(this,
|
|
35
|
+
__classPrivateFieldSet(this, _CodeFile_originalFileContents, fs_1.default.readFileSync(sourceFilePath, "utf-8"), "f");
|
|
36
|
+
__classPrivateFieldSet(this, _CodeFile_fileContents, __classPrivateFieldGet(this, _CodeFile_originalFileContents, "f"), "f");
|
|
37
|
+
__classPrivateFieldSet(this, _CodeFile_manualSectionsAllowed, (_a = (0, codelock_1.getCodelockInfo)(__classPrivateFieldGet(this, _CodeFile_fileContents, "f"))) === null || _a === void 0 ? void 0 : _a.manualSectionsAllowed, "f");
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
41
|
* Verifies that the codelock in the generated file is present and valid.
|
|
44
42
|
*/
|
|
45
43
|
verify() {
|
|
46
|
-
return codelock_1.verifyLock(__classPrivateFieldGet(this,
|
|
44
|
+
return (0, codelock_1.verifyLock)(__classPrivateFieldGet(this, _CodeFile_fileContents, "f"));
|
|
47
45
|
}
|
|
48
46
|
/**
|
|
49
47
|
* Replace the file's code (this class's in-memory representation at least)
|
|
@@ -52,9 +50,9 @@ class CodeFile {
|
|
|
52
50
|
* @param builderBuilder A builder that builds a replacement source.
|
|
53
51
|
*/
|
|
54
52
|
build(builderBuilder) {
|
|
55
|
-
const builder = builderBuilder(new CodeBuilder_1.CodeBuilder(manual_1.extractManualSections(__classPrivateFieldGet(this,
|
|
56
|
-
__classPrivateFieldSet(this,
|
|
57
|
-
__classPrivateFieldSet(this,
|
|
53
|
+
const builder = builderBuilder(new CodeBuilder_1.CodeBuilder((0, manual_1.extractManualSections)(__classPrivateFieldGet(this, _CodeFile_fileContents, "f"))));
|
|
54
|
+
__classPrivateFieldSet(this, _CodeFile_fileContents, builder.toString(), "f");
|
|
55
|
+
__classPrivateFieldSet(this, _CodeFile_manualSectionsAllowed, builder.hasManualSections(), "f");
|
|
58
56
|
return this;
|
|
59
57
|
}
|
|
60
58
|
/**
|
|
@@ -68,14 +66,14 @@ class CodeFile {
|
|
|
68
66
|
*/
|
|
69
67
|
lock(customComment = "") {
|
|
70
68
|
var _a;
|
|
71
|
-
__classPrivateFieldSet(this,
|
|
69
|
+
__classPrivateFieldSet(this, _CodeFile_fileContents, (0, codelock_1.lockCode)(__classPrivateFieldGet(this, _CodeFile_fileContents, "f"), (_a = __classPrivateFieldGet(this, _CodeFile_manualSectionsAllowed, "f")) !== null && _a !== void 0 ? _a : false, customComment), "f");
|
|
72
70
|
return this;
|
|
73
71
|
}
|
|
74
72
|
/**
|
|
75
73
|
* Returns the in-memory representation of the file's source code.
|
|
76
74
|
*/
|
|
77
75
|
toString() {
|
|
78
|
-
return __classPrivateFieldGet(this,
|
|
76
|
+
return __classPrivateFieldGet(this, _CodeFile_fileContents, "f");
|
|
79
77
|
}
|
|
80
78
|
/**
|
|
81
79
|
* Save to `sourceFilePath` if the in-memory representation of the code has
|
|
@@ -85,11 +83,11 @@ class CodeFile {
|
|
|
85
83
|
* changes.
|
|
86
84
|
*/
|
|
87
85
|
saveToFile(force = false) {
|
|
88
|
-
if (force || __classPrivateFieldGet(this,
|
|
89
|
-
fs_1.default.writeFileSync(__classPrivateFieldGet(this,
|
|
90
|
-
__classPrivateFieldSet(this,
|
|
86
|
+
if (force || __classPrivateFieldGet(this, _CodeFile_originalFileContents, "f") !== __classPrivateFieldGet(this, _CodeFile_fileContents, "f")) {
|
|
87
|
+
fs_1.default.writeFileSync(__classPrivateFieldGet(this, _CodeFile_sourceFilePath, "f"), __classPrivateFieldGet(this, _CodeFile_fileContents, "f"), "utf-8");
|
|
88
|
+
__classPrivateFieldSet(this, _CodeFile_originalFileContents, __classPrivateFieldGet(this, _CodeFile_fileContents, "f"), "f");
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
exports.CodeFile = CodeFile;
|
|
95
|
-
|
|
93
|
+
_CodeFile_sourceFilePath = new WeakMap(), _CodeFile_originalFileContents = new WeakMap(), _CodeFile_fileContents = new WeakMap(), _CodeFile_manualSectionsAllowed = new WeakMap();
|
package/dist/codelock.js
CHANGED
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getCodelockInfo = getCodelockInfo;
|
|
7
|
+
exports.lockCode = lockCode;
|
|
8
|
+
exports.verifyLock = verifyLock;
|
|
7
9
|
const crypto_1 = __importDefault(require("crypto"));
|
|
8
10
|
const docblock_1 = require("./sections/docblock");
|
|
9
11
|
const manual_1 = require("./sections/manual");
|
|
@@ -15,7 +17,7 @@ const manual_1 = require("./sections/manual");
|
|
|
15
17
|
function getCodelockInfo(lockedCode) {
|
|
16
18
|
var _a, _b;
|
|
17
19
|
// TODO: get docblock, and if it exists, retrieve hash
|
|
18
|
-
const docblock = docblock_1.getFileDocblock(lockedCode);
|
|
20
|
+
const docblock = (0, docblock_1.getFileDocblock)(lockedCode);
|
|
19
21
|
if (!docblock) {
|
|
20
22
|
return undefined;
|
|
21
23
|
}
|
|
@@ -41,7 +43,6 @@ function getCodelockInfo(lockedCode) {
|
|
|
41
43
|
}
|
|
42
44
|
return undefined;
|
|
43
45
|
}
|
|
44
|
-
exports.getCodelockInfo = getCodelockInfo;
|
|
45
46
|
/**
|
|
46
47
|
* Computes the codelock hash for a source file. Will not unlock if locked.
|
|
47
48
|
*
|
|
@@ -51,9 +52,7 @@ exports.getCodelockInfo = getCodelockInfo;
|
|
|
51
52
|
* @returns Lock hash for `code`.
|
|
52
53
|
*/
|
|
53
54
|
function computeHash(code, shouldEmptyManualSections) {
|
|
54
|
-
const hashableCode = (shouldEmptyManualSections
|
|
55
|
-
? manual_1.emptyManualSections(code)
|
|
56
|
-
: code).trim();
|
|
55
|
+
const hashableCode = (shouldEmptyManualSections ? (0, manual_1.emptyManualSections)(code) : code).trim();
|
|
57
56
|
return crypto_1.default
|
|
58
57
|
.createHash("shake128", { outputLength: 24 })
|
|
59
58
|
.update(hashableCode)
|
|
@@ -84,9 +83,8 @@ ${customContent}
|
|
|
84
83
|
${customContent}
|
|
85
84
|
@generated Codelock<<${hash}>>`;
|
|
86
85
|
}
|
|
87
|
-
return docblock_1.prependFileDocblock(code, docblockContent);
|
|
86
|
+
return (0, docblock_1.prependFileDocblock)(code, docblockContent);
|
|
88
87
|
}
|
|
89
|
-
exports.lockCode = lockCode;
|
|
90
88
|
/**
|
|
91
89
|
* Verify that the codelock in the source file is valid.
|
|
92
90
|
*
|
|
@@ -99,6 +97,5 @@ function verifyLock(lockedCode) {
|
|
|
99
97
|
return false;
|
|
100
98
|
}
|
|
101
99
|
return (codeblockInfo.hash ===
|
|
102
|
-
computeHash(docblock_1.removeFileDocblock(lockedCode), codeblockInfo.manualSectionsAllowed));
|
|
100
|
+
computeHash((0, docblock_1.removeFileDocblock)(lockedCode), codeblockInfo.manualSectionsAllowed));
|
|
103
101
|
}
|
|
104
|
-
exports.verifyLock = verifyLock;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./CodeFile"), exports);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getFileDocblock = getFileDocblock;
|
|
4
|
+
exports.removeFileDocblock = removeFileDocblock;
|
|
5
|
+
exports.createDocblock = createDocblock;
|
|
6
|
+
exports.prependFileDocblock = prependFileDocblock;
|
|
4
7
|
const docblockMatchRegExp = /^\/\*\*\n(?<contents>( \*.*\n)*?) \*\/\n/;
|
|
5
8
|
/**
|
|
6
9
|
* Get file docblock from `code`, the contents of a source file.
|
|
@@ -26,7 +29,6 @@ function getFileDocblock(code) {
|
|
|
26
29
|
// Remove trailing \n
|
|
27
30
|
.trim());
|
|
28
31
|
}
|
|
29
|
-
exports.getFileDocblock = getFileDocblock;
|
|
30
32
|
/**
|
|
31
33
|
* Removes the file docblock from the start of a file.
|
|
32
34
|
*
|
|
@@ -41,7 +43,6 @@ function removeFileDocblock(code) {
|
|
|
41
43
|
}
|
|
42
44
|
return code.replace(docblockMatchRegExp, "");
|
|
43
45
|
}
|
|
44
|
-
exports.removeFileDocblock = removeFileDocblock;
|
|
45
46
|
/**
|
|
46
47
|
* Creates a docblock from `docblockContent`.
|
|
47
48
|
*
|
|
@@ -55,7 +56,6 @@ function createDocblock(docblockContent) {
|
|
|
55
56
|
const docblock = `/**\n${docblockContentWithLeadingStars}\n */`;
|
|
56
57
|
return docblock;
|
|
57
58
|
}
|
|
58
|
-
exports.createDocblock = createDocblock;
|
|
59
59
|
/**
|
|
60
60
|
* Prepends `code` with `docblockContent`. Assumes `code` does not already have
|
|
61
61
|
* a file docblock.
|
|
@@ -66,4 +66,3 @@ exports.createDocblock = createDocblock;
|
|
|
66
66
|
function prependFileDocblock(code, docblockContent) {
|
|
67
67
|
return `${createDocblock(docblockContent)}\n\n${code.trimStart()}`;
|
|
68
68
|
}
|
|
69
|
-
exports.prependFileDocblock = prependFileDocblock;
|
package/dist/sections/manual.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createManualSection = createManualSection;
|
|
4
|
+
exports.extractManualSections = extractManualSections;
|
|
5
|
+
exports.emptyManualSections = emptyManualSections;
|
|
4
6
|
const sectionMatchRegExp = /\/\* BEGIN MANUAL SECTION (?<key>\S+) \*\/(?<code>(.|\n)+?|)\/\* END MANUAL SECTION \*\//gm;
|
|
5
7
|
function createManualSection(sectionKey, sectionCode) {
|
|
6
8
|
// Ensure section key is non-empty and contains no whitespaces
|
|
@@ -12,7 +14,6 @@ function createManualSection(sectionKey, sectionCode) {
|
|
|
12
14
|
processedSectionCode.length > 0 ? `${processedSectionCode}\n` : "";
|
|
13
15
|
return `/* BEGIN MANUAL SECTION ${sectionKey} */\n${processedSectionCode}/* END MANUAL SECTION */`;
|
|
14
16
|
}
|
|
15
|
-
exports.createManualSection = createManualSection;
|
|
16
17
|
function extractManualSections(code) {
|
|
17
18
|
const allMatches = code.matchAll(sectionMatchRegExp);
|
|
18
19
|
const manualSections = {};
|
|
@@ -24,7 +25,6 @@ function extractManualSections(code) {
|
|
|
24
25
|
});
|
|
25
26
|
return manualSections;
|
|
26
27
|
}
|
|
27
|
-
exports.extractManualSections = extractManualSections;
|
|
28
28
|
/**
|
|
29
29
|
* Removes all code between manual section designators.
|
|
30
30
|
*
|
|
@@ -33,4 +33,3 @@ exports.extractManualSections = extractManualSections;
|
|
|
33
33
|
function emptyManualSections(code) {
|
|
34
34
|
return code.replace(sectionMatchRegExp, (matchedString, sectionKey) => createManualSection(sectionKey, ""));
|
|
35
35
|
}
|
|
36
|
-
exports.emptyManualSections = emptyManualSections;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
3
|
+
import jest from "eslint-plugin-jest";
|
|
4
|
+
import prettier from "eslint-plugin-prettier";
|
|
5
|
+
import globals from "globals";
|
|
6
|
+
import tsParser from "@typescript-eslint/parser";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import js from "@eslint/js";
|
|
10
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const compat = new FlatCompat({
|
|
15
|
+
baseDirectory: __dirname,
|
|
16
|
+
recommendedConfig: js.configs.recommended,
|
|
17
|
+
allConfig: js.configs.all,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default defineConfig([
|
|
21
|
+
{
|
|
22
|
+
extends: compat.extends(
|
|
23
|
+
"eslint:recommended",
|
|
24
|
+
"plugin:@typescript-eslint/recommended",
|
|
25
|
+
"plugin:jest/recommended",
|
|
26
|
+
"plugin:jest/style",
|
|
27
|
+
"plugin:prettier/recommended",
|
|
28
|
+
),
|
|
29
|
+
|
|
30
|
+
plugins: {
|
|
31
|
+
"@typescript-eslint": typescriptEslint,
|
|
32
|
+
jest,
|
|
33
|
+
prettier,
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
languageOptions: {
|
|
37
|
+
globals: {
|
|
38
|
+
...globals.node,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
parser: tsParser,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
rules: {
|
|
45
|
+
"prettier/prettier": "error",
|
|
46
|
+
"jest/valid-title": ["error", { ignoreTypeOfDescribeName: true }],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elg/tscodegen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "TypeScript string-based code generation tool, with hashed files and manually editable sections",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,31 +16,37 @@
|
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
|
17
17
|
"test": "jest --coverage",
|
|
18
18
|
"lint": "yarn lint:code && yarn lint:misc",
|
|
19
|
-
"lint:code": "eslint src ./*.js",
|
|
19
|
+
"lint:code": "eslint src ./*.js ./*.mjs",
|
|
20
20
|
"lint:code:fix": "yarn lint:code --fix",
|
|
21
|
-
"lint:misc": "prettier --check './*.{js,json,md}'",
|
|
21
|
+
"lint:misc": "prettier --check './*.{js,mjs,json,md}'",
|
|
22
22
|
"lint:misc:fix": "yarn lint:misc --write",
|
|
23
23
|
"prepare": "yarn clean && yarn build"
|
|
24
24
|
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@prettier/sync": "^0.6.1"
|
|
27
|
+
},
|
|
25
28
|
"peerDependencies": {
|
|
26
|
-
"prettier": "
|
|
29
|
+
"prettier": "3.x"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
34
|
-
"eslint": "^
|
|
35
|
-
"
|
|
36
|
-
"eslint
|
|
37
|
-
"eslint-
|
|
38
|
-
"jest": "^
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
32
|
+
"@eslint/eslintrc": "^3.3.4",
|
|
33
|
+
"@eslint/js": "^10.0.1",
|
|
34
|
+
"@types/jest": "^30.0.0",
|
|
35
|
+
"@types/mock-fs": "^4.13.4",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
37
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
38
|
+
"codecov": "^3.8.3",
|
|
39
|
+
"eslint": "^10.0.2",
|
|
40
|
+
"eslint-config-prettier": "^10.1.8",
|
|
41
|
+
"eslint-plugin-jest": "^29.15.0",
|
|
42
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
43
|
+
"globals": "^17.4.0",
|
|
44
|
+
"jest": "^30.2.0",
|
|
45
|
+
"jest-junit": "^16.0.0",
|
|
46
|
+
"mock-fs": "^5.5.0",
|
|
47
|
+
"prettier": "^3.8.1",
|
|
48
|
+
"ts-jest": "^29.4.6",
|
|
49
|
+
"typescript": "^5.9.3"
|
|
44
50
|
},
|
|
45
51
|
"keywords": [
|
|
46
52
|
"codegen",
|
|
@@ -1,127 +1,3 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<testsuites name="jest tests" tests="
|
|
3
|
-
<testsuite name="CodeFile" errors="0" failures="0" skipped="0" timestamp="2020-06-07T15:49:00" time="2.25" tests="7">
|
|
4
|
-
<testcase classname="CodeFile CodeFile should read file contents when constructed if file exists" name="CodeFile CodeFile should read file contents when constructed if file exists" time="0.005">
|
|
5
|
-
</testcase>
|
|
6
|
-
<testcase classname="CodeFile CodeFile should initialize to empty string if file does not exist" name="CodeFile CodeFile should initialize to empty string if file does not exist" time="0">
|
|
7
|
-
</testcase>
|
|
8
|
-
<testcase classname="CodeFile verify should return false for loaded invalid locked file from disk" name="CodeFile verify should return false for loaded invalid locked file from disk" time="0.002">
|
|
9
|
-
</testcase>
|
|
10
|
-
<testcase classname="CodeFile verify should return true for newly built and locked file" name="CodeFile verify should return true for newly built and locked file" time="0.002">
|
|
11
|
-
</testcase>
|
|
12
|
-
<testcase classname="CodeFile build should build and lock new code" name="CodeFile build should build and lock new code" time="0.001">
|
|
13
|
-
</testcase>
|
|
14
|
-
<testcase classname="CodeFile lock should add lock to code" name="CodeFile lock should add lock to code" time="0.001">
|
|
15
|
-
</testcase>
|
|
16
|
-
<testcase classname="CodeFile saveToFile should save file contents to path passed at construction" name="CodeFile saveToFile should save file contents to path passed at construction" time="0.002">
|
|
17
|
-
</testcase>
|
|
18
|
-
</testsuite>
|
|
19
|
-
<testsuite name="getCodelockInfo" errors="0" failures="0" skipped="0" timestamp="2020-06-07T15:48:59" time="2.339" tests="14">
|
|
20
|
-
<testcase classname="getCodelockInfo should return undefined if code has no docblock" name="getCodelockInfo should return undefined if code has no docblock" time="0.002">
|
|
21
|
-
</testcase>
|
|
22
|
-
<testcase classname="getCodelockInfo should return undefined if file has some non-codelock docblock" name="getCodelockInfo should return undefined if file has some non-codelock docblock" time="0.001">
|
|
23
|
-
</testcase>
|
|
24
|
-
<testcase classname="getCodelockInfo should return codelock info for editable files" name="getCodelockInfo should return codelock info for editable files" time="0.001">
|
|
25
|
-
</testcase>
|
|
26
|
-
<testcase classname="getCodelockInfo should return codelock info for uneditable files" name="getCodelockInfo should return codelock info for uneditable files" time="0">
|
|
27
|
-
</testcase>
|
|
28
|
-
<testcase classname="lockCode editable files should prepend file docblock with consistent hash" name="lockCode editable files should prepend file docblock with consistent hash" time="0.003">
|
|
29
|
-
</testcase>
|
|
30
|
-
<testcase classname="lockCode editable files should interpolate provided content" name="lockCode editable files should interpolate provided content" time="0.001">
|
|
31
|
-
</testcase>
|
|
32
|
-
<testcase classname="lockCode uneditable files should prepend file docblock with consistent hash" name="lockCode uneditable files should prepend file docblock with consistent hash" time="0">
|
|
33
|
-
</testcase>
|
|
34
|
-
<testcase classname="lockCode uneditable files should interpolate provided content" name="lockCode uneditable files should interpolate provided content" time="0.001">
|
|
35
|
-
</testcase>
|
|
36
|
-
<testcase classname="verifyLock should return false if file does not have docblock" name="verifyLock should return false if file does not have docblock" time="0.001">
|
|
37
|
-
</testcase>
|
|
38
|
-
<testcase classname="verifyLock should return true if file has not been modified after locking" name="verifyLock should return true if file has not been modified after locking" time="0.001">
|
|
39
|
-
</testcase>
|
|
40
|
-
<testcase classname="verifyLock should return false if file has been modified outside manual sections after locking" name="verifyLock should return false if file has been modified outside manual sections after locking" time="0">
|
|
41
|
-
</testcase>
|
|
42
|
-
<testcase classname="verifyLock editable files should return true if file has been modified in manual sections after locking" name="verifyLock editable files should return true if file has been modified in manual sections after locking" time="0">
|
|
43
|
-
</testcase>
|
|
44
|
-
<testcase classname="verifyLock uneditable files should return false if file has been modified in "manual" sections after locking" name="verifyLock uneditable files should return false if file has been modified in "manual" sections after locking" time="0">
|
|
45
|
-
</testcase>
|
|
46
|
-
<testcase classname="reversibility lock -> getCodelockInfo should return the same manualSectionsAllowed" name="reversibility lock -> getCodelockInfo should return the same manualSectionsAllowed" time="0.002">
|
|
47
|
-
</testcase>
|
|
48
|
-
</testsuite>
|
|
49
|
-
<testsuite name="getFileDocblock" errors="0" failures="0" skipped="0" timestamp="2020-06-07T15:49:02" time="0.185" tests="12">
|
|
50
|
-
<testcase classname="getFileDocblock should return undefined if code does not contain docblock" name="getFileDocblock should return undefined if code does not contain docblock" time="0.002">
|
|
51
|
-
</testcase>
|
|
52
|
-
<testcase classname="getFileDocblock should return undefined if code does not start with docblock" name="getFileDocblock should return undefined if code does not start with docblock" time="0">
|
|
53
|
-
</testcase>
|
|
54
|
-
<testcase classname="getFileDocblock should return undefined if docblock is malformed" name="getFileDocblock should return undefined if docblock is malformed" time="0">
|
|
55
|
-
</testcase>
|
|
56
|
-
<testcase classname="getFileDocblock should return docblock without leading stars" name="getFileDocblock should return docblock without leading stars" time="0.001">
|
|
57
|
-
</testcase>
|
|
58
|
-
<testcase classname="removeFileDocblock should passthrough files without docblocks" name="removeFileDocblock should passthrough files without docblocks" time="0">
|
|
59
|
-
</testcase>
|
|
60
|
-
<testcase classname="removeFileDocblock should passthrough files that does not start with docblock" name="removeFileDocblock should passthrough files that does not start with docblock" time="0.001">
|
|
61
|
-
</testcase>
|
|
62
|
-
<testcase classname="removeFileDocblock should passthrough files with malformed docblocks" name="removeFileDocblock should passthrough files with malformed docblocks" time="0">
|
|
63
|
-
</testcase>
|
|
64
|
-
<testcase classname="removeFileDocblock should return code without docblock" name="removeFileDocblock should return code without docblock" time="0">
|
|
65
|
-
</testcase>
|
|
66
|
-
<testcase classname="createDocblock should create docblock correctly" name="createDocblock should create docblock correctly" time="0.001">
|
|
67
|
-
</testcase>
|
|
68
|
-
<testcase classname="prependFileDocblock should prepend docblock correctly" name="prependFileDocblock should prepend docblock correctly" time="0">
|
|
69
|
-
</testcase>
|
|
70
|
-
<testcase classname="reversibility prepend -> get should return same docblock content" name="reversibility prepend -> get should return same docblock content" time="0">
|
|
71
|
-
</testcase>
|
|
72
|
-
<testcase classname="reversibility prepend -> remove should return original code" name="reversibility prepend -> remove should return original code" time="0.001">
|
|
73
|
-
</testcase>
|
|
74
|
-
</testsuite>
|
|
75
|
-
<testsuite name="CodeBuilder" errors="0" failures="0" skipped="0" timestamp="2020-06-07T15:48:59" time="2.546" tests="9">
|
|
76
|
-
<testcase classname="CodeBuilder add should add code verbatim" name="CodeBuilder add should add code verbatim" time="0.002">
|
|
77
|
-
</testcase>
|
|
78
|
-
<testcase classname="CodeBuilder addLine should add code with appended newline" name="CodeBuilder addLine should add code with appended newline" time="0">
|
|
79
|
-
</testcase>
|
|
80
|
-
<testcase classname="CodeBuilder addDocblock should add single line docblock with appended newline" name="CodeBuilder addDocblock should add single line docblock with appended newline" time="0.003">
|
|
81
|
-
</testcase>
|
|
82
|
-
<testcase classname="CodeBuilder addDocblock should add multiline docblock with appended newline" name="CodeBuilder addDocblock should add multiline docblock with appended newline" time="0">
|
|
83
|
-
</testcase>
|
|
84
|
-
<testcase classname="CodeBuilder addBlock should generate block using a new builder" name="CodeBuilder addBlock should generate block using a new builder" time="0.002">
|
|
85
|
-
</testcase>
|
|
86
|
-
<testcase classname="CodeBuilder addBlock should set hasManualSections to true if added section has a manual section" name="CodeBuilder addBlock should set hasManualSections to true if added section has a manual section" time="0.001">
|
|
87
|
-
</testcase>
|
|
88
|
-
<testcase classname="CodeBuilder addManualSection should generate manual section using a new builder" name="CodeBuilder addManualSection should generate manual section using a new builder" time="0.001">
|
|
89
|
-
</testcase>
|
|
90
|
-
<testcase classname="CodeBuilder addManualSection should retain existing manual section content if present" name="CodeBuilder addManualSection should retain existing manual section content if present" time="0.001">
|
|
91
|
-
</testcase>
|
|
92
|
-
<testcase classname="CodeBuilder should work" name="CodeBuilder should work" time="0.204">
|
|
93
|
-
</testcase>
|
|
94
|
-
</testsuite>
|
|
95
|
-
<testsuite name="createManualSection" errors="0" failures="0" skipped="0" timestamp="2020-06-07T15:49:02" time="0.203" tests="15">
|
|
96
|
-
<testcase classname="createManualSection should throw if section key is empty or has whitespaces" name="createManualSection should throw if section key is empty or has whitespaces" time="0.005">
|
|
97
|
-
</testcase>
|
|
98
|
-
<testcase classname="createManualSection should generate manual section with key and code" name="createManualSection should generate manual section with key and code" time="0.001">
|
|
99
|
-
</testcase>
|
|
100
|
-
<testcase classname="createManualSection should insert code on its own line" name="createManualSection should insert code on its own line" time="0.001">
|
|
101
|
-
</testcase>
|
|
102
|
-
<testcase classname="createManualSection should remove blank lines surrounding code" name="createManualSection should remove blank lines surrounding code" time="0">
|
|
103
|
-
</testcase>
|
|
104
|
-
<testcase classname="extractManualSections should ignore code that does not have any manual sections" name="extractManualSections should ignore code that does not have any manual sections" time="0.001">
|
|
105
|
-
</testcase>
|
|
106
|
-
<testcase classname="extractManualSections should ignore malformed manual sections" name="extractManualSections should ignore malformed manual sections" time="0">
|
|
107
|
-
</testcase>
|
|
108
|
-
<testcase classname="extractManualSections should extract single line manual section" name="extractManualSections should extract single line manual section" time="0.001">
|
|
109
|
-
</testcase>
|
|
110
|
-
<testcase classname="extractManualSections should extract multiline manual section" name="extractManualSections should extract multiline manual section" time="0">
|
|
111
|
-
</testcase>
|
|
112
|
-
<testcase classname="extractManualSections should extract multiple manual sections" name="extractManualSections should extract multiple manual sections" time="0">
|
|
113
|
-
</testcase>
|
|
114
|
-
<testcase classname="emptyManualSections should passthrough code that does not have any manual sections" name="emptyManualSections should passthrough code that does not have any manual sections" time="0.001">
|
|
115
|
-
</testcase>
|
|
116
|
-
<testcase classname="emptyManualSections should passthrough code that has malformed manual sections" name="emptyManualSections should passthrough code that has malformed manual sections" time="0">
|
|
117
|
-
</testcase>
|
|
118
|
-
<testcase classname="emptyManualSections should reset an empty manual section" name="emptyManualSections should reset an empty manual section" time="0">
|
|
119
|
-
</testcase>
|
|
120
|
-
<testcase classname="emptyManualSections should empty single line manual section" name="emptyManualSections should empty single line manual section" time="0.001">
|
|
121
|
-
</testcase>
|
|
122
|
-
<testcase classname="emptyManualSections should empty multiline manual section" name="emptyManualSections should empty multiline manual section" time="0">
|
|
123
|
-
</testcase>
|
|
124
|
-
<testcase classname="emptyManualSections should empty multiple manual sections" name="emptyManualSections should empty multiple manual sections" time="0">
|
|
125
|
-
</testcase>
|
|
126
|
-
</testsuite>
|
|
2
|
+
<testsuites name="jest tests" tests="0" failures="0" time="0.844">
|
|
127
3
|
</testsuites>
|