space-router 0.9.0 → 0.9.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
@@ -1,3 +1,7 @@
1
+ ## 0.9.1
2
+
3
+ - Revert to commonjs (remove `type: "module"`) to keep support for cjs in node and esm in browsers.
4
+
1
5
  ## 0.9.0
2
6
 
3
7
  - Upgrade all dependencies.
package/dist/cjs/index.js CHANGED
@@ -22,6 +22,6 @@ _export(exports, {
22
22
  return _qs.qs;
23
23
  }
24
24
  });
25
- var _router = require("./router.js");
26
- var _history = require("./history.js");
27
- var _qs = require("./qs.js");
25
+ var _router = require("./router");
26
+ var _history = require("./history");
27
+ var _qs = require("./qs");
@@ -19,9 +19,9 @@ _export(exports, {
19
19
  return merge;
20
20
  }
21
21
  });
22
- var _match = require("./match.js");
23
- var _history = require("./history.js");
24
- var _qs = require("./qs.js");
22
+ var _match = require("./match");
23
+ var _history = require("./history");
24
+ var _qs = require("./qs");
25
25
  function _define_property(obj, key, value) {
26
26
  if (key in obj) {
27
27
  Object.defineProperty(obj, key, {
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { createRouter, merge } from "./router.js";
2
- export { createHistory } from "./history.js";
3
- export { qs } from "./qs.js";
1
+ export { createRouter, merge } from "./router";
2
+ export { createHistory } from "./history";
3
+ export { qs } from "./qs";
@@ -77,9 +77,9 @@ function _object_without_properties_loose(source, excluded) {
77
77
  }
78
78
  return target;
79
79
  }
80
- import { match as findMatch } from "./match.js";
81
- import { createHistory } from "./history.js";
82
- import { qs as defaultQs } from "./qs.js";
80
+ import { match as findMatch } from "./match";
81
+ import { createHistory } from "./history";
82
+ import { qs as defaultQs } from "./qs";
83
83
  export function createRouter() {
84
84
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
85
85
  var history = null;
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "space-router",
3
3
  "description": "All the routing essentials.",
4
- "version": "0.9.0",
4
+ "version": "0.9.1",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
7
- "type": "module",
8
7
  "license": "ICS",
9
8
  "repository": {
10
9
  "type": "git",
@@ -32,11 +31,11 @@
32
31
  "release:docs": "hugo -s docs && gh-pages -d docs/public"
33
32
  },
34
33
  "devDependencies": {
34
+ "@swc-node/register": "^1.6.4",
35
35
  "@swc/cli": "^0.1.62",
36
36
  "@swc/core": "^1.3.49",
37
37
  "ava": "^5.2.0",
38
38
  "c8": "^7.13.0",
39
- "esm": "^3.2.25",
40
39
  "execa": "^7.1.1",
41
40
  "gh-pages": "^5.0.0",
42
41
  "healthier": "^6.3.0",
@@ -55,7 +54,7 @@
55
54
  },
56
55
  "ava": {
57
56
  "require": [
58
- "esm"
57
+ "@swc-node/register"
59
58
  ]
60
59
  }
61
60
  }
package/src/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { createRouter, merge } from './router.js'
2
- export { createHistory } from './history.js'
3
- export { qs } from './qs.js'
1
+ export { createRouter, merge } from './router'
2
+ export { createHistory } from './history'
3
+ export { qs } from './qs'
package/src/router.js CHANGED
@@ -1,6 +1,6 @@
1
- import { match as findMatch } from './match.js'
2
- import { createHistory } from './history.js'
3
- import { qs as defaultQs } from './qs.js'
1
+ import { match as findMatch } from './match'
2
+ import { createHistory } from './history'
3
+ import { qs as defaultQs } from './qs'
4
4
 
5
5
  export function createRouter(options = {}) {
6
6
  let history = null
package/tasks/build.js CHANGED
@@ -1,14 +1,10 @@
1
- import fs from 'fs'
2
- import path from 'path'
3
- import { fileURLToPath } from 'url'
4
- import { execa } from 'execa'
5
-
6
- const __filename = fileURLToPath(import.meta.url)
7
- const __dirname = path.dirname(__filename)
8
-
9
- const sh = (...args) => execa(...args, { stdio: 'inherit', shell: true })
1
+ const fs = require('fs')
2
+ const path = require('path')
10
3
 
11
4
  ;(async function () {
5
+ const { execa } = await import('execa')
6
+ const sh = (...args) => execa(...args, { stdio: 'inherit', shell: true })
7
+
12
8
  await sh('rm -rf dist')
13
9
  await sh('mkdir -p dist')
14
10
 
@@ -1,5 +1,5 @@
1
1
  import test from 'ava'
2
- import { flatten } from '../src/router.js'
2
+ import { flatten } from '../src/router'
3
3
 
4
4
  test('converts array of routes to array of internal route descriptors', (t) => {
5
5
  t.deepEqual(
@@ -1,6 +1,6 @@
1
1
  import test from 'ava'
2
- import { qs } from '../src/index.js'
3
- import { matchOne as match } from '../src/match.js'
2
+ import { qs } from '../src'
3
+ import { matchOne as match } from '../src/match'
4
4
 
5
5
  test('match explicit equality', (t) => {
6
6
  t.deepEqual(match('/', '/').params, {})
@@ -1,5 +1,5 @@
1
1
  import test from 'ava'
2
- import { qs, createRouter } from '../src/index.js'
2
+ import { qs, createRouter } from '../src/index'
3
3
 
4
4
  test('createRouter, listen, navigate and dispose', (t) => {
5
5
  const calls = []