Skip to content

Commit 90ff2b5

Browse files
committed
feat: @firecamp/firecamp-har skeleton prepared
1 parent a74ae16 commit 90ff2b5

File tree

12 files changed

+221
-0
lines changed

12 files changed

+221
-0
lines changed

packages/firecamp-har/.cspell.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"version": "0.2",
3+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/master/cspell.schema.json",
4+
"language": "en",
5+
"words": [
6+
"bitauth",
7+
"bitjson",
8+
"cimg",
9+
"circleci",
10+
"commitlint",
11+
"dependabot",
12+
"editorconfig",
13+
"esnext",
14+
"execa",
15+
"exponentiate",
16+
"firecamp",
17+
"globby",
18+
"libauth",
19+
"mkdir",
20+
"prettierignore",
21+
"sandboxed",
22+
"transpiled",
23+
"typedoc",
24+
"untracked"
25+
],
26+
"flagWords": [],
27+
"ignorePaths": [
28+
"package.json",
29+
"package-lock.json",
30+
"yarn.lock",
31+
"tsconfig.json",
32+
"node_modules/**"
33+
]
34+
}

packages/firecamp-har/.eslintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parser": "@babel/eslint-parser",
3+
"env": {
4+
"jest": true,
5+
"jest/globals": true
6+
},
7+
"rules": {
8+
"semi-style": "off",
9+
"quotes": [2, "single"],
10+
"semi": "off",
11+
"no-param-reassign": "off",
12+
"no-underscore-dangle": "off",
13+
"arrow-parens": "off"
14+
},
15+
"extends": [
16+
"eslint:recommended",
17+
"plugin:@typescript-eslint/eslint-recommended",
18+
"plugin:@typescript-eslint/recommended",
19+
"plugin:jest/recommended"
20+
],
21+
"parserOptions": {
22+
"sourceType": "module",
23+
"ecmaVersion": 2021
24+
}
25+
}

packages/firecamp-har/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.idea/*
2+
.nyc_output
3+
.vscode
4+
build
5+
node_modules
6+
test
7+
src/**.js
8+
coverage
9+
*.log
10+
!src/declarations.d.ts

packages/firecamp-har/.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git/
2+
.gitignore
3+
4+
src
5+
node_module
6+
7+
README.md
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# package.json is formatted by package managers, so we ignore it here
2+
package.json
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { Config } from '@jest/types';
2+
3+
// Sync object
4+
const config: Config.InitialOptions = {
5+
setupFilesAfterEnv: ['./jest.setup.ts'],
6+
roots: ['<rootDir>/src'],
7+
testMatch: [
8+
'**/__tests__/**/*.+(ts|tsx|js)',
9+
'**/?(*.)+(spec|test).+(ts|tsx|js)',
10+
],
11+
transform: {
12+
'^.+\\.(ts|tsx)$': 'ts-jest',
13+
},
14+
collectCoverageFrom: [
15+
'**/*.{js,jsx,ts,tsx}',
16+
'!**/*.d.ts',
17+
'!**/node_modules/**',
18+
],
19+
globals: {
20+
'ts-jest': {
21+
tsconfig: 'tsconfig.esm.json',
22+
},
23+
},
24+
verbose: true,
25+
testPathIgnorePatterns: [],
26+
};
27+
export default config;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Object.assign(global, require('jest-chrome'));

packages/firecamp-har/package.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@firecamp/firecamp-har",
3+
"version": "1.0.0",
4+
"description": "",
5+
"type": "module",
6+
"main": "dist/index.js",
7+
"module": "dist/index.mjs",
8+
"types": "dist/index.d.ts",
9+
"keywords": [],
10+
"author": "",
11+
"license": "AGPLv3",
12+
"scripts": {
13+
"build": "tsup",
14+
"clean": "rimraf dist/",
15+
"fix": "run-s fix:*",
16+
"fix:prettier": "prettier \"src/**/*.ts\" --write",
17+
"fix:lint": "eslint src --ext .ts --fix",
18+
"test": "pnpm clean && pnpm build && pnpm jest --bail --silent=false --verbose",
19+
"test:lint": "eslint src --ext .ts",
20+
"test:prettier": "prettier \"src/**/*.ts\" --list-different",
21+
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"",
22+
"check-integration-tests": "run-s check-integration-test:*",
23+
"watch:build": "tsc -p tsconfig.json -w",
24+
"version": "standard-version"
25+
},
26+
"dependencies": {
27+
"@firecamp/types": "^0.2.2"
28+
},
29+
"devDependencies": {
30+
"@types/chrome": "^0.0.204",
31+
"@types/jest": "^29.2.4",
32+
"@types/node": "^18.0.0",
33+
"@typescript-eslint/eslint-plugin": "^5.35.1",
34+
"@typescript-eslint/parser": "^5.29.0",
35+
"cspell": "^4.1.0",
36+
"eslint": "^8.29.0",
37+
"eslint-config-prettier": "^6.11.0",
38+
"eslint-plugin-eslint-comments": "^3.2.0",
39+
"eslint-plugin-functional": "^4.2.1",
40+
"eslint-plugin-import": "^2.22.0",
41+
"jest": "^28.1.3",
42+
"jest-chrome": "^0.8.0",
43+
"prettier": "^2.1.1",
44+
"rimraf": "^3.0.2",
45+
"standard-version": "^9.0.0",
46+
"ts-jest": "^28.0.7",
47+
"ts-node": "^10.9.1",
48+
"tsup": "^6.7.0",
49+
"typedoc": "^0.23.8",
50+
"typescript": "^4.7.4"
51+
}
52+
}

packages/firecamp-har/readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Firecamp <> HAR
2+
3+
This package will convert
4+
5+
1. Firecamp collection to HAR
6+
2. HAR to Firecamp Collection
7+
8+
usage
9+
10+
```
11+
import { firecampToHar, harToFirecamp } from "@firecamp/firecamp-har";
12+
13+
const firecampCollection = { requests: [ fcRequest ] }
14+
const har = firecampToHar(firecampCollection);
15+
console.log(har);
16+
17+
const fc = harToFirecamp(harCollection);
18+
console.log(fc);
19+
```

packages/firecamp-har/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Collection } from '@firecamp/types';
2+
3+
const firecampToHar = (collection: Partial<Collection>): any => {
4+
return {};
5+
};
6+
7+
const harToFirecamp = (): Partial<Collection> => {
8+
return { requests: [] };
9+
};
10+
11+
export { firecampToHar, harToFirecamp };

0 commit comments

Comments
 (0)