@codeandmoney/jargal 0.0.2-RC.4 → 0.0.2-RC.5

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.
package/actions/write.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // TODO: get rid of `node:` imports and "del", "mkdirp" libraries
2
- import { access } from "node:fs/promises"
2
+ import { access, mkdir, rm, writeFile } from "node:fs/promises"
3
3
 
4
4
  import { dirname } from "@std/path"
5
5
 
@@ -24,12 +24,12 @@ export type WriteActionConfig = {
24
24
 
25
25
  export function write( config: WriteActionConfig ): Action {
26
26
  return async function execute() {
27
- await Deno.mkdir( dirname( config.destination ), { recursive: true } )
27
+ await mkdir( dirname( config.destination ), { recursive: true } )
28
28
 
29
29
  let doesExist = await fileExists( config.destination )
30
30
 
31
31
  if ( doesExist && config.mode === "force" ) {
32
- await Deno.remove( config.destination, { recursive: true } )
32
+ await rm( config.destination, { recursive: true } )
33
33
  doesExist = false
34
34
  }
35
35
 
@@ -42,7 +42,7 @@ export function write( config: WriteActionConfig ): Action {
42
42
  return
43
43
  }
44
44
 
45
- await Deno.writeFile( config.destination, new TextEncoder().encode( config.content ) )
45
+ await writeFile( config.destination, new TextEncoder().encode( config.content ) )
46
46
  }
47
47
 
48
48
  // if(eager) {
@@ -51,7 +51,7 @@ export function write( config: WriteActionConfig ): Action {
51
51
  // return execute
52
52
  // }
53
53
  // return async ( params ) => {
54
- // await Deno.mkdir( dirname( config.destination ), { recursive: true } )
54
+ // await mkdir( dirname( config.destination ), { recursive: true } )
55
55
 
56
56
  // // const template = ( await readFile( config.template ) ).toString()
57
57
 
@@ -60,7 +60,7 @@ export function write( config: WriteActionConfig ): Action {
60
60
  // const doesExist = await fileExists( config.destination )
61
61
 
62
62
  // if ( doesExist && config.writeMode === "force" ) {
63
- // await Deno.remove( config.destination, { recursive: true } )
63
+ // await remove( config.destination, { recursive: true } )
64
64
  // }
65
65
 
66
66
  // if ( doesExist ) {
@@ -72,7 +72,7 @@ export function write( config: WriteActionConfig ): Action {
72
72
  // throw `File already exists\n -> ${config.destination}`
73
73
  // }
74
74
 
75
- // await Deno.writeFile( config.destination, new TextEncoder().encode( rendered ) )
75
+ // await writeFile( config.destination, new TextEncoder().encode( rendered ) )
76
76
  // }
77
77
  }
78
78
 
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeandmoney/jargal",
3
- "version": "0.0.2-RC.4",
3
+ "version": "0.0.2-RC.5",
4
4
  "description": "Renderer",
5
5
  "license": "MIT",
6
6
  "author": "Code & Money Team",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeandmoney/jargal",
3
- "version": "0.0.2-RC.4",
3
+ "version": "0.0.2-RC.5",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"