-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactoring the root index to no longer require
fs
- Loading branch information
Showing
7 changed files
with
899 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
coverage/ | ||
node_modules/ | ||
src/*.har | ||
index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ __tests__/ | |
coverage/ | ||
.eslint* | ||
.prettier* | ||
build.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
coverage/ | ||
src/*.har | ||
index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env node | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
(async () => { | ||
const out = {}; | ||
const files = await fs.readdirSync(path.join(__dirname, './src')); | ||
|
||
files | ||
.filter(har => { | ||
return har.indexOf('.har') !== -1; | ||
}) | ||
.forEach(har => { | ||
out[har.replace('.har', '')] = JSON.parse(fs.readFileSync(path.join(__dirname, `./src/${har}`), 'utf8')); | ||
}); | ||
|
||
const build = `// This file is autogenerated. Run \`npm run build\` to update it. | ||
module.exports = ${JSON.stringify(out, undefined, 2)};`; | ||
|
||
fs.writeFileSync('index.js', build); | ||
})(); |
Oops, something went wrong.