Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.

Commit 482f21e

Browse files
committed
refactor: normalize paths to unix
1 parent 17e86b2 commit 482f21e

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

npm-audit.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ <h5 class="card-title">
4747
<div class="card">
4848
<div class="card-body">
4949
<h5 class="card-title">
50-
11
50+
12
5151
</h5>
5252
<p class="card-text">Dependencies</p>
5353
</div>
5454
</div>
5555
<div class="card">
5656
<div class="card-body">
5757
<h5 class="card-title">
58-
December 3rd 2020, 2:19:47 pm
58+
December 3rd 2020, 2:31:35 pm
5959
</h5>
6060
<p class="card-text">Last updated</p>
6161
</div>

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
},
7979
"dependencies": {
8080
"@poppinss/utils": "^2.5.9",
81-
"camelcase": "^6.2.0"
81+
"camelcase": "^6.2.0",
82+
"slash": "^3.0.0"
8283
}
8384
}

src/Supercharged/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
* file that was distributed with this source code.
88
*/
99

10+
import slash from 'slash'
11+
import { join } from 'path'
1012
import { Edge } from 'edge.js'
1113
import camelcase from 'camelcase'
12-
import { join, sep } from 'path'
1314
import { fsReadAll } from '@poppinss/utils'
1415

1516
/**
@@ -89,9 +90,11 @@ export class Supercharged {
8990
const components = fsReadAll(join(basePath, 'components'), (file) => file.endsWith('.edge'))
9091

9192
components.forEach((file) => {
93+
file = slash(file)
94+
9295
const name = file
9396
.replace(/\.edge$/, '') // Drop extension
94-
.split(sep) // Split path
97+
.split('/') // Split path
9598
.map((segment) => camelcase(segment)) // Convert each segment to camelCase
9699
.join('.') // Join by .
97100

0 commit comments

Comments
 (0)