Open the root directory of the repo and run:
# install dependencies
yarn install
# build
yarn build
- packages/babel-plugin-ts-nameof - Transform plugin for Babel.
- packages/common - Common code used by almost everything.
- packages/scripts-common - Common scripts used by other packages.
- packages/tests-common - Tests used by some packages. Write all your transform tests here.
- packages/transforms-babel - Transforms from the Babel AST to the Common AST.
- packages/transforms-common - Nameof transforms done in the Common AST.
- packages/transforms-ts - Transforms from the TypeScript AST to the Common AST.
- packages/ts-nameof - ts-nameof library for the TypeScript compiler.
- packages/ts-nameof.macro - ts-nameof.macro library for Babel macros.
# build (run in root dir)
yarn build
# run tests (run in root dir)
yarn test
# format the code (download dprint from dprint.dev)
dprint fmt
yarn clean && yarn build
The global definitions are stored in lib/global.d.ts. To make changes:
- Add a failing test in lib/global.tests.ts (failing test means you get a compile error)
- Update lib/global.d.ts.
- Run
yarn create-declaration-file
in the root directory
- Update packages/ts-nameof/lib/declarationFileTests.ts with a failing test.
- Update the API in packages/ts-nameof/src/main.ts.
- Run
yarn create-declaration-file
in the root directory
Run the following command in the root directory, which will check that everything is good:
yarn verify