framework-detect v0.0.9
Framework Detect
Working with the project
This project is organised as a monorepo and makes use of npm workspaces.
The folders are organised as follows:
packages/
|- browser-extension A WIP browser extension to test framework detection
|- cli A basic CLI that you can use to test framework detection
|- core The core library where the framework logic is implemented
test/ E2E tests
|- fixtures/ Projects fixtures used to test framework detectionFirst, we need to install the dependencies for the projects. Run this command at the root of the project:
npm installThen build all the packages with:
npm run buildThe core library is the one that is used to detect the framework, and is built in packages/core/dist.
Testing framework detection
Before running tests, you have to import projects samples generated by this repo.
Use the following command to import the samples:
npm run get-samplesIt will download the samples in the test/samples folder.
Then you can run all the tests with:
npm testTo run only the E2E test you can use:
npm run test:e2eTo run only unit tests you can use:
npm test --workspacesUsing the CLI
To use the CLI you first need to link it globally:
cd packages/cli
npm linkThis will make the detect binary available globally.
Note that if you make changes to the CLI or library, you only have to rebuild it with npm run buil, there's no need to re-link it.
Then you can use the CLI to detect the frameworks:
detect test/samples 2Usage
Usage: detect [path] [<folder_depth_to_analyze>]