Skip to content

Commit 731bd2a

Browse files
committed
refactor!: statements
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent bddfa7c commit 731bd2a

Some content is hidden

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

66 files changed

+1854
-2556
lines changed

.commitlintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"deps-opt",
1818
"deps-peer",
1919
"docs",
20+
"enums",
2021
"esm",
2122
"exports",
2223
"github",

.editorconfig

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ root = true
77

88
# universal rules
99
[*]
10-
charset = 'utf-8'
10+
charset = utf-8
11+
continuation_indent_size = 2
12+
curly_bracket_next_line = false
1113
end_of_line = lf
12-
indent_brace_style = 'K&R'
14+
indent_brace_style = BSD
1315
indent_size = 2
1416
indent_style = space
1517
insert_final_newline = true
1618
max_line_length = 80
1719
quote_type = single
18-
spaces_around_brackets = none
20+
spaces_around_brackets = inside
1921
spaces_around_operators = true
2022
tab_width = 2
2123
trim_trailing_whitespace = true
@@ -24,6 +26,10 @@ trim_trailing_whitespace = true
2426
[*.hbs]
2527
max_line_length = 100
2628

29+
# markdown
30+
[*.md]
31+
max_line_length = 120
32+
2733
# shellscript
2834
[*.sh]
2935
max_line_length = 100

.eslintrc.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const config = {
3333
rules: {
3434
'unicorn/no-keyword-prefix': 0
3535
}
36+
},
37+
{
38+
files: ['src/lib/find-exports.ts'],
39+
rules: {
40+
'unicorn/prefer-module': 0
41+
}
3642
}
3743
]
3844
}

.github/workflows/ci.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,12 @@ jobs:
5555
- id: spelling
5656
name: Check spelling
5757
run: yarn check:spelling
58-
- id: types
59-
name: Check types
60-
run: yarn check:types
61-
- id: types-build
62-
name: Check types build
63-
run: yarn check:types:build
58+
- id: typecheck
59+
name: Run typecheck
60+
run: yarn typecheck && yarn check:types:build
6461
- id: test
6562
name: Run tests
66-
run: yarn test:cov
67-
env:
68-
NODE_NO_WARNINGS: 1
69-
VITEST_SEGFAULT_RETRY: 3
63+
run: yarn test:cov --segfault-retry=3
7064
- id: pack
7165
name: Pack project
7266
run: yarn pack -o %s-%v.tgz

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ yarn-error.log*
4545
*.lcov
4646
__tests__/report.json
4747
coverage/
48+
tsconfig.temp.json
4849
vitest.config.*.timestamp-*.mjs
4950

5051
# ESLint

.husky/pre-commit

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# References:
66
#
77
# - https://github.com/okonet/lint-staged#command-line-flags
8+
# - https://vitest.dev/guide/cli.html#changed
89

9-
yarn check:types
10+
yarn typecheck --changed HEAD^
1011
yarn check:types:build
1112
lint-staged

.husky/pre-push

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
#
77
# - https://vitest.dev/guide/cli.html#changed
88

9-
yarn check:types
109
yarn test --changed HEAD^
1110
yarn build

.vscode/settings.json

+81-35
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,54 @@
11
{
22
"[handlebars]": {
33
"editor.defaultFormatter": "Greenbyte.handlebars-preview",
4-
"editor.rulers": [100],
5-
"editor.wordWrap": "wordWrapColumn",
4+
"editor.rulers": [
5+
{
6+
"color": "var(--vscode-editorRuler-foreground)",
7+
"column": 100
8+
}
9+
],
610
"editor.wordWrapColumn": 100,
711
"rewrap.wrappingColumn": 100
812
},
913
"[ignore]": {
1014
"editor.defaultFormatter": "foxundermoon.shell-format"
1115
},
12-
"[javascript]": {
13-
"editor.defaultFormatter": "esbenp.prettier-vscode"
14-
},
1516
"[jest-snapshot]": {
16-
"editor.rulers": [130],
17-
"editor.wordWrap": "wordWrapColumn",
17+
"editor.rulers": [
18+
{
19+
"color": "var(--vscode-editorRuler-foreground)",
20+
"column": 130
21+
}
22+
],
1823
"editor.wordWrapColumn": 130,
1924
"rewrap.wrappingColumn": 130
2025
},
21-
"[json]": {
22-
"editor.defaultFormatter": "esbenp.prettier-vscode"
23-
},
24-
"[jsonc]": {
25-
"editor.defaultFormatter": "esbenp.prettier-vscode"
26-
},
2726
"[markdown]": {
28-
"editor.codeActionsOnSave": {
29-
"source.organizeImports": false
30-
},
31-
"editor.defaultFormatter": "esbenp.prettier-vscode"
27+
"editor.defaultFormatter": "vscode.markdown-language-features",
28+
"editor.rulers": [
29+
{
30+
"color": "var(--vscode-editorRuler-foreground)",
31+
"column": 120
32+
}
33+
],
34+
"editor.wordWrapColumn": 120,
35+
"rewrap.wrappingColumn": 120
3236
},
3337
"[properties]": {
3438
"editor.defaultFormatter": "foxundermoon.shell-format"
3539
},
3640
"[shellscript]": {
37-
"editor.defaultFormatter": "esbenp.prettier-vscode",
38-
"editor.rulers": [100],
41+
"editor.defaultFormatter": "foxundermoon.shell-format",
42+
"editor.rulers": [
43+
{
44+
"color": "var(--vscode-editorRuler-foreground)",
45+
"column": 100
46+
}
47+
],
3948
"editor.wordWrap": "wordWrapColumn",
4049
"editor.wordWrapColumn": 100,
4150
"rewrap.wrappingColumn": 100
4251
},
43-
"[txt]": {
44-
"editor.defaultFormatter": "esbenp.prettier-vscode"
45-
},
46-
"[typescript]": {
47-
"editor.defaultFormatter": "esbenp.prettier-vscode"
48-
},
4952
"[vue]": {
5053
"editor.codeActionsOnSave": {
5154
"source.organizeImports": false
@@ -59,15 +62,47 @@
5962
"rewrap.wrappingColumn": 100
6063
},
6164
"[yaml]": {
62-
"editor.defaultFormatter": "esbenp.prettier-vscode",
63-
"editor.rulers": [100],
64-
"editor.wordWrap": "wordWrapColumn",
65+
"editor.rulers": [
66+
{
67+
"color": "var(--vscode-editorRuler-foreground)",
68+
"column": 100
69+
}
70+
],
6571
"editor.wordWrapColumn": 100,
6672
"rewrap.wrappingColumn": 100
6773
},
6874
"cSpell.enabled": true,
6975
"debug.showBreakpointsInOverviewRuler": true,
76+
"diffEditor.ignoreTrimWhitespace": false,
77+
"diffEditor.renderSideBySide": false,
78+
"editor.acceptSuggestionOnEnter": "smart",
7079
"editor.autoClosingBrackets": "always",
80+
"editor.bracketPairColorization.enabled": true,
81+
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
82+
"editor.codeActionsOnSave": {
83+
"source.fixAll": true,
84+
"source.fixAll.sortJSON": false,
85+
"source.organizeImports": true
86+
},
87+
"editor.defaultFormatter": "esbenp.prettier-vscode",
88+
"editor.detectIndentation": false,
89+
"editor.renderFinalNewline": false,
90+
"editor.formatOnPaste": true,
91+
"editor.formatOnSave": true,
92+
"editor.formatOnType": true,
93+
"editor.guides.indentation": true,
94+
"editor.multiCursorModifier": "ctrlCmd",
95+
"editor.overviewRulerBorder": true,
96+
"editor.rulers": [
97+
{
98+
// microsoft/vscode#166261
99+
"color": "var(--vscode-editorRuler-foreground)",
100+
"column": 80
101+
}
102+
],
103+
"editor.tabSize": 2,
104+
"editor.wordWrap": "wordWrapColumn",
105+
"editor.wordWrapColumn": 80,
71106
"emmet.excludeLanguages": [],
72107
"emmet.includeLanguages": {
73108
"markdown": "html",
@@ -114,17 +149,28 @@
114149
"**/.DS_Store": true,
115150
"**/yarn.lock": true
116151
},
152+
"files.insertFinalNewline": true,
153+
"files.trimFinalNewlines": true,
154+
"files.trimTrailingWhitespace": true,
117155
"git.autofetch": true,
118156
"git.enableSmartCommit": true,
119-
"markdownlint.ignore": "./.markdownlintignore",
157+
"markdown.extension.toc.slugifyMode": "github",
158+
"markdown.extension.toc.updateOnSave": false,
159+
"markdownlint.ignore": ".markdownlintignore",
160+
"markdownlint.lintWorkspaceGlobs": [
161+
"**/*.md",
162+
"!**/node_modules",
163+
"!**/.git",
164+
"!**/CHANGELOG.md",
165+
"!**/LICENSE.md"
166+
],
120167
"npm-intellisense.scanDevDependencies": true,
121-
"prettier.configPath": "./.prettierrc.json",
122-
"prettier.enable": true,
123-
"prettier.ignorePath": "./.prettierignore",
124-
"prettier.prettierPath": "./node_modules/prettier",
125-
"prettier.resolveGlobalModules": false,
168+
"prettier.configPath": ".prettierrc.json",
169+
"prettier.enable": false,
170+
"prettier.prettierPath": "node_modules/prettier",
126171
"prettier.useEditorConfig": true,
127172
"shellformat.flag": "-ci -fn -i=2 -sr",
173+
"shellformat.useEditorConfig": true,
128174
"typescript.suggest.completeFunctionCalls": true,
129175
"typescript.suggest.completeJSDocs": true,
130176
"typescript.tsdk": "./node_modules/typescript/lib",
@@ -144,7 +190,7 @@
144190
"icon": "graphql"
145191
},
146192
{
147-
"extensions": ["build.json"],
193+
"extensions": ["build.json", "typecheck.json"],
148194
"format": "svg",
149195
"icon": "tsconfig"
150196
},

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# mlly
22

3-
[![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
4-
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
5-
[![module type: esm](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)
63
[![npm](https://img.shields.io/npm/v/@flex-development/mlly.svg)](https://npmjs.com/package/@flex-development/mlly)
74
[![license](https://img.shields.io/github/license/flex-development/mlly.svg)](LICENSE.md)
8-
[![typescript](https://badgen.net/badge/-/typescript?color=2a72bc&icon=typescript&label)](https://typescriptlang.org)
5+
[![module type: esm](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)
6+
[![conventional commits](https://img.shields.io/badge/-conventional%20commits-fe5196?logo=conventional-commits&logoColor=ffffff)](https://conventionalcommits.org/)
7+
[![typescript](https://img.shields.io/badge/-typescript-3178c6?logo=typescript&logoColor=ffffff)](https://typescriptlang.org/)
8+
[![vitest](https://img.shields.io/badge/-vitest-6e9f18?style=flat&logo=vitest&logoColor=ffffff)](https://vitest.dev/)
9+
[![yarn](https://img.shields.io/badge/-yarn-2c8ebb?style=flat&logo=yarn&logoColor=ffffff)](https://yarnpkg.com/)
910

1011
> [ECMAScript module][1] utilities.
1112

docs/.vitepress/theme/comments/link-replacements.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77
"{@linkcode DynamicImport}": "/api/interfaces#dynamicimport",
88
"{@linkcode ErrnoException}": "https://github.com/wooorm/import-meta-resolve/blob/2.1.0/lib/errors.js#L1-L10",
99
"{@linkcode ExportStatement}": "/api/interfaces#exportstatement",
10-
"{@linkcode Ext}": "/api/types#ext",
10+
"{@linkcode Ext}": "https://github.com/flex-development/pathe/blob/main/src/types/ext.ts",
1111
"{@linkcode ImportStatement}": "/api/interfaces#importstatement",
1212
"{@linkcode MIMEType}": "/api/types#mimetype",
13+
"{@linkcode ModuleSpecifierType}": "/api/types#modulespecifiertype",
1314
"{@linkcode RESOLVE_EXTENSIONS}": "/api/constants#resolve-extensions",
1415
"{@linkcode RequireStatement}": "/api/interfaces#requirestatement",
1516
"{@linkcode ResolveAliasOptions}": "/api/interfaces#resolvealiasoptions",
1617
"{@linkcode ResolveOptions}": "/api/interfaces#resolveoptions",
17-
"{@linkcode SpecifierType}": "/api/types#specifiertype",
18-
"{@linkcode StatementType}": "/api/types#statementtype",
18+
"{@linkcode SpecifierKind}": "https://github.com/flex-development/mlly/blob/main/src/enums/kind-specifier.ts",
19+
"{@linkcode StatementKind}": "https://github.com/flex-development/mlly/blob/main/src/enums/kind-statement.ts",
1920
"{@linkcode Statement}": "/api/interfaces#statement",
2021
"{@linkcode StaticImport}": "/api/interfaces#staticimport",
22+
"{@linkcode SyntaxKindExport}": "/api/types#syntaxkindexport",
23+
"{@linkcode SyntaxKindImport}": "/api/types#syntaxkindimport",
24+
"{@linkcode SyntaxKindRequire}": "/api/types#syntaxkindrequire",
25+
"{@linkcode SyntaxKind}": "https://github.com/flex-development/mlly/blob/main/src/enums/kind-syntax.ts",
2126
"{@linkcode URL}": "https://nodejs.org/api/url.html#class-url",
2227
"{@linkcode detectSyntax}": "/api/#detectsyntax",
2328
"{@linkcode extractStatements}": "/api/#extractstatements",

package.json

+17-11
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,18 @@
4141
},
4242
"scripts": {
4343
"build": "mkbuild",
44-
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn check:types && yarn check:types:build && yarn test:cov && NODE_ENV=production yarn pack -o %s-%v.tgz && yarn clean:pack",
44+
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn check:types:build && yarn test:cov && NODE_ENV=production yarn pack -o %s-%v.tgz && yarn clean:pack",
4545
"check:format": "prettier --check .",
4646
"check:lint": "eslint --exit-on-fatal-error --ext cjs,cts,gql,json,jsonc,md,mjs,ts,vue,yml --max-warnings 0 .",
4747
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
48-
"check:types": "vue-tsc -p tsconfig.json",
48+
"check:types": "vue-tsc -p tsconfig.typecheck.json",
4949
"check:types:build": "vue-tsc -p tsconfig.build.json",
5050
"check:upgrades": "yarn upgrade-interactive",
5151
"clean:build": "trash ./{dist,*.tgz}",
52+
"clean:coverage": "trash ./coverage",
5253
"clean:modules": "trash ./.yarn/{cache,*.gz} ./node_modules",
5354
"clean:pack": "trash ./*.tgz",
54-
"clean:test": "trash ./coverage",
55+
"clean:test": "yarn clean:coverage && trash ./__tests__/report.json",
5556
"conventional-changelog": "node --loader=./loader.mjs ./node_modules/.bin/conventional-changelog -n ./changelog.config.cts",
5657
"docs:build": "vc pull --environment=preview && vc build",
5758
"docs:build:prod": "vc pull --environment=production && vc build --prod",
@@ -71,10 +72,14 @@
7172
"recommended-bump": "conventional-recommended-bump --preset=conventionalcommits --tag-prefix=$(jq .tagPrefix package.json -r) --verbose",
7273
"release": "bash ./scripts/release.sh",
7374
"test": "vitest run",
74-
"test:cov": "yarn test --coverage",
75-
"test:watch": "vitest"
75+
"test:cov": "yarn clean:coverage; yarn test --coverage",
76+
"test:watch": "vitest",
77+
"typecheck": "vitest typecheck --run",
78+
"typecheck:watch": "vitest typecheck"
7679
},
7780
"dependencies": {
81+
"@flex-development/export-regex": "1.0.0",
82+
"@flex-development/import-regex": "2.0.0",
7883
"@flex-development/is-builtin": "1.0.1",
7984
"@flex-development/pathe": "1.0.1",
8085
"@flex-development/tsconfig-types": "2.0.1",
@@ -113,8 +118,8 @@
113118
"@typescript-eslint/eslint-plugin": "5.47.0",
114119
"@typescript-eslint/parser": "5.47.0",
115120
"@vates/toggle-scripts": "1.0.0",
116-
"@vitest/coverage-c8": "0.26.0",
117-
"@vitest/ui": "0.26.1",
121+
"@vitest/coverage-c8": "0.26.2",
122+
"@vitest/ui": "0.26.2",
118123
"@vuedx/typescript-plugin-vue": "0.7.6-next-1666251997.0",
119124
"chai": "4.3.7",
120125
"chai-each": "0.0.1",
@@ -166,10 +171,10 @@
166171
"unist-util-visit": "4.1.1",
167172
"vercel": "28.9.0",
168173
"version-bump-prompt": "6.1.0",
169-
"vite": "4.0.2",
174+
"vite": "4.0.3",
170175
"vite-tsconfig-paths": "4.0.3",
171176
"vitepress": "1.0.0-alpha.32",
172-
"vitest": "0.26.1",
177+
"vitest": "0.26.2",
173178
"vitest-github-actions-reporter": "0.9.0",
174179
"vue": "3.2.45",
175180
"vue-eslint-parser": "9.1.0",
@@ -180,8 +185,9 @@
180185
"@ardatan/sync-fetch": "larsgw/sync-fetch#head=worker_threads",
181186
"@flex-development/tutils": "6.0.0-alpha.7",
182187
"esbuild": "0.16.10",
183-
"vite": "4.0.2",
184-
"vitepress@npm:1.0.0-alpha.32": "patch:vitepress@npm%3A1.0.0-alpha.32#patches/vitepress+1.0.0-alpha.32.dev.patch"
188+
"vite": "4.0.3",
189+
"vitepress@npm:1.0.0-alpha.32": "patch:vitepress@npm%3A1.0.0-alpha.32#patches/vitepress+1.0.0-alpha.32.dev.patch",
190+
"vitest@npm:0.26.2": "patch:vitest@npm%3A0.26.2#patches/vitest+0.26.2.dev.patch"
185191
},
186192
"engines": {
187193
"node": ">=14.16",

0 commit comments

Comments
 (0)