-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,12 @@ pnpm test | |
## Linting | ||
``` | ||
pnpm lint | ||
deno lint | ||
``` | ||
## Formatting | ||
``` | ||
deno fmt | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import fs from 'fs'; | ||
|
||
import fs from 'node:fs'; | ||
import process from 'node:process'; | ||
|
||
function argPath(search: string) { | ||
const findPathArg = process.argv.find((arg) => arg.includes(`--${search}=`)); | ||
if (!findPathArg) { | ||
return undefined; | ||
} | ||
const findPathArg = process.argv.find((arg) => arg.includes(`--${search}=`)); | ||
if (!findPathArg) { | ||
return undefined; | ||
} | ||
|
||
return findPathArg.replace(`--${search}=`, ''); | ||
return findPathArg.replace(`--${search}=`, ''); | ||
} | ||
|
||
let path = argPath('path'); | ||
|
||
if (!path) { | ||
console.log('--path are required args'); | ||
path = 'dist'; | ||
console.log('--path are required args'); | ||
path = 'dist'; | ||
} else { | ||
path = `${process.cwd()}/${path}`; | ||
console.log(path); | ||
fs.writeFileSync(path + '/cjs/package.json', '{"type":"commonjs"}'); | ||
fs.writeFileSync(path + '/esm/package.json', '{"type":"module"}'); | ||
console.log('postbuild completed...'); | ||
} | ||
path = `${process.cwd()}/${path}`; | ||
console.log(path); | ||
fs.writeFileSync(path + '/cjs/package.json', '{"type":"commonjs"}'); | ||
fs.writeFileSync(path + '/esm/package.json', '{"type":"module"}'); | ||
console.log('postbuild completed...'); | ||
} |