@flex-development/mlly 1.0.0-alpha.10 → 1.0.0-alpha.11

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/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [1.0.0-alpha.11](https://github.com/flex-development/mlly/compare/1.0.0-alpha.10...1.0.0-alpha.11) (2023-02-11)
2
+
3
+
4
+ ### :package: Build
5
+
6
+ * **deps-dev:** Bump @vitest/coverage-c8 from 0.28.3 to 0.28.4 ([#122](https://github.com/flex-development/mlly/issues/122)) ([667754f](https://github.com/flex-development/mlly/commit/667754fce9774037dbc2ec60532b5b83f2c36aa9))
7
+ * **deps-dev:** Bump esbuild from 0.17.6 to 0.17.7 ([#124](https://github.com/flex-development/mlly/issues/124)) ([719a8b6](https://github.com/flex-development/mlly/commit/719a8b6bd1595852a2fd1c4e541180532a6004dd))
8
+ * **deps-dev:** Bump vercel from 28.15.2 to 28.15.3 ([#123](https://github.com/flex-development/mlly/issues/123)) ([82d85d1](https://github.com/flex-development/mlly/commit/82d85d1a1ec46207d113923af3e4dd1c3591b65d))
9
+
10
+
11
+ ### :robot: Continuous Integration
12
+
13
+ * **deps:** Bump actions/cache from 3.2.4 to 3.2.5 ([#126](https://github.com/flex-development/mlly/issues/126)) ([f9e1371](https://github.com/flex-development/mlly/commit/f9e1371aa88af80f38cc50cd3f6d757c896f8e6e))
14
+
15
+
16
+ ### :bug: Fixes
17
+
18
+ * **utils:** [`fillModules`] `dot.case` specifier support ([2be2adb](https://github.com/flex-development/mlly/commit/2be2adbfb1bde578898cd4fa4707e29c90b43254))
19
+
1
20
  ## [1.0.0-alpha.10](https://github.com/flex-development/mlly/compare/1.0.0-alpha.9...1.0.0-alpha.10) (2023-02-09)
2
21
 
3
22
 
@@ -35,8 +35,9 @@ const fillModules = async (code, options) => {
35
35
  * @return {Promise<string | undefined>} New file extension or `undefined`
36
36
  */
37
37
  async ext(specifier, url2) {
38
- const extname = pathe.extname(specifier);
39
- if (isBareSpecifier(specifier) || extname.length > 1)
38
+ if (isBareSpecifier(specifier))
39
+ return void 0;
40
+ if (pathe.extname(specifier) === pathe.extname(url2.href))
40
41
  return void 0;
41
42
  const rext = isFunction(ext) ? await ext(specifier, url2) : ext;
42
43
  if (!(rext && rext.trim().length > (rext.startsWith(".") ? 1 : 0))) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/fill-modules.ts"],
4
- "mappings": "AAKA,SAAS,2BAA2B;AAEpC,OAAO,YAAY;AACnB,OAAO,gBAAgB;AACvB,SAAS,kCAAkC;AAC3C,OAAO,WAAyB;AAGhC,OAAO,gBAAgB;AACvB,OAAO,uBAAuB;AAC9B,OAAO,yBAAyB;AAChC,OAAO,qBAAqB;AAC5B,OAAO,mBAAmB;AAC1B,OAAO,qBAAqB;AAC5B,OAAO,yBAAyB;AAkBhC,MAAM,cAAc,OAClB,MACA,YACoB;AACpB,QAAM,EAAE,aAAa,YAAY,KAAK,SAAS,YAAY,IAAI,IAAI;AAGnE,aAAW,aAAa,kBAAkB,IAAI,GAAG;AAE/C,QAAI,CAAC,UAAU;AAAW;AAG1B,QAAI,UAAU,qBAAqB,oBAAoB;AAAS;AAOhE,UAAM,MAAW,MAAM,cAAc,UAAU,WAAW;AAAA,MACxD,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAgBH,MAAM,IAAI,WAAmBA,MAAuC;AAMlE,cAAM,UAA6B,MAAM,QAAQ,SAAS;AAG1D,YAAI,gBAAgB,SAAS,KAAK,QAAQ,SAAS;AAAG,iBAAO;AAO7D,cAAM,OAAe,WAAW,GAAG,IAAI,MAAM,IAAI,WAAWA,IAAG,IAAI;AAGnE,YAAI,EAAE,QAAQ,KAAK,KAAK,EAAE,UAAU,KAAK,WAAW,GAAG,IAAI,IAAI,KAAK;AAClE,gB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AAAG,iBAAO;AAOjE,cAAM,OAAe,WAAW,GAAG,IAAI,MAAM,IAAI,WAAWA,IAAG,IAAI;AAGnE,YAAI,EAAE,QAAQ,KAAK,KAAK,EAAE,UAAU,KAAK,WAAW,GAAG,IAAI,IAAI,KAAK;AAClE,gBAAM,IAAI,2BAA2B,MAAM,SAAS;AAAA,QACtD;AAEA,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAGD,WAAO,KAAK;AAAA,MACV,UAAU;AAAA,MACV,UAAU,KAAK;AAAA,QACb,IAAI,OAAO,YAAY,OAAO,UAAU,SAAS,WAAW;AAAA;AAAA,QAE5D,UAAU,UAAU,WAAW,GAAG,IAC9B,UAAU,YACV,oBAAoB,UAAU,SAAS,IACvC,IAAI,OACJ,gBAAgB,UAAU,SAAS,IACnC,gBAAgB,KAAK,QAAQ,IAAI,IAAI,UAAU,CAAC,IAChD,oBAAoB,KAAK,MAAM;AAAA,MACrC;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAO,uBAAQ;",
5
5
  "names": ["url"]
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flex-development/mlly",
3
3
  "description": "ECMAScript module utilities",
4
- "version": "1.0.0-alpha.10",
4
+ "version": "1.0.0-alpha.11",
5
5
  "keywords": [
6
6
  "ecmascript",
7
7
  "esm",
@@ -119,7 +119,7 @@
119
119
  "@typescript-eslint/eslint-plugin": "5.51.0",
120
120
  "@typescript-eslint/parser": "5.51.0",
121
121
  "@vates/toggle-scripts": "1.0.0",
122
- "@vitest/coverage-c8": "0.28.3",
122
+ "@vitest/coverage-c8": "0.28.4",
123
123
  "@vitest/ui": "0.28.4",
124
124
  "@vue/runtime-core": "3.2.47",
125
125
  "@vuedx/typescript-plugin-vue": "0.7.7-next-1667939290.0",
@@ -139,7 +139,7 @@
139
139
  "cross-env": "7.0.3",
140
140
  "cspell": "6.22.0",
141
141
  "dotenv": "16.0.3",
142
- "esbuild": "0.17.6",
142
+ "esbuild": "0.17.7",
143
143
  "escape-string-regexp": "5.0.0",
144
144
  "eslint": "8.33.0",
145
145
  "eslint-config-prettier": "8.6.0",
@@ -182,7 +182,7 @@
182
182
  "unist-util-remove": "3.1.0",
183
183
  "unist-util-source": "4.0.2",
184
184
  "unist-util-visit": "4.1.2",
185
- "vercel": "28.15.2",
185
+ "vercel": "28.15.3",
186
186
  "version-bump-prompt": "6.1.0",
187
187
  "vfile": "5.3.7",
188
188
  "vite": "4.1.1",
@@ -8,8 +8,7 @@ import type { FillModuleOptions } from '#src/interfaces'
8
8
  import regexp from '#src/internal/escape-reg-exp'
9
9
  import isFunction from '#src/internal/is-function'
10
10
  import { ERR_UNKNOWN_FILE_EXTENSION } from '@flex-development/errnode'
11
- import pathe, { type Ext } from '@flex-development/pathe'
12
- import type { EmptyString } from '@flex-development/tutils'
11
+ import pathe from '@flex-development/pathe'
13
12
  import type { URL } from 'node:url'
14
13
  import CONDITIONS from './conditions'
15
14
  import extractStatements from './extract-statements'
@@ -72,15 +71,11 @@ const fillModules = async (
72
71
  * @return {Promise<string | undefined>} New file extension or `undefined`
73
72
  */
74
73
  async ext(specifier: string, url: URL): Promise<string | undefined> {
75
- /**
76
- * Current file extension of {@linkcode specifier}.
77
- *
78
- * @const {EmptyString | Ext} extname
79
- */
80
- const extname: EmptyString | Ext = pathe.extname(specifier)
74
+ // skip replacement for bare specifiers
75
+ if (isBareSpecifier(specifier)) return void 0
81
76
 
82
- // skip replacement for bare and already fully specified specifiers
83
- if (isBareSpecifier(specifier) || extname.length > 1) return undefined
77
+ // skip replacement for specifiers that are already fully specified
78
+ if (pathe.extname(specifier) === pathe.extname(url.href)) return void 0
84
79
 
85
80
  /**
86
81
  * Replacement file extension.