Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: firecamp <> har package created #126

Merged
merged 2 commits into from
Oct 20, 2023
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 @@
{

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)
"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 @@
{

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)
"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';

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)

// 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'));

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)
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

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)

This package will convert

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

usage

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

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

har is not a recognized word. (unrecognized-spelling)

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

har is not a recognized word. (unrecognized-spelling)

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

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

har is not a recognized word. (unrecognized-spelling)
console.log(har);

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

har is not a recognized word. (unrecognized-spelling)

const fc = harToFirecamp(harCollection);

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

har is not a recognized word. (unrecognized-spelling)
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';

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)
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 @@

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)

Check warning

Code scanning / check-spelling

Binary File Warning

Skipping packages/firecamp-har/src/types.ts because appears to be a binary file ('application/octet-stream'). (binary-file)
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 @@
{

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)
"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';

Check failure

Code scanning / check-spelling

Check File Path Error

har is not a recognized word. (check-file-path)

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
Loading