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

Suggestions for improving maintainability and use the library as a NPM package #193

Open
mrauhu opened this issue Jul 29, 2022 · 2 comments
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@mrauhu
Copy link

mrauhu commented Jul 29, 2022

Hello, @abrahamjuliot.

I want to implement best practices in the tooling based on the Vite repository.

The goal is to make it easier for maintainers to participate in the project and allow users use the library as a NPM package.

Checklist

Zero changes to the code

Minor changes to the code

  • Disable sending requests to the server API by default (for stand-alone usage).
  • Create monorepo for client and server packages.

Minor changes to the package code: syntax and typing

  • Run lint on all codebase.
  • Typization. Fix TypeScript types errors (don't use any type).

Minor changes in the package.json and Github Actions

  • Use Vite for development (includes ESBuild for TypeScript and CSS building and minifying, PostCSS and Rollup for production builds) and simplify package.json dev dependencies.
  • Set minimal version of Node.js to 16 and use latest build-in NPM version (with workspaces) or Pnpm instead Yarn (outdated).
  • Remove the express package (use vite preview).
  • Move tests/ from docs/, and use docs/ directory as built result instead of public/.
  • Rename package name in package.json from creepjs to creep-js (as example), because there is already a package with same name in the NPM Registry.
  • Make tree-shakable CommonJS (CJS) and ECMAScript Modules (ESM) exports for client API functions.
  • Add support for publishing package to the NPM Registry via .github/workspaces.

Major changes to the code

  • Split the src/**/*.ts file into views and client API functions.
  • Create server API for stand-alone usage instead of the https://creepjs-api.web.app/ with closed sources.

  1. Are you ready to accept such changes?
  2. May I create a one pull request with all suggested features?

Best wishes,
Sergey.

@mrauhu mrauhu changed the title Suggestions for improving maintainability Suggestions for improving maintainability and use the library as a NPM package Jul 29, 2022
@abrahamjuliot
Copy link
Owner

Hey @mrauhu Thank you for the well outlined suggestions.

Let's pause on making all these changes. We do want to avoid creating a fingerprinting library package. The primary goal is only to promote research and education on the subject of browser fingerprinting.

linting, types, etc

Good tips. I will look into this. Just ported the js to ts recently (a work in progress). The goal is to convert all .ts files to strict types (no any or ts-ignore) and split up functions into subdirectories (utils, constants, template, types).

disable default API request

This is on my mind.

package.json

These are all great tips. I will look at each.

/docs is sort of a final release for GitHub pages. public is a commit staging environment for mass browser testing. docs/tests is for playground fingerprinting ideas. I intend to add functional tests soon (Playwright and Jest).

@mrauhu
Copy link
Author

mrauhu commented Jul 29, 2022

@abrahamjuliot thank you for response.

@abrahamjuliot abrahamjuliot added enhancement New feature or request dependencies Pull requests that update a dependency file labels Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants