@iobroker/repochecker 4.0.0-alpha.1 → 4.0.0-alpha.3

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.
package/README.md CHANGED
@@ -33,7 +33,7 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca
33
33
  -->
34
34
 
35
35
  ## Changelog
36
- ### 4.0.0-alpha.1 (2025-05-31)
36
+ ### 4.0.0-alpha.3 (2025-05-31)
37
37
 
38
38
  - (mcm1957) use jsdelivr.com to retrive files from github.
39
39
 
@@ -65,7 +65,7 @@ async function checkGitIgnore(context) {
65
65
 
66
66
  if (!tooComplexToCheck) {
67
67
  checkFiles.forEach(file => {
68
- if (context.filesList.includes(file)) {
68
+ if (context.filesList.includes(`/${file}`)) {
69
69
  // maybe it is with regex
70
70
  const check = rules.some(rule => {
71
71
  if (typeof rule === 'string') {
@@ -88,13 +88,13 @@ async function checkGitIgnore(context) {
88
88
  async function checkNpmIgnore(context) {
89
89
  console.log('\n[E950 - E989] checkNpmIgnore');
90
90
  const checkFiles = [
91
- '/node_modules/',
92
- '/test/',
93
- '/src/',
94
- '/appveyor.yml',
95
- '/.travis.yml',
96
- '/tsconfig.json',
97
- '/tsconfig.build.json',
91
+ 'node_modules/',
92
+ 'test/',
93
+ 'src/',
94
+ 'appveyor.yml',
95
+ '.travis.yml',
96
+ 'tsconfig.json',
97
+ 'tsconfig.build.json',
98
98
  // 'iob_npm.done',
99
99
  // '.git/',
100
100
  // '.github/',
@@ -164,7 +164,7 @@ async function checkNpmIgnore(context) {
164
164
  // }
165
165
 
166
166
  checkFiles.forEach((file, i) => {
167
- if (context.filesList.includes(file)) {
167
+ if (context.filesList.includes(`/${file}`)) {
168
168
  // maybe it is with regex
169
169
  const check = rules.some(rule => {
170
170
  if (typeof rule === 'string') {
package/lib/common.js CHANGED
@@ -130,6 +130,21 @@ async function getFilesList(context) {
130
130
  }
131
131
  } catch (e) {
132
132
  error(`Cannot download ${url} ${e}`);
133
+ info(`will retry using github api`);
134
+
135
+ const url2 = `https://api.github.com/repos/${context.repository}/git/trees/${context.lastCommitSha}?recursive=1`;
136
+ debug(`Download ${url} [RETRY]`);
137
+ try {
138
+ const response = await axios(url2);
139
+ debug(`download succeded [RETRY]`);
140
+ console.log(JSON.stringify(response.data));
141
+ if (response.data?.tree) {
142
+ response.data.tree.forEach(fileInfo => filesList.push(fileInfo.path));
143
+ }
144
+ } catch (e) {
145
+ error(`Cannot download ${url} ${e}`);
146
+ throw 'Cannot download files listing.'; // ABORT
147
+ }
133
148
  }
134
149
 
135
150
  debug('Files detected at repository:');
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.0-alpha.1",
2
+ "version": "4.0.0-alpha.3",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.8.4",