|
1 | | -# typescript-template-library |
2 | | - |
3 | | -## Installation |
4 | | - |
5 | | -1. Create a new empty git repo |
6 | | - ```bash |
7 | | - mkdir my-project |
8 | | - cd my-project |
9 | | - git init . |
10 | | - ``` |
11 | | -2. Install the template (Copy this into git bash). |
12 | | - ```bash |
13 | | - git remote add template https://github.com/StatelessStudio/typescript-template-library/ && git pull template master --allow-unrelated-histories && git remote remove template |
14 | | - ``` |
15 | | -3. Replace "typescript-template-library" with the name of your library project-wide (**No Spaces or special characters except dash!**) |
16 | | -4. `npm i` |
17 | | -5. Update the documentation, changelog, etc |
18 | | - |
19 | | -## Pulling updates from typescript-template-library |
20 | | - |
21 | | -1. Run the install command in the installation instructions |
22 | | -2. Resolve merge conflicts |
23 | | -3. Test! |
24 | | - |
25 | | -## Development |
26 | | - |
27 | | -Run a dev test with `npm start`. |
28 | | - |
29 | | -Here's a rundown of where to put your code, see each file for more information: |
30 | | - |
31 | | -- **script/example.ts**: Create an example application that uses your library |
32 | | -- **src/environment.ts**: Setup environment variables here |
33 | | -- **src/index.ts**: You don't typically need to edit this file, it just initializes and starts your app. |
34 | | - |
35 | | -## Running Tests |
36 | | - |
37 | | -To run unit tests, `npm run test` |
38 | | - |
39 | | -## Scripts |
40 | | - |
41 | | -You can write custom scripts in the `script/` directory. See `script/example.ts` as an example. You should also register your scripts in `package.json`: |
42 | | - |
43 | | -```json |
44 | | -{ |
45 | | - ... |
46 | | - "scripts": { |
47 | | - ... |
48 | | - "admin:example": "ts-node script/example" |
49 | | - } |
50 | | -} |
51 | | -``` |
52 | | - |
53 | | -Run your script with `npm run admin:example` |
54 | | - |
55 | | -## Compiling |
56 | | - |
57 | | -### Debug Builds |
58 | | - |
59 | | -To compile a debug build, run `npm run build:dev`. The build output will appear in the `./dist` folder. |
60 | | - |
61 | | -### Prod Builds |
62 | | - |
63 | | -To compile a production build, run `npm run build:prod`. The build output will appear in the `./dist` folder. |
64 | | - |
65 | | -### Clean Builds |
66 | | - |
67 | | -To generate a clean build (removes old artifacts and reruns pre&post process scripts), append `:clean` to a build script: |
68 | | -- Debug: `npm run build:dev:clean` |
69 | | -- Release: `npm run build:prod:clean` |
70 | | - |
71 | | -## More |
72 | | - |
73 | | -### Generating Docs |
74 | | - |
75 | | -`npm run doc` and browse docs/index.html! |
76 | | - |
77 | | -### Environment Variables |
78 | | - |
79 | | -See `src/environment.ts` to see how to use this project's environment variables. Configure an environment in `.env` or with `process.env` (https://nodejs.org/dist/latest-v16.x/docs/api/process.html#processenv). |
| 1 | +# ts-task-queue |
0 commit comments