Skip to content

Commit

Permalink
Merge pull request #682 from open-rpc/fix/package-lock
Browse files Browse the repository at this point in the history
fix: add package lock file and lock semi ver on a few packages
  • Loading branch information
zcstarr authored Oct 2, 2021
2 parents ab4d640 + 1a0d8d7 commit 3b3e21b
Show file tree
Hide file tree
Showing 4 changed files with 29,359 additions and 9 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
**/node_modules
**/build
**/coverage
**/docs
**/.idea
coverage
.DS_Store
Expand Down
9 changes: 7 additions & 2 deletions src/components/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ module.exports = {
const hooks: IHooks = {
afterCopyStatic: [
async (dest, frm, component, openrpcDocument): Promise<void> => {
const destPath = path.join(dest, "package.json");
const tmplPath = path.join(dest, "_package.json");

const replacePackageJsonContent = async (fileName: string)=> {
const destPath = path.join(dest, fileName);
const tmplPath = path.join(dest, `_${fileName}`);

const tmplPkgStr = await readFile(tmplPath, "utf8");
let tmplPkg = JSON.parse(tmplPkgStr);
Expand Down Expand Up @@ -118,6 +120,9 @@ const hooks: IHooks = {

await writeFile(destPath, JSON.stringify(tmplPkg, undefined, " "));
await remove(tmplPath);
}
await replacePackageJsonContent("package.json");
await replacePackageJsonContent("package-lock.json");
},
],
templateFiles: {
Expand Down
Loading

0 comments on commit 3b3e21b

Please sign in to comment.