From 26fb33c66e8cf57978e5a8a555238f33630a22a5 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sun, 27 Aug 2023 20:05:56 +0000 Subject: [PATCH] feat: load pipelines from `jsdelivr` cdn instead of `deno.land/x` --- README.md | 2 +- aws.ts | 4 ++-- azure.ts | 4 ++-- cache.ts | 4 ++-- circleci.ts | 4 ++-- docs.ts | 6 +++++- github.ts | 4 ++-- gitlab.ts | 4 ++-- list.ts | 4 ++-- main.ts | 2 +- run.ts | 4 ++-- 11 files changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 5ce97af..adc0286 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ fluentci # Run the pipeline fluentci --help Usage: fluentci [pipeline] [jobs...] -Version: 0.4.10 +Version: 0.5.0 Description: diff --git a/aws.ts b/aws.ts index c9b88af..de21b18 100644 --- a/aws.ts +++ b/aws.ts @@ -59,8 +59,8 @@ async function generateAWSCodePipelineConfig( } let denoModule = [ - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/aws/init.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/aws/init.ts`, ]; if (reload) { diff --git a/azure.ts b/azure.ts index 4f78b12..62e225f 100644 --- a/azure.ts +++ b/azure.ts @@ -56,8 +56,8 @@ async function generateAzurePipelinesConfig(pipeline?: string, reload = false) { } let denoModule = [ - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/azure/init.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/azure/init.ts`, ]; if (reload) { diff --git a/cache.ts b/cache.ts index ac4439c..292af2d 100644 --- a/cache.ts +++ b/cache.ts @@ -21,8 +21,8 @@ async function cache(pipeline: string) { const command = new Deno.Command(Deno.execPath(), { args: [ "cache", - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/dagger/list_jobs.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/dagger/list_jobs.ts`, ], stderr: "inherit", stdout: "inherit", diff --git a/circleci.ts b/circleci.ts index e94db8b..a59904f 100644 --- a/circleci.ts +++ b/circleci.ts @@ -58,8 +58,8 @@ async function generateCircleCIConfig(pipeline?: string, reload = false) { } let denoModule = [ - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/circleci/init.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/circleci/init.ts`, ]; if (reload) { diff --git a/docs.ts b/docs.ts index 99e997a..86f2042 100644 --- a/docs.ts +++ b/docs.ts @@ -51,7 +51,11 @@ async function docs( } const command = new Deno.Command("glow", { - args: [`https://deno.land/x/${pipeline}/${buildREADMEPath(options)}`], + args: [ + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${ + data.version + }/${buildREADMEPath(options)}`, + ], stdout: "inherit", stderr: "inherit", }); diff --git a/github.ts b/github.ts index 7a176cf..d28db8f 100644 --- a/github.ts +++ b/github.ts @@ -58,8 +58,8 @@ async function generateWorkflow(pipeline?: string, reload = false) { } let denoModule = [ - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/github/init.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/github/init.ts`, ]; if (reload) { diff --git a/gitlab.ts b/gitlab.ts index ddcc117..b38fea0 100644 --- a/gitlab.ts +++ b/gitlab.ts @@ -56,8 +56,8 @@ async function generateGitlabCIConfig(pipeline?: string, reload = false) { } let denoModule = [ - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/gitlab/init.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/gitlab/init.ts`, ]; if (reload) { diff --git a/list.ts b/list.ts index bf97cb0..c675273 100644 --- a/list.ts +++ b/list.ts @@ -53,8 +53,8 @@ async function listJobs(pipeline = ".") { args: [ "run", "-A", - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/dagger/list_jobs.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/dagger/list_jobs.ts`, ], }); diff --git a/main.ts b/main.ts index c3bbad8..fac8ac4 100644 --- a/main.ts +++ b/main.ts @@ -15,7 +15,7 @@ import cache from "./cache.ts"; export async function main() { await new Command() .name("fluentci") - .version("0.4.10") + .version("0.5.0") .description( ` . diff --git a/run.ts b/run.ts index 6f42feb..58490f4 100644 --- a/run.ts +++ b/run.ts @@ -71,8 +71,8 @@ async function run( } let denoModule = [ - `--import-map=https://deno.land/x/${pipeline}/import_map.json`, - `https://deno.land/x/${pipeline}/src/dagger/runner.ts`, + `--import-map=https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/import_map.json`, + `https://cdn.jsdelivr.net/gh/${data.repo_name}@${data.version}/src/dagger/runner.ts`, ...jobs, ];