space-router 0.8.5 → 0.9.0
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/.swc-cjs +11 -0
- package/CHANGELOG.md +5 -0
- package/LICENSE +1 -1
- package/dist/cjs/history.js +89 -100
- package/dist/cjs/index.js +26 -16
- package/dist/cjs/match.js +82 -85
- package/dist/cjs/qs.js +24 -20
- package/dist/cjs/router.js +252 -188
- package/dist/esm/history.js +81 -94
- package/dist/esm/index.js +3 -3
- package/dist/esm/match.js +65 -79
- package/dist/esm/qs.js +17 -20
- package/dist/esm/router.js +235 -161
- package/package.json +12 -13
- package/src/index.js +3 -3
- package/src/router.js +3 -3
- package/tasks/build.js +11 -5
- package/test/flatten.test.js +1 -1
- package/test/match.test.js +2 -2
- package/test/router.test.js +1 -1
- package/.babelrc-cjs +0 -17
- /package/{.babelrc-esm → .swc-esm} +0 -0
package/tasks/build.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
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)
|
|
2
8
|
|
|
3
9
|
const sh = (...args) => execa(...args, { stdio: 'inherit', shell: true })
|
|
4
10
|
|
|
@@ -6,9 +12,9 @@ const sh = (...args) => execa(...args, { stdio: 'inherit', shell: true })
|
|
|
6
12
|
await sh('rm -rf dist')
|
|
7
13
|
await sh('mkdir -p dist')
|
|
8
14
|
|
|
9
|
-
const pkg =
|
|
15
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json')))
|
|
10
16
|
|
|
11
|
-
const
|
|
12
|
-
await sh(`${
|
|
13
|
-
await sh(`${
|
|
17
|
+
const swc = './node_modules/.bin/swc'
|
|
18
|
+
await sh(`${swc} --no-swcrc src -d ${pkg.main} --config-file=./.swc-cjs`)
|
|
19
|
+
await sh(`${swc} --no-swcrc src -d ${pkg.module} --config-file=./.swc-esm`)
|
|
14
20
|
})()
|
package/test/flatten.test.js
CHANGED
package/test/match.test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import test from 'ava'
|
|
2
|
-
import { qs } from '../src'
|
|
3
|
-
import { matchOne as match } from '../src/match'
|
|
2
|
+
import { qs } from '../src/index.js'
|
|
3
|
+
import { matchOne as match } from '../src/match.js'
|
|
4
4
|
|
|
5
5
|
test('match explicit equality', (t) => {
|
|
6
6
|
t.deepEqual(match('/', '/').params, {})
|
package/test/router.test.js
CHANGED
package/.babelrc-cjs
DELETED
|
File without changes
|