-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow local (fs) comparison (#96)
* feat: Add better errors for comparison * fix: Fix compareStats * chore: Minor changes in gitignore * feat: Draft local comparison * feat: First step * fix: Allowing object rest spread syntax * fix: Missing await * fix: Missing anme * fix: Add compareCommit * feat: Add store fs abstraction * chore: Adding missing files * fix: Refactor compare code * fix: Finish implementation * fix: Trimming console * fix: Quotes * perf: Add default ignore in globby
- Loading branch information
Showing
16 changed files
with
206 additions
and
422 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,8 +1,11 @@ | ||
{ | ||
"plugins": [ | ||
["transform-es2015-modules-commonjs", { | ||
["@babel/plugin-transform-modules-commonjs", { | ||
"allowTopLevelThis": true | ||
}] | ||
], | ||
"retainLines": true | ||
"retainLines": true, | ||
"parserOpts": { | ||
"plugins": ["objectRestSpread"] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.DS_STORE | ||
|
||
# Tools artifacts | ||
playground.js | ||
node_modules | ||
build | ||
coverage | ||
|
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
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
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
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
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 @@ | ||
src |
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,15 @@ | ||
{ | ||
"name": "@best/store-fs", | ||
"version": "0.3.2", | ||
"description": "Best Store - File System", | ||
"keywords": [ | ||
"Best", | ||
"LWC" | ||
], | ||
"main": "build/index.js", | ||
"module": "src/index.js", | ||
"dependencies": { | ||
"chalk": "~2.3.0", | ||
"globby": "~7.1.1" | ||
} | ||
} |
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,39 @@ | ||
import fs from 'fs'; | ||
import chalk from 'chalk'; | ||
import globby from 'globby'; | ||
|
||
let ROOT_DIR = process.cwd(); | ||
const IGNORE_PATHS = [ | ||
'**/node_modules/**', | ||
'**/__tests__/**' | ||
]; | ||
|
||
export function initialize({ rootDir }) { | ||
ROOT_DIR = rootDir || ROOT_DIR; | ||
} | ||
|
||
export async function storeBenchmarkResults( | ||
fileMap, | ||
{ benchmarkName, benchmarkSignature, projectConfig }, | ||
globalConfig, | ||
) { | ||
console.log("WIP"); | ||
} | ||
|
||
export async function getAllBenchmarkStatsPerCommit(projectName, commit) { | ||
const pattern = `**/${projectName}/*.benchmark_${commit}/stats.json`; | ||
const results = await globby([pattern], { cwd: ROOT_DIR, ignore: IGNORE_PATHS }); | ||
const statsResults = results.map(statsPath => { | ||
const stats = JSON.parse(fs.readFileSync(statsPath, 'utf8')); | ||
return { ...stats, projectName }; | ||
}); | ||
return statsResults; | ||
} | ||
|
||
export function getProjects() { | ||
console.log('WIP'); | ||
} | ||
|
||
export function getCommits(projectName, branch) { | ||
console.log('WIP'); | ||
} |
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
Oops, something went wrong.