skuba 14.0.0-test-private-templates-20260103062459 → 14.0.0-test-private-templates-20260107032914

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.
@@ -33,9 +33,7 @@ __export(git_exports, {
33
33
  initialiseRepo: () => initialiseRepo
34
34
  });
35
35
  module.exports = __toCommonJS(git_exports);
36
- var import_child_process = require("child_process");
37
36
  var import_path = __toESM(require("path"));
38
- var import_util = require("util");
39
37
  var import_fs_extra = __toESM(require("fs-extra"));
40
38
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
41
39
  var import_simple_git = require("simple-git");
@@ -70,7 +68,6 @@ const downloadGitHubTemplate = async (gitHubPath, destinationDir) => {
70
68
  recursive: true
71
69
  });
72
70
  };
73
- const execAsync = (0, import_util.promisify)(import_child_process.exec);
74
71
  const downloadPrivateTemplate = async (templateName, destinationDir) => {
75
72
  import_logging.log.newline();
76
73
  import_logging.log.plain(
@@ -82,13 +79,16 @@ const downloadPrivateTemplate = async (templateName, destinationDir) => {
82
79
  const folderPath = `templates/${templateName}`;
83
80
  const tempDir = `${destinationDir}_temp`;
84
81
  try {
85
- await execAsync(`
86
- git init ${tempDir} &&
87
- git -C ${tempDir} config core.sparseCheckout true &&
88
- echo "${folderPath}/*" >> ${tempDir}/.git/info/sparse-checkout &&
89
- git -C ${tempDir} remote add origin ${repoUrl} &&
90
- git -C ${tempDir} pull origin main --depth 1 --quiet
91
- `);
82
+ await (0, import_simple_git.simpleGit)().raw(["init", tempDir]);
83
+ const sparseCheckoutPath = import_path.default.join(
84
+ tempDir,
85
+ ".git",
86
+ "info",
87
+ "sparse-checkout"
88
+ );
89
+ await import_fs_extra.default.promises.writeFile(sparseCheckoutPath, `${folderPath}/*
90
+ `);
91
+ await (0, import_simple_git.simpleGit)(tempDir).raw(["config", "core.sparseCheckout", "true"]).addRemote("origin", repoUrl).raw(["pull", "origin", "main", "--depth", "1", "--quiet"]);
92
92
  const templatePath = import_path.default.join(tempDir, folderPath);
93
93
  try {
94
94
  await import_fs_extra.default.promises.access(templatePath);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/git.ts"],
4
- "sourcesContent": ["import { exec } from 'child_process';\nimport path from 'path';\nimport { promisify } from 'util';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport { simpleGit } from 'simple-git';\n\nimport { log } from '../../utils/logging.js';\n\nimport * as Git from '@skuba-lib/api/git';\n\ninterface GitHubProject {\n orgName: string;\n repoName: string;\n defaultBranch: string;\n}\n\nexport const initialiseRepo = async (\n dir: string,\n { orgName, repoName, defaultBranch }: GitHubProject,\n) => {\n await git.init({\n defaultBranch,\n dir,\n fs,\n });\n\n await Git.commit({\n dir,\n message: 'Initial commit',\n });\n\n await git.addRemote({\n dir,\n fs,\n remote: 'origin',\n url: `git@github.com:${orgName}/${repoName}.git`,\n });\n};\n\nexport const downloadGitHubTemplate = async (\n gitHubPath: string,\n destinationDir: string,\n) => {\n log.newline();\n log.plain('Downloading', log.bold(gitHubPath), 'from GitHub...');\n\n await simpleGit().clone(`git@github.com:${gitHubPath}.git`, destinationDir, [\n '--depth=1',\n '--quiet',\n ]);\n\n await fs.promises.rm(path.join(destinationDir, '.git'), {\n force: true,\n recursive: true,\n });\n};\n\nconst execAsync = promisify(exec);\n\nexport const downloadPrivateTemplate = async (\n templateName: string,\n destinationDir: string,\n) => {\n log.newline();\n log.plain(\n 'Downloading',\n log.bold(templateName),\n 'from SEEK-Jobs/skuba-templates',\n );\n\n const repoUrl = 'git@github.com:SEEK-Jobs/skuba-templates.git';\n const folderPath = `templates/${templateName}`;\n const tempDir = `${destinationDir}_temp`;\n\n try {\n await execAsync(`\n git init ${tempDir} &&\n git -C ${tempDir} config core.sparseCheckout true &&\n echo \"${folderPath}/*\" >> ${tempDir}/.git/info/sparse-checkout &&\n git -C ${tempDir} remote add origin ${repoUrl} &&\n git -C ${tempDir} pull origin main --depth 1 --quiet\n `);\n\n const templatePath = path.join(tempDir, folderPath);\n\n try {\n await fs.promises.access(templatePath);\n } catch {\n throw new Error(`Template \"${templateName}\" not found in repository`);\n }\n\n await fs.ensureDir(destinationDir);\n await fs.copy(templatePath, destinationDir);\n\n await fs.promises.rm(tempDir, { force: true, recursive: true });\n } catch (error) {\n await fs.promises.rm(tempDir, { force: true, recursive: true });\n throw error;\n }\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAqB;AACrB,kBAAiB;AACjB,kBAA0B;AAE1B,sBAAe;AACf,4BAAgB;AAChB,wBAA0B;AAE1B,qBAAoB;AAEpB,UAAqB;AAQd,MAAM,iBAAiB,OAC5B,KACA,EAAE,SAAS,UAAU,cAAc,MAChC;AACH,QAAM,sBAAAA,QAAI,KAAK;AAAA,IACb;AAAA,IACA;AAAA,IACA,oBAAAC;AAAA,EACF,CAAC;AAED,QAAM,IAAI,OAAO;AAAA,IACf;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AAED,QAAM,sBAAAD,QAAI,UAAU;AAAA,IAClB;AAAA,IACA,oBAAAC;AAAA,IACA,QAAQ;AAAA,IACR,KAAK,kBAAkB,OAAO,IAAI,QAAQ;AAAA,EAC5C,CAAC;AACH;AAEO,MAAM,yBAAyB,OACpC,YACA,mBACG;AACH,qBAAI,QAAQ;AACZ,qBAAI,MAAM,eAAe,mBAAI,KAAK,UAAU,GAAG,gBAAgB;AAE/D,YAAM,6BAAU,EAAE,MAAM,kBAAkB,UAAU,QAAQ,gBAAgB;AAAA,IAC1E;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,gBAAAA,QAAG,SAAS,GAAG,YAAAC,QAAK,KAAK,gBAAgB,MAAM,GAAG;AAAA,IACtD,OAAO;AAAA,IACP,WAAW;AAAA,EACb,CAAC;AACH;AAEA,MAAM,gBAAY,uBAAU,yBAAI;AAEzB,MAAM,0BAA0B,OACrC,cACA,mBACG;AACH,qBAAI,QAAQ;AACZ,qBAAI;AAAA,IACF;AAAA,IACA,mBAAI,KAAK,YAAY;AAAA,IACrB;AAAA,EACF;AAEA,QAAM,UAAU;AAChB,QAAM,aAAa,aAAa,YAAY;AAC5C,QAAM,UAAU,GAAG,cAAc;AAEjC,MAAI;AACF,UAAM,UAAU;AAAA,iBACH,OAAO;AAAA,eACT,OAAO;AAAA,cACR,UAAU,UAAU,OAAO;AAAA,eAC1B,OAAO,sBAAsB,OAAO;AAAA,eACpC,OAAO;AAAA,KACjB;AAED,UAAM,eAAe,YAAAA,QAAK,KAAK,SAAS,UAAU;AAElD,QAAI;AACF,YAAM,gBAAAD,QAAG,SAAS,OAAO,YAAY;AAAA,IACvC,QAAQ;AACN,YAAM,IAAI,MAAM,aAAa,YAAY,2BAA2B;AAAA,IACtE;AAEA,UAAM,gBAAAA,QAAG,UAAU,cAAc;AACjC,UAAM,gBAAAA,QAAG,KAAK,cAAc,cAAc;AAE1C,UAAM,gBAAAA,QAAG,SAAS,GAAG,SAAS,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EAChE,SAAS,OAAO;AACd,UAAM,gBAAAA,QAAG,SAAS,GAAG,SAAS,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAC9D,UAAM;AAAA,EACR;AACF;",
4
+ "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport { simpleGit } from 'simple-git';\n\nimport { log } from '../../utils/logging.js';\n\nimport * as Git from '@skuba-lib/api/git';\n\ninterface GitHubProject {\n orgName: string;\n repoName: string;\n defaultBranch: string;\n}\n\nexport const initialiseRepo = async (\n dir: string,\n { orgName, repoName, defaultBranch }: GitHubProject,\n) => {\n await git.init({\n defaultBranch,\n dir,\n fs,\n });\n\n await Git.commit({\n dir,\n message: 'Initial commit',\n });\n\n await git.addRemote({\n dir,\n fs,\n remote: 'origin',\n url: `git@github.com:${orgName}/${repoName}.git`,\n });\n};\n\nexport const downloadGitHubTemplate = async (\n gitHubPath: string,\n destinationDir: string,\n) => {\n log.newline();\n log.plain('Downloading', log.bold(gitHubPath), 'from GitHub...');\n\n await simpleGit().clone(`git@github.com:${gitHubPath}.git`, destinationDir, [\n '--depth=1',\n '--quiet',\n ]);\n\n await fs.promises.rm(path.join(destinationDir, '.git'), {\n force: true,\n recursive: true,\n });\n};\n\nexport const downloadPrivateTemplate = async (\n templateName: string,\n destinationDir: string,\n) => {\n log.newline();\n log.plain(\n 'Downloading',\n log.bold(templateName),\n 'from SEEK-Jobs/skuba-templates',\n );\n\n const repoUrl = 'git@github.com:SEEK-Jobs/skuba-templates.git';\n const folderPath = `templates/${templateName}`;\n const tempDir = `${destinationDir}_temp`;\n\n try {\n await simpleGit().raw(['init', tempDir]);\n\n const sparseCheckoutPath = path.join(\n tempDir,\n '.git',\n 'info',\n 'sparse-checkout',\n );\n await fs.promises.writeFile(sparseCheckoutPath, `${folderPath}/*\\n`);\n\n await simpleGit(tempDir)\n .raw(['config', 'core.sparseCheckout', 'true'])\n .addRemote('origin', repoUrl)\n .raw(['pull', 'origin', 'main', '--depth', '1', '--quiet']);\n\n const templatePath = path.join(tempDir, folderPath);\n\n try {\n await fs.promises.access(templatePath);\n } catch {\n throw new Error(`Template \"${templateName}\" not found in repository`);\n }\n\n await fs.ensureDir(destinationDir);\n await fs.copy(templatePath, destinationDir);\n\n await fs.promises.rm(tempDir, { force: true, recursive: true });\n } catch (error) {\n await fs.promises.rm(tempDir, { force: true, recursive: true });\n throw error;\n }\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAChB,wBAA0B;AAE1B,qBAAoB;AAEpB,UAAqB;AAQd,MAAM,iBAAiB,OAC5B,KACA,EAAE,SAAS,UAAU,cAAc,MAChC;AACH,QAAM,sBAAAA,QAAI,KAAK;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E5D,UAAM,eAAe,YAAAC,QAAK,KAAK,SAAS,UAAU;AAElD,QAAI;AACF,YAAM,gBAAAD,QAAG,SAAS,OAAO,YAAY;AAAA,IACvC,QAAQ;AACN,YAAM,IAAI,MAAM,aAAa,YAAY,2BAA2B;AAAA,IACtE;AAEA,UAAM,gBAAAA,QAAG,UAAU,cAAc;AACjC,UAAM,gBAAAA,QAAG,KAAK,cAAc,cAAc;AAE1C,UAAM,gBAAAA,QAAG,SAAS,GAAG,SAAS,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EAChE,SAAS,OAAO;AACd,UAAM,gBAAAA,QAAG,SAAS,GAAG,SAAS,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAC9D,UAAM;AAAA,EACR;AACF;",
6
6
  "names": ["git", "fs", "path"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skuba",
3
- "version": "14.0.0-test-private-templates-20260103062459",
3
+ "version": "14.0.0-test-private-templates-20260107032914",
4
4
  "private": false,
5
5
  "description": "SEEK development toolkit for backend applications and packages",
6
6
  "homepage": "https://github.com/seek-oss/skuba#readme",
@@ -102,8 +102,8 @@
102
102
  "tsx": "^4.21.0",
103
103
  "typescript": "~5.9.0",
104
104
  "zod": "^4.0.0",
105
- "@skuba-lib/api": "^2.0.0-test-private-templates-20260103062459",
106
- "eslint-config-skuba": "8.0.0-test-private-templates-20260103062459"
105
+ "@skuba-lib/api": "^2.0.0-test-private-templates-20260107032914",
106
+ "eslint-config-skuba": "8.0.0-test-private-templates-20260107032914"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@changesets/cli": "2.29.8",
@@ -19,11 +19,11 @@
19
19
  "test:watch": "skuba test --watch"
20
20
  },
21
21
  "dependencies": {
22
- "skuba-dive": "4.0.0-test-private-templates-20260103062459"
22
+ "skuba-dive": "4.0.0-test-private-templates-20260107032914"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.13.10",
26
- "skuba": "14.0.0-test-private-templates-20260103062459"
26
+ "skuba": "14.0.0-test-private-templates-20260107032914"
27
27
  },
28
28
  "packageManager": "pnpm@10.26.2",
29
29
  "engines": {
@@ -24,7 +24,7 @@
24
24
  "@aws-sdk/client-sns": "^3.363.0",
25
25
  "@seek/aws-codedeploy-hooks": "^2.0.0",
26
26
  "@seek/logger": "^11.1.0",
27
- "skuba-dive": "4.0.0-test-private-templates-20260103062459",
27
+ "skuba-dive": "4.0.0-test-private-templates-20260107032914",
28
28
  "zod": "^4.0.0"
29
29
  },
30
30
  "devDependencies": {
@@ -42,7 +42,7 @@
42
42
  "datadog-lambda-js": "^12.0.0",
43
43
  "dd-trace": "^5.0.0",
44
44
  "pino-pretty": "^13.0.0",
45
- "skuba": "14.0.0-test-private-templates-20260103062459"
45
+ "skuba": "14.0.0-test-private-templates-20260107032914"
46
46
  },
47
47
  "packageManager": "pnpm@10.26.2",
48
48
  "engines": {