Skip to content

Commit

Permalink
Update dependencies in typescript code and fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
verdel committed Nov 29, 2023
1 parent f66fd72 commit baace19
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 63 deletions.
34 changes: 13 additions & 21 deletions e2e-tests/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Use fork until https://github.com/piyush-bhatt/deno-port/pull/1 is merged
import { getAvailablePort } from "https://raw.githubusercontent.com/Nitive/deno-port/fix-getting-random-port/mod.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import {
assertEquals,
assertStringIncludes,
} from "https://deno.land/[email protected]/testing/asserts.ts"
} from "https://deno.land/[email protected]/testing/asserts.ts"
import * as yaml from "https://deno.land/[email protected]/yaml/mod.ts"
import { getAvailablePort } from "https://raw.githubusercontent.com/Nitive/deno-port/fix-getting-random-port/mod.ts"
import { ignoreNotFoundError } from "../src/utils/ignore-not-found-error.ts"
import { waitForProcess } from "../src/utils/process.ts"

Expand Down Expand Up @@ -635,8 +635,7 @@ Deno.test({
})

Deno.test({
name:
"should clean deno-bundle.js and helm package if push wasn't successful",
name: "should clean deno-bundle.js and helm package if push wasn't successful",
ignore: !runAllTests,
async fn() {
const chartPath = path.join(chartsBin, "one-service")
Expand Down Expand Up @@ -702,8 +701,7 @@ Deno.test({
})

Deno.test({
name:
"should use deno-bundle.js if `--deno-bundle prefer` have been passed and deno-bundle.js exists",
name: "should use deno-bundle.js if `--deno-bundle prefer` have been passed and deno-bundle.js exists",
async fn() {
const chartPath = path.join(chartsBin, "prebundled")

Expand All @@ -730,8 +728,7 @@ Deno.test({
})

Deno.test({
name:
"should use deno-templates/index.ts if `--deno-bundle ignore` have been passed",
name: "should use deno-templates/index.ts if `--deno-bundle ignore` have been passed",
async fn() {
const chartPath = path.join(chartsBin, "prebundled")

Expand All @@ -758,8 +755,7 @@ Deno.test({
})

Deno.test({
name:
"should use deno-templates/index.ts if --deno-bundle have not been passed",
name: "should use deno-templates/index.ts if --deno-bundle have not been passed",
async fn() {
const chartPath = path.join(chartsBin, "prebundled")

Expand All @@ -784,8 +780,7 @@ Deno.test({
})

Deno.test({
name:
"should throw error if `--deno-bundle require` have been passed but deno-bundle.js do not exist",
name: "should throw error if `--deno-bundle require` have been passed but deno-bundle.js do not exist",
async fn() {
const chartPath = path.join(chartsBin, "one-service")

Expand All @@ -803,8 +798,7 @@ Deno.test({
})

Deno.test({
name:
"should not throw error if `--deno-bundle prefer` have been passed and deno-bundle.js do not exist",
name: "should not throw error if `--deno-bundle prefer` have been passed and deno-bundle.js do not exist",
async fn() {
const chartPath = path.join(chartsBin, "one-service")

Expand Down Expand Up @@ -890,8 +884,7 @@ Deno.test({
})

Deno.test({
name:
"should successfuly run `helm deno template` with remote deno chart (with --repo option)",
name: "should successfuly run `helm deno template` with remote deno chart (with --repo option)",
ignore: !runAllTests,
async fn() {
const { status, stdout, stderr } = await runHelmDeno([
Expand Down Expand Up @@ -932,8 +925,7 @@ async function addStableRepo() {
}

Deno.test({
name:
"should successfuly run `helm deno template` with remote chart (with helm repo add)",
name: "should successfuly run `helm deno template` with remote chart (with helm repo add)",
ignore: !runAllTests,
async fn() {
const tmpRepo = await addStableRepo()
Expand Down
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.107.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseArgs } from "../parse-helm-deno-args.ts"

Deno.test("Should parse --deno-* flags", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-helm-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseHelmArgs } from "../parse-helm-args.ts"

Deno.test("Should parse helm template args for `helm upgrade`", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-helm-fetch-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.107.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseHelmFetchArgs } from "../parse-helm-fetch-args.ts"

Deno.test("Should parse helm fetch args", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-helm-template-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.107.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseHelmTemplateArgs } from "../parse-helm-template-args.ts"

Deno.test("Should parse helm template args", () => {
Expand Down
4 changes: 1 addition & 3 deletions src/args/parse-helm-args.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export const supportedCommands = ["upgrade", "template", "install"]

export function parseHelmArgs(
args: readonly string[]
): {
export function parseHelmArgs(args: readonly string[]): {
readonly command: readonly string[]
readonly releaseName: string
readonly chartLocation: string
Expand Down
4 changes: 2 additions & 2 deletions src/args/parse-helm-deno-args.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import args from "https://deno.land/x/[email protected]/wrapper.ts"
import {
PartialOption,
BinaryFlag,
PartialOption,
} from "https://deno.land/x/[email protected]/flag-types.ts"
import { Choice, Text } from "https://deno.land/x/[email protected]/value-types.ts"
import args from "https://deno.land/x/[email protected]/wrapper.ts"

type LogLevel = "info" | "debug"

Expand Down
4 changes: 2 additions & 2 deletions src/args/parse-helm-fetch-args.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import args from "https://deno.land/x/[email protected]/wrapper.ts"
import {
PartialOption,
BinaryFlag,
PartialOption,
} from "https://deno.land/x/[email protected]/flag-types.ts"
import { Text } from "https://deno.land/x/[email protected]/value-types.ts"
import args from "https://deno.land/x/[email protected]/wrapper.ts"

const textOption = (flag: string) =>
PartialOption(flag, {
Expand Down
2 changes: 1 addition & 1 deletion src/args/parse-helm-template-args.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import args from "https://deno.land/x/[email protected]/wrapper.ts"
import { CollectOption } from "https://deno.land/x/[email protected]/flag-types.ts"
import { Text } from "https://deno.land/x/[email protected]/value-types.ts"
import args from "https://deno.land/x/[email protected]/wrapper.ts"

const textOption = (flag: string, alias?: readonly string[]) =>
CollectOption(flag, {
Expand Down
19 changes: 7 additions & 12 deletions src/deno/render-chart.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ChartContext } from "../std/mod.ts"
import { ensureDir } from "https://deno.land/[email protected]/fs/ensure_dir.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/yaml/mod.ts"
import type { HelmDenoOptions } from "../args/parse-helm-deno-args.ts"
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import { ensureDir } from "https://deno.land/[email protected]/fs/ensure_dir.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import type { ChartContext } from "../std/mod.ts"
import { ignoreNotFoundError } from "../utils/ignore-not-found-error.ts"
import { waitForProcess } from "../utils/process.ts"

Expand Down Expand Up @@ -106,13 +106,8 @@ export async function renderDenoChart(
chartPath: string,
denoOptions: HelmDenoOptions
): Promise<{ debug: string } | undefined> {
const {
deno,
importer,
templateFolderPath,
bundlePath,
indexFilePath,
} = getPaths(chartPath)
const { deno, importer, templateFolderPath, bundlePath, indexFilePath } =
getPaths(chartPath)
await ensureDir(templateFolderPath)

const isDenoChart =
Expand Down
10 changes: 5 additions & 5 deletions src/helm/chart-utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import { copy } from "https://deno.land/[email protected]/fs/copy.ts"
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import { Chart } from "./chart-types.ts"
import { copy } from "https://deno.land/[email protected]/fs/copy.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/yaml/mod.ts"
import { withErrorMsg } from "../std/mod.ts"
import { ignoreNotFoundError } from "../utils/ignore-not-found-error.ts"
import { Chart } from "./chart-types.ts"

export async function copyChart(chartPath: string, destination: string) {
const destinationExists = await exists(chartPath)
Expand Down
8 changes: 4 additions & 4 deletions src/helm/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { exists } from "https://deno.land/std@0.160.0/fs/exists.ts"
import { copy } from "https://deno.land/std@0.160.0/fs/copy.ts"
import { expandGlob } from "https://deno.land/std@0.160.0/fs/expand_glob.ts"
import * as path from "https://deno.land/std@0.160.0/path/mod.ts"
import { copy } from "https://deno.land/std@0.208.0/fs/copy.ts"
import { exists } from "https://deno.land/std@0.208.0/fs/exists.ts"
import { expandGlob } from "https://deno.land/std@0.208.0/fs/expand_glob.ts"
import * as path from "https://deno.land/std@0.208.0/path/mod.ts"
import { parseHelmFetchArgs } from "../args/parse-helm-fetch-args.ts"
import { withErrorMsg } from "../std/mod.ts"
import { waitForProcess } from "../utils/process.ts"
Expand Down
10 changes: 5 additions & 5 deletions src/helm/get-chart-context.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ChartContext, Release } from "../std/mod.ts"
import { copy } from "https://deno.land/[email protected]/fs/copy.ts"
import { ensureDir } from "https://deno.land/[email protected]/fs/ensure_dir.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts"
import { copy } from "https://deno.land/[email protected]/fs/copy.ts"
import { ensureDir } from "https://deno.land/[email protected]/fs/ensure_dir.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/yaml/mod.ts"
import { parseHelmTemplateArgs } from "../args/parse-helm-template-args.ts"
import type { ChartContext, Release } from "../std/mod.ts"
import { ignoreNotFoundError } from "../utils/ignore-not-found-error.ts"
import { waitForProcess } from "../utils/process.ts"

Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// deno-lint-ignore-file
import * as path from "https://deno.land/std@0.160.0/path/mod.ts"
import * as path from "https://deno.land/std@0.208.0/path/mod.ts"
import { parseHelmArgs, supportedCommands } from "./args/parse-helm-args.ts"
import { parseArgs } from "./args/parse-helm-deno-args.ts"
import {
Expand All @@ -8,16 +8,16 @@ import {
renderDenoChart,
} from "./deno/render-chart.ts"
import {
cleanupChartPackage,
copyChart,
isChartExist,
getChartPackagePath,
cleanupChartPackage,
isChartExist,
} from "./helm/chart-utils.ts"
import { helmExecute } from "./helm/execute.ts"
import { fetchChart } from "./helm/fetch.ts"
import { getChartContext } from "./helm/get-chart-context.ts"
import { ignoreNotFoundError } from "./utils/ignore-not-found-error.ts"
import { withErrorMsg } from "./std/mod.ts"
import { ignoreNotFoundError } from "./utils/ignore-not-found-error.ts"

function helmDenoUsage() {
const pluginUsage = `\
Expand Down

0 comments on commit baace19

Please sign in to comment.