@nshiab/setup-data-project 1.0.8 → 1.0.10

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.
@@ -1,6 +1,2 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- export declare const dntGlobalThis: Omit<typeof globalThis, "Deno"> & {
4
- Deno: typeof Deno;
5
- };
1
+ export declare const dntGlobalThis: Omit<typeof globalThis, never>;
6
2
  //# sourceMappingURL=_dnt.shims.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
1
+ {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
package/esm/_dnt.shims.js CHANGED
@@ -1,8 +1,4 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- const dntGlobals = {
4
- Deno,
5
- };
1
+ const dntGlobals = {};
6
2
  export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
7
3
  function createMergeProxy(baseObj, extObj) {
8
4
  return new Proxy(baseObj, {
@@ -1 +1 @@
1
- {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAGA,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,iBAgCjD"}
1
+ {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAGA,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,iBAmCjD"}
@@ -1,6 +1,13 @@
1
1
  import { log } from "@clack/prompts";
2
2
  import { handleFileConflict } from "./handleFileConflict.js";
3
3
  export async function ensureReadme(runtime) {
4
+ let runCommand = "npm run";
5
+ if (runtime === "deno") {
6
+ runCommand = "deno task";
7
+ }
8
+ else if (runtime === "bun") {
9
+ runCommand = "bun run";
10
+ }
4
11
  const readmeContent = `This repository has been created with
5
12
  [setup-data-project](https://github.com/nshiab/setup-data-project/).
6
13
 
@@ -18,9 +25,9 @@ Here's the recommended workflow:
18
25
 
19
26
  When working on your project, use the following command:
20
27
 
21
- - \`${runtime === "deno" ? "deno task" : "npm run"} sda\` will watch your \`sda/main.ts\` and its dependencies. Everytime
28
+ - \`${runCommand} sda\` will watch your \`sda/main.ts\` and its dependencies. Everytime
22
29
  you'll save some changes, the data will be reprocessed.
23
- - \`${runtime === "deno" ? "deno task" : "npm run"} clean\` will remove \`.sda-cache/\`, \`.journalism-cache/\` and \`.tmp/\`,
30
+ - \`${runCommand} clean\` will remove \`.sda-cache/\`, \`.journalism-cache/\` and \`.tmp/\`,
24
31
  if present.
25
32
 
26
33
  Have fun!`;
@@ -1,5 +1,5 @@
1
1
  export declare const runtimeConfig: {
2
- getRuntime: () => "deno" | "bun" | "node";
2
+ getRuntime: () => "node" | "bun" | "deno";
3
3
  };
4
- export declare function getRuntime(): "deno" | "bun" | "node";
4
+ export declare function getRuntime(): "node" | "bun" | "deno";
5
5
  //# sourceMappingURL=getRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getRuntime.d.ts","sourceRoot":"","sources":["../../src/helpers/getRuntime.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;CASzB,CAAC;AAEF,wBAAgB,UAAU,4BAEzB"}
1
+ {"version":3,"file":"getRuntime.d.ts","sourceRoot":"","sources":["../../src/helpers/getRuntime.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;CAazB,CAAC;AAEF,wBAAgB,UAAU,4BAEzB"}
@@ -2,13 +2,15 @@ import * as dntShim from "../_dnt.shims.js";
2
2
  import process from "node:process";
3
3
  export const runtimeConfig = {
4
4
  getRuntime: () => {
5
- if ("Deno" in dntShim.dntGlobalThis)
6
- return "deno";
7
- if ("Bun" in dntShim.dntGlobalThis)
8
- return "bun";
9
- if (typeof process !== "undefined" && process?.versions?.node) {
5
+ if (typeof process !== "undefined" &&
6
+ process?.versions?.node &&
7
+ !process?.versions?.deno) {
10
8
  return "node";
11
9
  }
10
+ if ("Bun" in dntShim.dntGlobalThis)
11
+ return "bun";
12
+ if ("Deno" in dntShim.dntGlobalThis)
13
+ return "deno";
12
14
  return "node";
13
15
  },
14
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"handleFileConflict.d.ts","sourceRoot":"","sources":["../../src/helpers/handleFileConflict.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,EAAE;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CAGvD,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,CAoD5C"}
1
+ {"version":3,"file":"handleFileConflict.d.ts","sourceRoot":"","sources":["../../src/helpers/handleFileConflict.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,EAAE;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CAGvD,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,CAoD5C"}
@@ -1,4 +1,3 @@
1
- import * as dntShim from "../_dnt.shims.js";
2
1
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
3
2
  import { isCancel, select } from "@clack/prompts";
4
3
  import process from "node:process";
@@ -12,7 +11,7 @@ export async function handleFileConflict(path, newContent) {
12
11
  }
13
12
  // Skip prompt in Deno tests if no override
14
13
  // @ts-ignore: Deno is not defined in type but present in runtime
15
- if (dntShim.dntGlobalThis.Deno?.args.includes("--internal-test-mode") &&
14
+ if (globalThis.Deno?.args.includes("--internal-test-mode") &&
16
15
  PROMPT_OVERRIDE.select === select) {
17
16
  return "skipped";
18
17
  }
@@ -1,6 +1,5 @@
1
- import * as childProcess from "node:child_process";
2
1
  export declare const commandRunner: {
3
- execSync: typeof childProcess.execSync;
2
+ execSync: any;
4
3
  };
5
4
  export declare function installPackagesAndFetchDocs(selectedPackages: string[], options?: {
6
5
  silent?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"installPackagesAndFetchDocs.d.ts","sourceRoot":"","sources":["../../src/helpers/installPackagesAndFetchDocs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAKnD,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAEF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2DxB"}
1
+ {"version":3,"file":"installPackagesAndFetchDocs.d.ts","sourceRoot":"","sources":["../../src/helpers/installPackagesAndFetchDocs.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAEF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2DxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nshiab/setup-data-project",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Quickly kick off your data project using the simple-data-analysis and journalism libraries.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,15 +16,14 @@
16
16
  }
17
17
  },
18
18
  "scripts": {},
19
+ "bin": {
20
+ "setup-data-project": "./esm/main.js"
21
+ },
19
22
  "publishConfig": {
20
23
  "access": "public"
21
24
  },
22
25
  "dependencies": {
23
- "@clack/prompts": "^1.3.0",
24
- "@deno/shim-deno": "~0.18.0"
25
- },
26
- "devDependencies": {
27
- "@types/node": "^20.9.0"
26
+ "@clack/prompts": "^1.3.0"
28
27
  },
29
28
  "_generatedBy": "dnt@dev"
30
29
  }
@@ -1,6 +1,2 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- export declare const dntGlobalThis: Omit<typeof globalThis, "Deno"> & {
4
- Deno: typeof Deno;
5
- };
1
+ export declare const dntGlobalThis: Omit<typeof globalThis, never>;
6
2
  //# sourceMappingURL=_dnt.shims.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
1
+ {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
@@ -1,12 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dntGlobalThis = exports.Deno = void 0;
4
- const shim_deno_1 = require("@deno/shim-deno");
5
- var shim_deno_2 = require("@deno/shim-deno");
6
- Object.defineProperty(exports, "Deno", { enumerable: true, get: function () { return shim_deno_2.Deno; } });
7
- const dntGlobals = {
8
- Deno: shim_deno_1.Deno,
9
- };
3
+ exports.dntGlobalThis = void 0;
4
+ const dntGlobals = {};
10
5
  exports.dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
11
6
  function createMergeProxy(baseObj, extObj) {
12
7
  return new Proxy(baseObj, {
@@ -1 +1 @@
1
- {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAGA,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,iBAgCjD"}
1
+ {"version":3,"file":"ensureReadme.d.ts","sourceRoot":"","sources":["../../src/helpers/ensureReadme.ts"],"names":[],"mappings":"AAGA,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,iBAmCjD"}
@@ -4,6 +4,13 @@ exports.ensureReadme = ensureReadme;
4
4
  const prompts_1 = require("@clack/prompts");
5
5
  const handleFileConflict_js_1 = require("./handleFileConflict.js");
6
6
  async function ensureReadme(runtime) {
7
+ let runCommand = "npm run";
8
+ if (runtime === "deno") {
9
+ runCommand = "deno task";
10
+ }
11
+ else if (runtime === "bun") {
12
+ runCommand = "bun run";
13
+ }
7
14
  const readmeContent = `This repository has been created with
8
15
  [setup-data-project](https://github.com/nshiab/setup-data-project/).
9
16
 
@@ -21,9 +28,9 @@ Here's the recommended workflow:
21
28
 
22
29
  When working on your project, use the following command:
23
30
 
24
- - \`${runtime === "deno" ? "deno task" : "npm run"} sda\` will watch your \`sda/main.ts\` and its dependencies. Everytime
31
+ - \`${runCommand} sda\` will watch your \`sda/main.ts\` and its dependencies. Everytime
25
32
  you'll save some changes, the data will be reprocessed.
26
- - \`${runtime === "deno" ? "deno task" : "npm run"} clean\` will remove \`.sda-cache/\`, \`.journalism-cache/\` and \`.tmp/\`,
33
+ - \`${runCommand} clean\` will remove \`.sda-cache/\`, \`.journalism-cache/\` and \`.tmp/\`,
27
34
  if present.
28
35
 
29
36
  Have fun!`;
@@ -1,5 +1,5 @@
1
1
  export declare const runtimeConfig: {
2
- getRuntime: () => "deno" | "bun" | "node";
2
+ getRuntime: () => "node" | "bun" | "deno";
3
3
  };
4
- export declare function getRuntime(): "deno" | "bun" | "node";
4
+ export declare function getRuntime(): "node" | "bun" | "deno";
5
5
  //# sourceMappingURL=getRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getRuntime.d.ts","sourceRoot":"","sources":["../../src/helpers/getRuntime.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;CASzB,CAAC;AAEF,wBAAgB,UAAU,4BAEzB"}
1
+ {"version":3,"file":"getRuntime.d.ts","sourceRoot":"","sources":["../../src/helpers/getRuntime.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;CAazB,CAAC;AAEF,wBAAgB,UAAU,4BAEzB"}
@@ -42,13 +42,15 @@ const dntShim = __importStar(require("../_dnt.shims.js"));
42
42
  const node_process_1 = __importDefault(require("node:process"));
43
43
  exports.runtimeConfig = {
44
44
  getRuntime: () => {
45
- if ("Deno" in dntShim.dntGlobalThis)
46
- return "deno";
47
- if ("Bun" in dntShim.dntGlobalThis)
48
- return "bun";
49
- if (typeof node_process_1.default !== "undefined" && node_process_1.default?.versions?.node) {
45
+ if (typeof node_process_1.default !== "undefined" &&
46
+ node_process_1.default?.versions?.node &&
47
+ !node_process_1.default?.versions?.deno) {
50
48
  return "node";
51
49
  }
50
+ if ("Bun" in dntShim.dntGlobalThis)
51
+ return "bun";
52
+ if ("Deno" in dntShim.dntGlobalThis)
53
+ return "deno";
52
54
  return "node";
53
55
  },
54
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"handleFileConflict.d.ts","sourceRoot":"","sources":["../../src/helpers/handleFileConflict.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,EAAE;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CAGvD,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,CAoD5C"}
1
+ {"version":3,"file":"handleFileConflict.d.ts","sourceRoot":"","sources":["../../src/helpers/handleFileConflict.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,EAAE;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CAGvD,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,CAoD5C"}
@@ -1,44 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
38
5
  Object.defineProperty(exports, "__esModule", { value: true });
39
6
  exports.PROMPT_OVERRIDE = void 0;
40
7
  exports.handleFileConflict = handleFileConflict;
41
- const dntShim = __importStar(require("../_dnt.shims.js"));
42
8
  const node_fs_1 = require("node:fs");
43
9
  const prompts_1 = require("@clack/prompts");
44
10
  const node_process_1 = __importDefault(require("node:process"));
@@ -52,7 +18,7 @@ async function handleFileConflict(path, newContent) {
52
18
  }
53
19
  // Skip prompt in Deno tests if no override
54
20
  // @ts-ignore: Deno is not defined in type but present in runtime
55
- if (dntShim.dntGlobalThis.Deno?.args.includes("--internal-test-mode") &&
21
+ if (globalThis.Deno?.args.includes("--internal-test-mode") &&
56
22
  exports.PROMPT_OVERRIDE.select === prompts_1.select) {
57
23
  return "skipped";
58
24
  }
@@ -1,6 +1,5 @@
1
- import * as childProcess from "node:child_process";
2
1
  export declare const commandRunner: {
3
- execSync: typeof childProcess.execSync;
2
+ execSync: any;
4
3
  };
5
4
  export declare function installPackagesAndFetchDocs(selectedPackages: string[], options?: {
6
5
  silent?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"installPackagesAndFetchDocs.d.ts","sourceRoot":"","sources":["../../src/helpers/installPackagesAndFetchDocs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAKnD,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAEF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2DxB"}
1
+ {"version":3,"file":"installPackagesAndFetchDocs.d.ts","sourceRoot":"","sources":["../../src/helpers/installPackagesAndFetchDocs.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;CAEzB,CAAC;AAEF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2DxB"}