Skip to content

Commit bcb49ef

Browse files
committed
feat: [docmark-util-symbol] constants
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 8aaa346 commit bcb49ef

13 files changed

Lines changed: 226 additions & 92 deletions

File tree

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ ignore:
139139
- '**/index.mts'
140140
- '**/interfaces/**'
141141
- '**/types/**'
142-
- '!src/index.mts'
142+
- '!packages/*/src/index.mts'
143143

144144
profiling:
145145
critical_files_paths: []

build/plugins/dts.mts

Lines changed: 0 additions & 79 deletions
This file was deleted.

packages/docmark-util-symbol/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@
4848
},
4949
"./package.json": "./package.json"
5050
},
51+
"imports": {
52+
"#lib/*": "./src/*.mts"
53+
},
5154
"module": "./dist/index.mjs",
5255
"types": "./dist/index.d.mts",
5356
"devDependencies": {
5457
"@flex-development/docmark-util-types": "workspace:*",
55-
"@flex-development/unist-util-types": "1.6.1"
58+
"@flex-development/unist-util-types": "1.6.1",
59+
"micromark-util-symbol": "2.0.1"
5660
},
5761
"sideEffects": false
5862
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`unit:constants > should be readonly record of constant values 1`] = `
4+
{
5+
"attentionSideAfter": 2,
6+
"attentionSideBefore": 1,
7+
"atxHeadingOpeningFenceSizeMax": 6,
8+
"autolinkDomainSizeMax": 63,
9+
"autolinkSchemeSizeMax": 32,
10+
"cdataOpeningString": "CDATA[",
11+
"characterGroupPunctuation": 2,
12+
"characterGroupWhitespace": 1,
13+
"characterReferenceDecimalSizeMax": 7,
14+
"characterReferenceHexadecimalSizeMax": 6,
15+
"characterReferenceNamedSizeMax": 31,
16+
"codeFencedSequenceSizeMin": 3,
17+
"contentTypeContent": "content",
18+
"contentTypeDocument": "document",
19+
"contentTypeFlow": "flow",
20+
"contentTypeString": "string",
21+
"contentTypeText": "text",
22+
"hardBreakPrefixSizeMin": 2,
23+
"htmlBasic": 6,
24+
"htmlCdata": 5,
25+
"htmlComment": 2,
26+
"htmlComplete": 7,
27+
"htmlDeclaration": 4,
28+
"htmlInstruction": 3,
29+
"htmlRaw": 1,
30+
"htmlRawSizeMax": 8,
31+
"linkReferenceSizeMax": 999,
32+
"linkResourceDestinationBalanceMax": 32,
33+
"listItemValueSizeMax": 10,
34+
"numericBaseDecimal": 10,
35+
"numericBaseHexadecimal": 16,
36+
"tabSize": 4,
37+
"thematicBreakMarkerCountMin": 3,
38+
"v8MaxSafeChunkSize": 10000,
39+
}
40+
`;
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`e2e:docmark-util-symbol > should expose public api 1`] = `[]`;
3+
exports[`e2e:docmark-util-symbol > should expose public api 1`] = `
4+
[
5+
"constants",
6+
]
7+
`;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`unit:constants > should be readonly record of constant values 1`] = `
4+
{
5+
"attentionSideAfter": 2,
6+
"attentionSideBefore": 1,
7+
"atxHeadingOpeningFenceSizeMax": 6,
8+
"autolinkDomainSizeMax": 63,
9+
"autolinkSchemeSizeMax": 32,
10+
"cdataOpeningString": "CDATA[",
11+
"characterGroupPunctuation": 2,
12+
"characterGroupWhitespace": 1,
13+
"characterReferenceDecimalSizeMax": 7,
14+
"characterReferenceHexadecimalSizeMax": 6,
15+
"characterReferenceNamedSizeMax": 31,
16+
"codeFencedSequenceSizeMin": 3,
17+
"contentTypeContent": "content",
18+
"contentTypeDocument": "document",
19+
"contentTypeFlow": "flow",
20+
"contentTypeString": "string",
21+
"contentTypeText": "text",
22+
"hardBreakPrefixSizeMin": 2,
23+
"htmlBasic": 6,
24+
"htmlCdata": 5,
25+
"htmlComment": 2,
26+
"htmlComplete": 7,
27+
"htmlDeclaration": 4,
28+
"htmlInstruction": 3,
29+
"htmlRaw": 1,
30+
"htmlRawSizeMax": 8,
31+
"linkReferenceSizeMax": 999,
32+
"linkResourceDestinationBalanceMax": 32,
33+
"listItemValueSizeMax": 10,
34+
"numericBaseDecimal": 10,
35+
"numericBaseHexadecimal": 16,
36+
"tabSize": 4,
37+
"thematicBreakMarkerCountMin": 3,
38+
"v8MaxSafeChunkSize": 10000,
39+
}
40+
`;
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`e2e:docmark-util-symbol > should expose public api 1`] = `[]`;
3+
exports[`e2e:docmark-util-symbol > should expose public api 1`] = `
4+
[
5+
"constants",
6+
]
7+
`;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @file Unit Tests - constants
3+
* @module docmark-util-symbol/tests/unit/constants
4+
*/
5+
6+
import testSubject from '#lib/constants'
7+
import * as micromark from 'micromark-util-symbol'
8+
9+
describe('unit:constants', () => {
10+
it('should be readonly record of constant values', () => {
11+
expect(testSubject).to.be.frozen
12+
expect(testSubject).toMatchSnapshot()
13+
})
14+
15+
it('should match micromark.constants', () => {
16+
expect(testSubject).toMatchObject(micromark.constants)
17+
})
18+
})
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* @file constants
3+
* @module docmark-util-symbol/constants
4+
*/
5+
6+
/**
7+
* Constant values.
8+
*
9+
* @enum {number | string}
10+
*/
11+
const constants = Object.freeze({
12+
attentionSideAfter: 2,
13+
attentionSideBefore: 1,
14+
atxHeadingOpeningFenceSizeMax: 6,
15+
autolinkDomainSizeMax: 63,
16+
autolinkSchemeSizeMax: 32,
17+
cdataOpeningString: 'CDATA[',
18+
characterGroupPunctuation: 2,
19+
characterGroupWhitespace: 1,
20+
characterReferenceDecimalSizeMax: 7,
21+
characterReferenceHexadecimalSizeMax: 6,
22+
characterReferenceNamedSizeMax: 31,
23+
codeFencedSequenceSizeMin: 3,
24+
contentTypeContent: 'content',
25+
contentTypeDocument: 'document',
26+
contentTypeFlow: 'flow',
27+
contentTypeString: 'string',
28+
contentTypeText: 'text',
29+
hardBreakPrefixSizeMin: 2,
30+
htmlBasic: 6,
31+
htmlCdata: 5,
32+
htmlComment: 2,
33+
htmlComplete: 7,
34+
htmlDeclaration: 4,
35+
htmlInstruction: 3,
36+
htmlRaw: 1,
37+
htmlRawSizeMax: 8,
38+
linkReferenceSizeMax: 999,
39+
linkResourceDestinationBalanceMax: 32,
40+
listItemValueSizeMax: 10,
41+
numericBaseDecimal: 10,
42+
numericBaseHexadecimal: 0x10,
43+
tabSize: 4,
44+
thematicBreakMarkerCountMin: 3,
45+
v8MaxSafeChunkSize: 10_000
46+
} as const)
47+
48+
export default constants

packages/docmark-util-symbol/src/index.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
* @module docmark-util-symbol
44
*/
55

6-
export {}
6+
export { default as constants } from '#lib/constants'

0 commit comments

Comments
 (0)