compose-paths 1.2.0 → 1.2.1

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
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.1] - 2022-02-07
11
+
12
+ ### Fixed
13
+
14
+ - Broke ESM imports
15
+
10
16
  ## [1.2.0] - 2022-02-06
11
17
 
12
18
  ### Updated
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * compose-paths
3
- * v1.2.0
3
+ * v1.2.1
4
4
  * https://github.com/shuckster/compose-paths
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * compose-paths
3
- * v1.2.0
3
+ * v1.2.1
4
4
  * https://github.com/shuckster/compose-paths
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * compose-paths
3
- * v1.2.0
3
+ * v1.2.1
4
4
  * https://github.com/shuckster/compose-paths
5
5
  * License: MIT
6
6
  */
package/index.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ type TComposedPaths = Array<string> & {
2
+ aliases: Array<string>
3
+ [key: string]: string
4
+ }
5
+
6
+ declare module 'compose-paths' {
7
+ /**
8
+ * @example
9
+ * const paths = composePaths(`
10
+ *
11
+ * ${__dirname}
12
+ * /src
13
+ * /html
14
+ * /templates = TEMPLATES
15
+ * /pages = PAGES
16
+ *
17
+ * /public = PUBLIC
18
+ * /images = IMAGES
19
+ *
20
+ * `)
21
+ *
22
+ * paths.TEMPLATES
23
+ * // "/dir/name/src/html/templates"
24
+ *
25
+ * paths.PUBLIC
26
+ * // "/dir/name/public"
27
+ *
28
+ * paths.aliases
29
+ * // ["TEMPLATES", "PAGES", "PUBLIC", "IMAGES"]
30
+ */
31
+ export function composePaths(pathChart: string | string[]): TComposedPaths
32
+ }
package/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ import lib from './dist/esm/compose-paths.esm.js'
2
+
3
+ const { composePaths, zip } = lib
4
+
5
+ export { composePaths, zip }
6
+ export default lib
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "compose-paths",
3
3
  "browserGlobalName": "composePaths",
4
- "version": "1.2.0",
4
+ "version": "1.2.1",
5
5
  "description": "Define paths + routes without the repetition.",
6
6
  "author": "Conan Theobald",
7
7
  "license": "MIT",
@@ -14,9 +14,9 @@
14
14
  ],
15
15
  "types": "index.d.ts",
16
16
  "main": "./dist/compose-paths.cjs.js",
17
- "module": "dist/esm/compose-paths.esm.js",
17
+ "module": "index.mjs",
18
18
  "exports": {
19
- "import": "./dist/esm/compose-paths.esm.js",
19
+ "import": "./index.mjs",
20
20
  "require": "./dist/cjs/compose-paths.cjs.js",
21
21
  "browser": "./dist/browser/compose-paths.browser.js",
22
22
  "default": "./dist/cjs/compose-paths.cjs.js"
@@ -24,6 +24,8 @@
24
24
  "files": [
25
25
  "dist/**/*.js",
26
26
  "dist/**/package.json",
27
+ "index.d.ts",
28
+ "index.mjs",
27
29
  "CHANGELOG.md",
28
30
  "README.md",
29
31
  "LICENSE"