You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 2, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Got a Question or Problem?
2
2
3
-
You can ask questions by posting an issue. There is no problem, I'll just add the label `question`.
3
+
You can ask questions by opening a discussion. We want to strictly restrict issues section for bug reports.
4
4
5
5
However, please follow those simple guidelines before posting:
6
6
7
-
1. Describe your issue in an understandable english (english is not my native language, but I still try to write something decent, and so should you).
7
+
1. Describe your issue in an understandable English (English is not my native language, but I still try to write something decent, and so should you).
8
8
2. Please be polite (and occasionally avoid being a beggar... :unamused:).
9
-
3. Provide a code to illustrate your issue. A [plnkr](http://plnkr.co/) or something alike is better.
9
+
3. Provide a StackBlitz link or GitHub repo to reproduce the issue. It can help speed-up investigating your issue faster.
10
10
4. Github provides us a wonderful [Markdown](https://help.github.com/articles/github-flavored-markdown) (text-to-HTML), so use it without restraint, especially when putting your code.
11
11
5. Some really good advices on how to ask question:
12
12
* on [StackOverflow](http://stackoverflow.com/help/how-to-ask)
Copy file name to clipboardExpand all lines: DEVELOPER.md
+52-36Lines changed: 52 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Node.js and npm are essential to Angular development.
6
6
7
7
[Get it now](https://docs.npmjs.com/getting-started/installing-node) if it's not already installed on your machine.
8
8
9
-
**Verify that you are running at least node `v10.x.x` and npm `6.x.x`**
9
+
**Verify that you are running at least node `v18.19.x` and npm `10.2.x`**
10
10
by running `node -v` and `npm -v` in a terminal/console window.
11
11
Older versions produce errors.
12
12
@@ -27,7 +27,7 @@ cd angular-datatables
27
27
28
28
Install the npm packages described in the `package.json` and verify that it works:
29
29
30
-
**Attention Windows Developers: You must run all of these commands in administrator mode**.
30
+
**Attention Windows Developers: You must run all of these commands in administrator mode**.
31
31
32
32
```bash
33
33
npm install
@@ -40,11 +40,9 @@ The `npm run build` command compiles the library,
40
40
41
41
We've captured many of the most useful commands in npm scripts defined in the `package.json`:
42
42
43
-
-`npm run tsc` - runs the TypeScript compiler once.
44
-
-`npm run tsc:w` - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them.
45
-
with excellent support for Angular apps that use routing.
46
-
-`npm test` - compiles, runs and watches the karma unit tests
47
-
-`npm build` - compiles and generate the JS files
43
+
-`npm start` - Run the demo/docs app locally.
44
+
-`npm demo:test` - compiles, runs and watches the karma unit tests (`*.spec.ts` files)
45
+
-`npm run build:lib` - compiles and generates prod builds for this library
48
46
49
47
### Updating dependencies version
50
48
@@ -56,47 +54,55 @@ ncu -u
56
54
rm -rf node_modules && npm install
57
55
```
58
56
59
-
If you want to update angular, use the cli:
57
+
If you want to update Angular to latest version:
60
58
61
59
```bash
62
60
ng update @angular/cli @angular/core
63
61
```
64
62
63
+
You can also install a specific Angular version using the below code:
64
+
65
+
```bash
66
+
# Downgrade to Angular 15
67
+
ng update @angular/cli@15 @angular/core@15
68
+
```
69
+
65
70
## Testing
66
71
67
72
These tools are configured for specific conventions described below.
68
73
69
-
*It is unwise and rarely possible to run the application, the unit tests, and the e2e tests at the same time.
70
-
We recommend that you shut down one before starting another.*
74
+
> It is unwise and rarely possible to run the application and the unit tests at the same time.
75
+
>
76
+
> We recommend that you shut down one before starting another.
71
77
72
78
### Unit Tests
73
79
74
-
TypeScript unit-tests are usually in the `src` folder. Their filenames must end in `.spec`.
80
+
Unit tests are essential for ensuring that the library remains compatible with the constantly evolving Angular framework. The more tests, the better :)
81
+
82
+
You can find these tests in the `demo/src` folder, easily recognizable by their filenames ending with `xxx.spec.ts`.
75
83
76
-
Look for the example `src/angular-datatables.directive.spec.ts`.
77
-
Add more `.spec.ts` files as you wish; we configured karma to find them.
84
+
For instance: `demo/src/app/app.component.spec.ts`
78
85
79
-
Run it with `npm test`
86
+
Feel free to add more `.spec.ts` files as needed; karma is set up to locate them.
80
87
81
-
That command first compiles the application, then simultaneously re-compiles and runs the karma test-runner.
82
-
Both the compiler and the karma watch for (different) file changes.
88
+
To run the tests, simply use `npm run demo:test`
83
89
84
-
Shut it down manually with Ctrl-C.
90
+
This command will compile the application first, then proceed to re-compile and run the karma test-runner simultaneously.
91
+
Both the compiler and karma will be on the lookout for any file changes.
85
92
86
-
Test-runner output appears in the terminal window.
87
-
We can update our app and our tests in real-time, keeping a weather eye on the console for broken tests.
88
-
Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (Ctrl-C) and
89
-
restart it. No worries; it's pretty quick.
93
+
The test-runner output will be displayed in the terminal window.
90
94
91
-
The `HTML-Reporter` is also wired in. That produces a prettier output; look for it in `~_test-output/tests.html`.
95
+
By updating our app and tests in real-time, we can keep an eye on the console for any failing tests.
96
+
97
+
Karma (test runner) is occasionally confused and it is often necessary to shut down its browser or even shut the command down (Ctrl-C) and restart it. No worries; it's pretty quick.
92
98
93
99
## Deploying the documentation to Github Pages
94
100
95
101
Run `deploy-doc.sh` to deploy the documentation to the Github Pages
96
102
97
103
You may need to have the following:
98
104
99
-
- git
105
+
-`git`
100
106
- have the basic commands in your OS
101
107
102
108
```bash
@@ -128,13 +134,15 @@ publishes automatically to NPM repository.
128
134
129
135
# Angular Schematics
130
136
137
+
We use Angular Schematics for `ng add` functionality.
138
+
131
139
To build the schematics, issue the following command:
132
140
133
-
`npm run schematics:build`
141
+
`npm run lib:schematics:build`
134
142
135
143
## Testing
136
144
137
-
To test schematics, you will need to setup `verdaccio`, deploy the lib locally in your machine, then install it via `ng add` in an Angular project.
145
+
To test schematics, you will need to setup `verdaccio`, publish the library locally in your machine, then install it via `ng add` in another Angular project, preferably a newly created one in another terminal window.
138
146
139
147
### Steps
140
148
@@ -144,33 +152,41 @@ To test schematics, you will need to setup `verdaccio`, deploy the lib locally i
144
152
145
153
2. Start `verdaccio` server on a terminal or (command prompt if on Windows) by running:
146
154
147
-
`verdaccio`
155
+
`verdaccio`
148
156
149
157
3. Setup an account in `verdaccio` so you can publish the library on your machine:
150
158
151
-
- Run `npm adduser --registry=http://localhost:4873`
152
-
- Give a username, password and an email address to create an account in `verdaccio`.
159
+
- Run `npm adduser --registry=http://localhost:4873`
160
+
- Give a username, password and an email address to create an account in `verdaccio`.
161
+
162
+
4. Make your changes in the project.
153
163
154
-
4. Now, publish the library to `verdaccio` by running the command:
164
+
5. Run `npm run build:lib` to build the library and `ng add` functionality related code.
0 commit comments