@wavemaker/angular-app 11.8.0-rc.5775 → 11.10.0-next.140547

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,124 @@
1
+
2
+ <!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Angular Dependencies Report</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ line-height: 1.6;
12
+ margin: 0;
13
+ padding: 20px;
14
+ color: #333;
15
+ }
16
+ .header {
17
+ background: #f4f4f4;
18
+ padding: 20px;
19
+ margin-bottom: 20px;
20
+ border-radius: 4px;
21
+ }
22
+ .section {
23
+ margin-bottom: 30px;
24
+ }
25
+ table {
26
+ width: 100%;
27
+ border-collapse: collapse;
28
+ margin-bottom: 20px;
29
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2);
30
+ }
31
+ th, td {
32
+ border: 1px solid #ddd;
33
+ padding: 12px;
34
+ text-align: left;
35
+ }
36
+ th {
37
+ background-color: #f8f8f8;
38
+ font-weight: bold;
39
+ }
40
+ tr:nth-child(even) {
41
+ background-color: #f9f9f9;
42
+ }
43
+ tr:hover {
44
+ background-color: #f5f5f5;
45
+ }
46
+ .dependency-type {
47
+ font-size: 1.2em;
48
+ color: #666;
49
+ font-weight: bold;
50
+ margin: 20px 0 10px;
51
+ padding-bottom: 5px;
52
+ border-bottom: 2px solid #eee;
53
+ }
54
+ .transitive {
55
+ margin-left: 20px;
56
+ border-left: 3px solid #eee;
57
+ padding-left: 20px;
58
+ }
59
+ .license-count {
60
+ font-weight: bold;
61
+ color: #2196F3;
62
+ }
63
+ .timestamp {
64
+ color: #666;
65
+ font-style: italic;
66
+ }
67
+ </style>
68
+ </head>
69
+ <body>
70
+ <div class="header">
71
+ <h1>Angular Project Dependencies Report</h1>
72
+ <p class="timestamp">Generated on: 12/30/2024, 5:58:29 PM</p>
73
+ </div>
74
+
75
+ <div class="section">
76
+ <h2>Project Dependencies Overview</h2>
77
+
78
+
79
+ </div>
80
+
81
+ <div class="section">
82
+ <h2>Transitive Dependencies</h2>
83
+
84
+ <div class="dependency-type">Transitive Dependencies</div>
85
+ <table>
86
+ <tr>
87
+ <th>Package</th>
88
+ <th>Version</th>
89
+ <th>License</th>
90
+ <th>Repository</th>
91
+ </tr>
92
+
93
+ <tr>
94
+ <td></td>
95
+ <td>wavemaker/angular-app</td>
96
+ <td>UNKNOWN</td>
97
+ <td>N/A</td>
98
+ </tr>
99
+
100
+ </table>
101
+
102
+ </div>
103
+
104
+ <div class="section">
105
+ <h2>License Summary</h2>
106
+
107
+ <table>
108
+ <tr>
109
+ <th>License</th>
110
+ <th>Count</th>
111
+ <th>Packages</th>
112
+ </tr>
113
+
114
+ <tr>
115
+ <td>UNKNOWN</td>
116
+ <td class="license-count">1</td>
117
+ <td></td>
118
+ </tr>
119
+
120
+ </table>
121
+
122
+ </div>
123
+ </body>
124
+ </html>
@@ -0,0 +1,240 @@
1
+ const checker = require('license-checker');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ // HTML template as a string
6
+ const htmlTemplate = `
7
+ <!DOCTYPE html>
8
+ <html lang="en">
9
+ <head>
10
+ <meta charset="UTF-8">
11
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
12
+ <title>Angular Dependencies Report</title>
13
+ <style>
14
+ body {
15
+ font-family: Arial, sans-serif;
16
+ line-height: 1.6;
17
+ margin: 0;
18
+ padding: 20px;
19
+ color: #333;
20
+ }
21
+ .header {
22
+ background: #f4f4f4;
23
+ padding: 20px;
24
+ margin-bottom: 20px;
25
+ border-radius: 4px;
26
+ }
27
+ .section {
28
+ margin-bottom: 30px;
29
+ }
30
+ table {
31
+ width: 100%;
32
+ border-collapse: collapse;
33
+ margin-bottom: 20px;
34
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2);
35
+ }
36
+ th, td {
37
+ border: 1px solid #ddd;
38
+ padding: 12px;
39
+ text-align: left;
40
+ }
41
+ th {
42
+ background-color: #f8f8f8;
43
+ font-weight: bold;
44
+ }
45
+ tr:nth-child(even) {
46
+ background-color: #f9f9f9;
47
+ }
48
+ tr:hover {
49
+ background-color: #f5f5f5;
50
+ }
51
+ .dependency-type {
52
+ font-size: 1.2em;
53
+ color: #666;
54
+ font-weight: bold;
55
+ margin: 20px 0 10px;
56
+ padding-bottom: 5px;
57
+ border-bottom: 2px solid #eee;
58
+ }
59
+ .transitive {
60
+ margin-left: 20px;
61
+ border-left: 3px solid #eee;
62
+ padding-left: 20px;
63
+ }
64
+ .license-count {
65
+ font-weight: bold;
66
+ color: #2196F3;
67
+ }
68
+ .timestamp {
69
+ color: #666;
70
+ font-style: italic;
71
+ }
72
+ </style>
73
+ </head>
74
+ <body>
75
+ <div class="header">
76
+ <h1>Angular Project Dependencies Report</h1>
77
+ <p class="timestamp">Generated on: {{GENERATED_DATE}}</p>
78
+ </div>
79
+
80
+ <div class="section">
81
+ <h2>Project Dependencies Overview</h2>
82
+ {{PRODUCTION_DEPENDENCIES}}
83
+ {{DEVELOPMENT_DEPENDENCIES}}
84
+ </div>
85
+
86
+ <div class="section">
87
+ <h2>Transitive Dependencies</h2>
88
+ {{TRANSITIVE_DEPENDENCIES}}
89
+ </div>
90
+
91
+ <div class="section">
92
+ <h2>License Summary</h2>
93
+ {{LICENSE_SUMMARY}}
94
+ </div>
95
+ </body>
96
+ </html>
97
+ `;
98
+
99
+ // Main function to generate the report
100
+ function generateDependencyReport() {
101
+ checker.init({
102
+ start: './',
103
+ json: true,
104
+ customPath: {
105
+ licenses: true,
106
+ dependencies: true,
107
+ version: true
108
+ }
109
+ }, function(err, packages) {
110
+ if (err) {
111
+ console.error("Error:", err);
112
+ return;
113
+ }
114
+
115
+ const projectData = processPackages(packages);
116
+ const html = generateHTML(projectData);
117
+
118
+ // Write the report to a file
119
+ fs.writeFileSync('dependency-report.html', html);
120
+ console.log('Dependency report generated successfully!');
121
+ });
122
+ }
123
+
124
+ // Process the packages data
125
+ function processPackages(packages) {
126
+ const data = {
127
+ production: {},
128
+ development: {},
129
+ transitive: {},
130
+ licenses: {}
131
+ };
132
+
133
+ // Read package.json to determine prod vs dev dependencies
134
+ const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
135
+ const prodDeps = packageJson.dependencies || {};
136
+ const devDeps = packageJson.devDependencies || {};
137
+
138
+ Object.entries(packages).forEach(([pkgName, info]) => {
139
+ const name = pkgName.split('@')[0];
140
+ const version = pkgName.split('@')[1];
141
+ const packageInfo = {
142
+ version,
143
+ license: info.licenses,
144
+ description: info.description || '',
145
+ repository: info.repository || '',
146
+ publisher: info.publisher || ''
147
+ };
148
+
149
+ // Track license information
150
+ if (info.licenses) {
151
+ if (!data.licenses[info.licenses]) {
152
+ data.licenses[info.licenses] = {
153
+ count: 0,
154
+ packages: []
155
+ };
156
+ }
157
+ data.licenses[info.licenses].count++;
158
+ data.licenses[info.licenses].packages.push(name);
159
+ }
160
+
161
+ // Categorize dependencies
162
+ if (prodDeps[name]) {
163
+ data.production[name] = packageInfo;
164
+ } else if (devDeps[name]) {
165
+ data.development[name] = packageInfo;
166
+ } else {
167
+ data.transitive[name] = packageInfo;
168
+ }
169
+ });
170
+
171
+ return data;
172
+ }
173
+
174
+ // Generate HTML tables for dependencies
175
+ function generateDependencyTable(dependencies, title) {
176
+ if (Object.keys(dependencies).length === 0) return '';
177
+
178
+ return `
179
+ <div class="dependency-type">${title}</div>
180
+ <table>
181
+ <tr>
182
+ <th>Package</th>
183
+ <th>Version</th>
184
+ <th>License</th>
185
+ <th>Repository</th>
186
+ </tr>
187
+ ${Object.entries(dependencies)
188
+ .map(([name, info]) => `
189
+ <tr>
190
+ <td>${name}</td>
191
+ <td>${info.version}</td>
192
+ <td>${info.license || 'Unknown'}</td>
193
+ <td>${info.repository || 'N/A'}</td>
194
+ </tr>
195
+ `).join('')}
196
+ </table>
197
+ `;
198
+ }
199
+
200
+ // Generate license summary table
201
+ function generateLicenseSummary(licenses) {
202
+ return `
203
+ <table>
204
+ <tr>
205
+ <th>License</th>
206
+ <th>Count</th>
207
+ <th>Packages</th>
208
+ </tr>
209
+ ${Object.entries(licenses)
210
+ .map(([license, info]) => `
211
+ <tr>
212
+ <td>${license}</td>
213
+ <td class="license-count">${info.count}</td>
214
+ <td>${info.packages.join(', ')}</td>
215
+ </tr>
216
+ `).join('')}
217
+ </table>
218
+ `;
219
+ }
220
+
221
+ // Generate the final HTML
222
+ function generateHTML(data) {
223
+ let html = htmlTemplate;
224
+
225
+ // Replace placeholders with actual content
226
+ html = html.replace('{{GENERATED_DATE}}', new Date().toLocaleString());
227
+ html = html.replace('{{PRODUCTION_DEPENDENCIES}}',
228
+ generateDependencyTable(data.production, 'Production Dependencies'));
229
+ html = html.replace('{{DEVELOPMENT_DEPENDENCIES}}',
230
+ generateDependencyTable(data.development, 'Development Dependencies'));
231
+ html = html.replace('{{TRANSITIVE_DEPENDENCIES}}',
232
+ generateDependencyTable(data.transitive, 'Transitive Dependencies'));
233
+ html = html.replace('{{LICENSE_SUMMARY}}',
234
+ generateLicenseSummary(data.licenses));
235
+
236
+ return html;
237
+ }
238
+
239
+ // Run the report generation
240
+ generateDependencyReport();