@epic-web/workshop-utils 4.5.0 → 4.5.1

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 +1 @@
1
- {"version":3,"file":"utils.server.js","sourceRoot":"","sources":["../../src/utils.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,KAAK,UAAU,eAAe;IACpC,OAAO,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,IAAI,CACrC,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,EAAE,CAAC,KAAK,CACX,CAAA;AACF,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;AAE5C,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,QAAgB,EAChB,IAAY,EACZ,YAAoB;IAEpB,IAAI,GAA8B,CAAA;IAClC,IAAI,CAAC;QACJ,GAAG,GAAG,SAAS,CAAC,KAAK,CACpB,IAAI,CAAC,KAAK,CACT,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,CAC/D,CACD,CAAA;IACF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,mCAAmC,QAAQ,EAAE,EAAE;YAC9D,KAAK,EAAE,KAAK;SACZ,CAAC,CAAA;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAChC,IAAI,KAAK,GAAQ,GAAG,CAAA;IACpB,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC1B,sEAAsE;QACtE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAChB,IAAI,KAAK,KAAK,SAAS;YAAE,MAAK;IAC/B,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACd,oCAAoC,IAAI,uBAAuB,QAAQ,EAAE,CACzE,CAAA;IACF,CAAC;IACD,OAAO,KAAK,IAAI,YAAY,CAAA;AAC7B,CAAC","sourcesContent":["import { promises as dns } from 'node:dns'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { z } from 'zod'\n\nexport async function checkConnection() {\n\treturn dns.resolve('example.com').then(\n\t\t() => true,\n\t\t() => false,\n\t)\n}\n\nconst PkgSchema = z.object({}).passthrough()\n\nexport async function getPkgProp<Value>(\n\tfullPath: string,\n\tprop: string,\n\tdefaultValue?: Value,\n): Promise<Value> {\n\tlet pkg: z.infer<typeof PkgSchema>\n\ttry {\n\t\tpkg = PkgSchema.parse(\n\t\t\tJSON.parse(\n\t\t\t\tfs.readFileSync(path.join(fullPath, 'package.json')).toString(),\n\t\t\t),\n\t\t)\n\t} catch (error) {\n\t\tthrow new Error(`Could not parse package.json of ${fullPath}`, {\n\t\t\tcause: error,\n\t\t})\n\t}\n\tconst propPath = prop.split('.')\n\tlet value: any = pkg\n\tfor (const p of propPath) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tvalue = value[p]\n\t\tif (value === undefined) break\n\t}\n\tif (value === undefined && defaultValue === undefined) {\n\t\tthrow new Error(\n\t\t\t`Could not find required property ${prop} in package.json of ${fullPath}`,\n\t\t)\n\t}\n\treturn value ?? defaultValue\n}\n"]}
1
+ {"version":3,"file":"utils.server.js","sourceRoot":"","sources":["../../src/utils.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,UAAU,CAAA;AAC1C,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IACF,CAAC;IACD,OAAO,KAAK,IAAI,YAAY,CAAA;AAC7B,CAAC","sourcesContent":["import { promises as dns } from 'node:dns'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { z } from 'zod'\n\nexport async function checkConnection() {\n\treturn dns.resolve('example.com').then(\n\t\t() => true,\n\t\t() => false,\n\t)\n}\n\nconst PkgSchema = z.object({}).passthrough()\n\nexport async function getPkgProp<Value>(\n\tfullPath: string,\n\tprop: string,\n\tdefaultValue?: Value,\n): Promise<Value> {\n\tlet pkg: z.infer<typeof PkgSchema>\n\ttry {\n\t\tpkg = PkgSchema.parse(\n\t\t\tJSON.parse(\n\t\t\t\tfs.readFileSync(path.join(fullPath, 'package.json')).toString(),\n\t\t\t),\n\t\t)\n\t} catch (error) {\n\t\tthrow new Error(`Could not parse package.json of ${fullPath}`, {\n\t\t\tcause: error,\n\t\t})\n\t}\n\tconst propPath = prop.split('.')\n\tlet value: any = pkg\n\tfor (const p of propPath) {\n\t\tvalue = value[p]\n\t\tif (value === undefined) break\n\t}\n\tif (value === undefined && defaultValue === undefined) {\n\t\tthrow new Error(\n\t\t\t`Could not find required property ${prop} in package.json of ${fullPath}`,\n\t\t)\n\t}\n\treturn value ?? defaultValue\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epic-web/workshop-utils",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -102,7 +102,7 @@
102
102
  "dependencies": {
103
103
  "@epic-web/cachified": "^5.2.0",
104
104
  "@epic-web/remember": "^1.0.2",
105
- "@kentcdodds/md-temp": "^8.0.1",
105
+ "@kentcdodds/md-temp": "^9.0.1",
106
106
  "@mdx-js/mdx": "^3.0.1",
107
107
  "@playwright/test": "^1.44.1",
108
108
  "@remix-run/node": "^2.9.2",