Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(dist): simplify release process
- Loading branch information
Showing
23 changed files
with
260 additions
and
71 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
node_modules | ||
.eslintrc.cjs | ||
scripts/*.js |
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
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env node | ||
/* eslint-disable import/extensions */ | ||
|
||
import '../dist/bundle/cli.js'; | ||
import '../dist/esm/cli.js'; |
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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* eslint-disable */ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.savePackageJson = exports.loadPackageJson = void 0; | ||
const fs_1 = require("fs"); | ||
const path_1 = require("path"); | ||
const project_1 = __importDefault(require("./project")); | ||
/** | ||
* Reads and parses the content of a package.json file | ||
* | ||
* @param pathSegments - The path segments of the folder where the package.json is located, relative to the root of the project | ||
*/ | ||
async function loadPackageJson(...pathSegments) { | ||
const path = path_1.join(project_1.default.path, ...pathSegments, 'package.json'); | ||
return new Promise((resolve, reject) => { | ||
fs_1.readFile(path, (err, data) => { | ||
if (err) { | ||
reject(err); | ||
} | ||
if (!data) { | ||
throw new Error(`Empty file: ${path}`); | ||
} | ||
const str = data.toString('utf8'); | ||
const json = JSON.parse(str); | ||
resolve(json); | ||
}); | ||
}); | ||
} | ||
exports.loadPackageJson = loadPackageJson; | ||
/** | ||
* Stringifies and writes out the content of a package.json file | ||
* | ||
* @param pkg - The package.json as an object | ||
* @param pathSegments - The path segments of the folder where the package.json is located, relative to the root of the project | ||
*/ | ||
async function savePackageJson(pkg, ...pathSegments) { | ||
const path = path_1.join(project_1.default.path, ...pathSegments, 'package.json'); | ||
return new Promise((resolve, reject) => { | ||
const str = JSON.stringify(pkg, null, 2); | ||
fs_1.writeFile(path, str, { encoding: 'utf8' }, (err) => { | ||
if (err) { | ||
reject(err); | ||
} | ||
resolve(); | ||
}); | ||
}); | ||
} | ||
exports.savePackageJson = savePackageJson; |
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
Oops, something went wrong.