Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions packages/firecamp-har/.cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": "0.2",
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/master/cspell.schema.json",
"language": "en",
"words": [
"bitauth",
"bitjson",
"cimg",
"circleci",
"commitlint",
"dependabot",
"editorconfig",
"esnext",
"execa",
"exponentiate",
"firecamp",
"globby",
"libauth",
"mkdir",
"prettierignore",
"sandboxed",
"transpiled",
"typedoc",
"untracked"
],
"flagWords": [],
"ignorePaths": [
"package.json",
"package-lock.json",
"yarn.lock",
"tsconfig.json",
"node_modules/**"
]
}
25 changes: 25 additions & 0 deletions packages/firecamp-har/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"parser": "@babel/eslint-parser",
"env": {
"jest": true,
"jest/globals": true
},
"rules": {
"semi-style": "off",
"quotes": [2, "single"],
"semi": "off",
"no-param-reassign": "off",
"no-underscore-dangle": "off",
"arrow-parens": "off"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended"
],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2021
}
}
10 changes: 10 additions & 0 deletions packages/firecamp-har/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea/*
.nyc_output
.vscode
build
node_modules
test
src/**.js
coverage
*.log
!src/declarations.d.ts
7 changes: 7 additions & 0 deletions packages/firecamp-har/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git/
.gitignore

src
node_module

README.md
2 changes: 2 additions & 0 deletions packages/firecamp-har/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# package.json is formatted by package managers, so we ignore it here
package.json
27 changes: 27 additions & 0 deletions packages/firecamp-har/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Config } from '@jest/types';

// Sync object
const config: Config.InitialOptions = {
setupFilesAfterEnv: ['./jest.setup.ts'],
roots: ['<rootDir>/src'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)',
],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.esm.json',
},
},
verbose: true,
testPathIgnorePatterns: [],
};
export default config;
1 change: 1 addition & 0 deletions packages/firecamp-har/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Object.assign(global, require('jest-chrome'));
53 changes: 53 additions & 0 deletions packages/firecamp-har/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@firecamp/firecamp-har",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"keywords": [],
"author": "",
"license": "AGPLv3",
"scripts": {
"build": "tsup",
"clean": "rimraf dist/",
"fix": "run-s fix:*",
"fix:prettier": "prettier \"src/**/*.ts\" --write",
"fix:lint": "eslint src --ext .ts --fix",
"test": "pnpm clean && pnpm build && pnpm jest --bail --silent=false --verbose",
"test:lint": "eslint src --ext .ts",
"test:prettier": "prettier \"src/**/*.ts\" --list-different",
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"",
"check-integration-tests": "run-s check-integration-test:*",
"watch:build": "tsc -p tsconfig.json -w",
"version": "standard-version"
},
"dependencies": {
"@firecamp/types": "^0.2.2",
"@types/har-format": "^1.2.8"
},
"devDependencies": {
"@types/chrome": "^0.0.204",
"@types/jest": "^29.2.4",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.29.0",
"cspell": "^4.1.0",
"eslint": "^8.29.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^4.2.1",
"eslint-plugin-import": "^2.22.0",
"jest": "^28.1.3",
"jest-chrome": "^0.8.0",
"prettier": "^2.1.1",
"rimraf": "^3.0.2",
"standard-version": "^9.0.0",
"ts-jest": "^28.0.7",
"ts-node": "^10.9.1",
"tsup": "^6.7.0",
"typedoc": "^0.23.8",
"typescript": "^4.7.4"
}
}
19 changes: 19 additions & 0 deletions packages/firecamp-har/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Firecamp <> HAR

This package will convert

1. Firecamp collection to HAR
2. HAR to Firecamp Collection

usage

```
import { firecampToHar, harToFirecamp } from "@firecamp/firecamp-har";

const firecampCollection = { requests: [ fcRequest ] }
const har = firecampToHar(firecampCollection);
console.log(har);

const fc = harToFirecamp(harCollection);
console.log(fc);
```
12 changes: 12 additions & 0 deletions packages/firecamp-har/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Har } from 'har-format';
import { Collection } from '@firecamp/types';

const firecampToHar = (collection: Partial<Collection>): any => {
return {};
};

const harToFirecamp = (har: Har): Partial<Collection> => {
return { requests: [] };
};

export { firecampToHar, harToFirecamp };
1 change: 1 addition & 0 deletions packages/firecamp-har/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

15 changes: 15 additions & 0 deletions packages/firecamp-har/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"skipLibCheck": true,
"target": "ESNext",
"lib": [
"esnext"
],
"declaration": true,
"declarationDir": "dist",
"module": "esnext",
"moduleResolution": "node",
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
}
}
18 changes: 18 additions & 0 deletions packages/firecamp-har/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Options } from 'tsup';

const env = process.env.NODE_ENV;

export const tsup: Options = {
splitting: true,
clean: true, // clean up the dist folder
dts: true, // generate dts files
format: ['cjs', 'esm'], // generate cjs and esm files
minify: env === 'production',
bundle: env === 'production',
skipNodeModulesBundle: true,
entryPoints: ['src/index.ts'],
watch: env === 'development',
target: 'es2020',
outDir: 'dist',
entry: ['src/**/*.ts'], //include all files under src
};
Loading