fix: updated build to include a shebang

This commit is contained in:
2023-07-19 22:47:13 -05:00
parent 5de6a97dbd
commit d249b02def
3 changed files with 203 additions and 190 deletions

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env node
"use strict"; "use strict";
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -93,7 +94,7 @@ function getResult(error, result) {
} }
} }
function clearFilenameComments(content) { function clearFilenameComments(content) {
let regexp = new RegExp(`//\\s*${main_1.AllPaths.base.in}/.*(?:\\n|$)`, 'g'); let regexp = new RegExp(`//\s*${main_1.AllPaths.base.in}/.*(?:\n|$)`, 'g');
return content.replace(regexp, ''); return content.replace(regexp, '');
} }
function postBuild(name, result, metaString) { function postBuild(name, result, metaString) {
@@ -122,7 +123,9 @@ function postBuild(name, result, metaString) {
} }
function doErrorFile(name, error) { function doErrorFile(name, error) {
let paths = main_1.AllPaths.script(name); let paths = main_1.AllPaths.script(name);
let content = `${new Date().toISOString()}\n\n${error}`; let content = `${new Date().toISOString()}
${error}`;
if (error !== null) { if (error !== null) {
(0, fs_1.writeFileSync)(paths.error, content); (0, fs_1.writeFileSync)(paths.error, content);
if ((0, fs_1.existsSync)(paths.dist)) { if ((0, fs_1.existsSync)(paths.dist)) {

View File

@@ -1,6 +1,6 @@
{ {
"name": "browser-scripts-builder", "name": "browser-scripts-builder",
"version": "1.1.3", "version": "1.1.4",
"description": "", "description": "",
"main": "./lib/main.js", "main": "./lib/main.js",
"module": "./lib/main.js", "module": "./lib/main.js",
@@ -9,7 +9,7 @@
}, },
"scripts": { "scripts": {
"prettier": "prettier --write .", "prettier": "prettier --write .",
"build": "npm run prettier && tsc", "build": "npm run prettier && tsc && echo \"#!/usr/bin/env node\n$(cat lib/build.js)\" > lib/build.js",
"test": "node ./test/test.mjs" "test": "node ./test/test.mjs"
}, },
"repository": { "repository": {
@@ -19,15 +19,15 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"command-line-args": "^5.2.1", "command-line-args": "^5.2.1"
"esbuild": "^0.14.54",
"prettier": "^2.8.4",
"typescript": "^4.9.5"
}, },
"devDependencies": { "devDependencies": {
"@types/command-line-args": "^5.2.0", "@types/command-line-args": "^5.2.0",
"@types/node": "^17.0.45", "@types/node": "^17.0.45",
"@types/prettier": "^2.7.2", "@types/prettier": "^2.7.2",
"eslint": "^8.33.0" "eslint": "^8.33.0",
"esbuild": "^0.14.54",
"prettier": "^2.8.4",
"typescript": "^4.9.5"
} }
} }

370
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff