Skip to content

feat(pack): support buildpacks extensions, install pack if missing #354

feat(pack): support buildpacks extensions, install pack if missing

feat(pack): support buildpacks extensions, install pack if missing #354

GitHub Actions / Lint failed Dec 23, 2024 in 0s

Errors 219, Warnings 9

Found 219 errors and 9 warnings

Annotations

Check failure on line 58 in code/code-format/src/formatter.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/ban-ts-comment): Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 10 characters or longer.

Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 10 characters or longer.
Raw output
  55 |         ...config,
  56 |         filepath: filename,
> 57 |         // @ts-expect-error any
     |         ^
  58 |         plugins: [estree, yaml, markdown, graphql, babel, typescript, plugin],
  59 |       })
  60 |

Check failure on line 128 in code/code-lint/src/linter.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/array-type): Array type using 'ESLint.LintResult[]' is forbidden. Use 'Array<ESLint.LintResult>' instead.

Array type using 'ESLint.LintResult[]' is forbidden. Use 'Array<ESLint.LintResult>' instead.
Raw output
  125 |   }
  126 |
> 127 |   private async lintWithCache(files: Array<string> = []): Promise<ESLint.LintResult[]> {
      |                                                                   ^
  128 |     this.emit('start', { files })
  129 |
  130 |     const results = await this.cacheLinter?.lintFiles(files)

Check failure on line 143 in code/code-lint/src/linter.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(n/no-sync): Unexpected sync method: 'readFileSync'.

Unexpected sync method: 'readFileSync'.
Raw output
  140 |
  141 |   private getProjectIgnorePatterns(): Array<string> {
> 142 |     const content = readFileSync(join(this.cwd, 'package.json'), 'utf-8')
      |                     ^
  143 |
  144 |     const { linterIgnorePatterns = [] } = JSON.parse(content)
  145 |

Check failure on line 147 in code/code-lint/src/linter.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-return): Unsafe return of a value of type `any`.

Unsafe return of a value of type `any`.
Raw output
  144 |     const { linterIgnorePatterns = [] } = JSON.parse(content)
  145 |
> 146 |     return linterIgnorePatterns
      |     ^
  147 |   }
  148 | }
  149 |

Check failure on line 4 in code/code-pack/src/index.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-type-exports): All exports in the declaration are only used as types. Use `export type`.

All exports in the declaration are only used as types. Use `export type`.
Raw output
  1 | import * as tagUtils from './tag.utils.js'
  2 |
> 3 | export * from './pack.interfaces.js'
    | ^
  4 | export * from './tag.utils.js'
  5 | export * from './pack.js'
  6 |

Check failure on line 2 in code/code-pack/src/pack.interfaces.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.

All imports in the declaration are only used as types. Use `import type`.
Raw output
> 1 | import { PortablePath } from '@yarnpkg/fslib'
    | ^
  2 |
  3 | export interface PackOptions {
  4 |   workspace: string

Check warning on line 74 in code/code-pack/src/pack.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  71 |   await xfs.writeFilePromise(descriptorPath, stringify(descriptor))
  72 |
> 73 |   console.debug('project.toml', readFileSync(descriptorPath, 'utf8'))
     |   ^
  74 |
  75 |   const args = [
  76 |     'build',

Check failure on line 74 in code/code-pack/src/pack.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(n/no-sync): Unexpected sync method: 'readFileSync'.

Unexpected sync method: 'readFileSync'.
Raw output
  71 |   await xfs.writeFilePromise(descriptorPath, stringify(descriptor))
  72 |
> 73 |   console.debug('project.toml', readFileSync(descriptorPath, 'utf8'))
     |                                 ^
  74 |
  75 |   const args = [
  76 |     'build',

Check warning on line 100 in code/code-pack/src/pack.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
   97 |   }
   98 |
>  99 |   console.debug(`Packing with args:`, args)
      |   ^
  100 |
  101 |   await installPack({ cwd, context })
  102 |

Check failure on line 5 in code/code-pack/src/pack.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/consistent-type-imports): All imports in the declaration are only used as types. Use `import type`.

All imports in the declaration are only used as types. Use `import type`.
Raw output
  2 | import { arch }         from 'node:os'
  3 |
> 4 | import { PortablePath } from '@yarnpkg/fslib'
    | ^
  5 | import { execUtils }    from '@yarnpkg/core'
  6 |
  7 | interface InstallPackOptions {

Check failure on line 9 in code/code-pack/src/pack.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
   6 |
   7 | interface InstallPackOptions {
>  8 |   context: any
     |            ^
   9 |   cwd?: PortablePath
  10 | }
  11 |

Check warning on line 37 in code/code-pack/src/pack.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  34 |
  35 |   if (!isPackInstalled) {
> 36 |     console.log('Buildpack CLI (pack) is not installed. Installing it...')
     |     ^
  37 |
  38 |     let downloadUrl = 'https://github.com/buildpacks/pack/releases/download/v0.36.1/pack-v0.36.1-'
  39 |

Check failure on line 44 in code/code-pack/src/pack.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(default-case): Expected a default case.

Expected a default case.
Raw output
  41 |     const currentArch = arch()
  42 |
> 43 |     switch (currentPlatform) {
     |     ^
  44 |       case 'linux':
  45 |         downloadUrl += 'linux.tgz'
  46 |         break

Check failure on line 57 in code/code-pack/src/pack.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-empty): Empty block statement.

Empty block statement.
Raw output
  54 |     }
  55 |
> 56 |     if (currentPlatform === 'linux') {
     |                                      ^
  57 |     }
  58 |
  59 |     await execUtils.pipevp(

Check warning on line 73 in code/code-pack/src/pack.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  70 |     )
  71 |
> 72 |     console.log('Buildpack CLI (pack) has been installed.')
     |     ^
  73 |   }
  74 | }
  75 |

Check failure on line 16 in code/code-pack/src/tag.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-non-null-assertion): Forbidden non-null assertion.

Forbidden non-null assertion.
Raw output
  13 |     (event.after as string) ||
  14 |     (event.pull_request?.head?.sha as string) ||
> 15 |     process.env.GITHUB_SHA!
     |     ^
  16 |   )
  17 | }
  18 |

Check failure on line 57 in code/code-pack/src/tag.utils.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-deprecated): `substr` is deprecated. A legacy feature for browser compatibility

`substr` is deprecated. A legacy feature for browser compatibility
Raw output
  54 | export const getTag = async (tagPolicy: TagPolicy): Promise<string> => {
  55 |   const revision = await getRevision()
> 56 |   const hash = revision.substr(0, 7)
     |                         ^
  57 |
  58 |   if (tagPolicy === 'hash-timestamp') {
  59 |     return `${hash}-${Date.now()}`

Check failure on line 16 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/ban-ts-comment): Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 10 characters or longer.

Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 10 characters or longer.
Raw output
  13 | import { SchematicMissingFieldsException }         from '@angular-devkit/schematics/tools'
  14 | import { NodePackageDoesNotSupportSchematics }     from '@angular-devkit/schematics/tools'
> 15 | // @ts-expect-error any
     | ^
  16 | import { readJsonFile }                            from '@angular-devkit/schematics/tools/file-system-utility'
  17 |
  18 | // TODO: refactor

Check warning on line 55 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(security/detect-non-literal-require): Found non-literal argument in require

Found non-literal argument in require
Raw output
  52 |       const packageJsonPath = require.resolve(join(name, 'package.json'), resolveOptions)
  53 |
> 54 |       const { schematics } = require(packageJsonPath)
     |                              ^
  55 |
  56 |       if (!schematics || typeof schematics !== 'string') {
  57 |         throw new NodePackageDoesNotSupportSchematics(name)

Check failure on line 55 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-require-imports): A `require()` style import is forbidden.

A `require()` style import is forbidden.
Raw output
  52 |       const packageJsonPath = require.resolve(join(name, 'package.json'), resolveOptions)
  53 |
> 54 |       const { schematics } = require(packageJsonPath)
     |                              ^
  55 |
  56 |       if (!schematics || typeof schematics !== 'string') {
  57 |         throw new NodePackageDoesNotSupportSchematics(name)

Check failure on line 55 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-var-requires): Require statement not part of import statement.

Require statement not part of import statement.
Raw output
  52 |       const packageJsonPath = require.resolve(join(name, 'package.json'), resolveOptions)
  53 |
> 54 |       const { schematics } = require(packageJsonPath)
     |                              ^
  55 |
  56 |       if (!schematics || typeof schematics !== 'string') {
  57 |         throw new NodePackageDoesNotSupportSchematics(name)

Check failure on line 62 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
  59 |
  60 |       collectionPath = this.resolve(schematics, packageJsonPath, references)
> 61 |     } catch (e: any) {
     |                 ^
  62 |       if (e.code !== 'MODULE_NOT_FOUND') {
  63 |         throw e
  64 |       }

Check failure on line 71 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-explicit-any): Unexpected any. Specify a different type.

Unexpected any. Specify a different type.
Raw output
  68 |       try {
  69 |         collectionPath = require.resolve(name, resolveOptions)
> 70 |       } catch (e: any) {
     |                   ^
  71 |         if (e.code !== 'MODULE_NOT_FOUND') {
  72 |           throw e
  73 |         }

Check failure on line 86 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/member-ordering): Member _resolveCollectionPath should be declared before all private instance method definitions.

Member _resolveCollectionPath should be declared before all private instance method definitions.
Raw output
  83 |
  84 |   // eslint-disable-next-line no-underscore-dangle
> 85 |   protected _resolveCollectionPath(name: string, requester?: string): string {
     |   ^
  86 |     const collectionPath = this.resolve(name, requester)
  87 |     readJsonFile(collectionPath)
  88 |

Check failure on line 88 in code/code-schematics/src/node-pnp-engine.host.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unsafe-call): Unsafe call of a(n) `error` type typed value.

Unsafe call of a(n) `error` type typed value.
Raw output
  85 |   protected _resolveCollectionPath(name: string, requester?: string): string {
  86 |     const collectionPath = this.resolve(name, requester)
> 87 |     readJsonFile(collectionPath)
     |     ^
  88 |
  89 |     return collectionPath
  90 |   }