@jrc03c/make-key 0.0.30 → 0.0.31

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,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { exec } from "node:child_process"
3
- import makeKey from "./src/index.js"
3
+ import { makeKey } from "./src/index.mjs"
4
4
 
5
5
  const args = process.argv.slice(2)
6
6
 
package/build.mjs ADDED
@@ -0,0 +1,28 @@
1
+ import { execSync } from "node:child_process"
2
+
3
+ function rebuild() {
4
+ console.log("-----")
5
+ console.log(`\nRebuilding... (${new Date().toLocaleString()})`)
6
+
7
+ try {
8
+ const baseCommand = "npx esbuild src/index.mjs --bundle"
9
+
10
+ const commands = [
11
+ "mkdir -p dist",
12
+ "rm -rf dist/*",
13
+ `${baseCommand} --platform=node --outfile=dist/make-key.require.cjs`,
14
+ `${baseCommand} --outfile=dist/make-key.standalone.cjs`,
15
+ `${baseCommand} --format=esm --outfile=dist/make-key.import.mjs`,
16
+ ]
17
+
18
+ commands.forEach(command => {
19
+ execSync(command, { encoding: "utf8" })
20
+ })
21
+
22
+ console.log("\nDone! 🎉\n")
23
+ } catch (e) {
24
+ console.error(e)
25
+ }
26
+ }
27
+
28
+ rebuild()