Files
pmg/publish/npm/config.js
T
74248cd74a Publish pmg to npm (#50)
* feat: pmg publish to npm

* feat: add github action for publishing to npm

* Update publish/npm/install.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>

* Update .github/workflows/publish-npm.yml

Co-authored-by: Omkar Phansopkar <omkarphansopkar@gmail.com>
Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>

* refactor: define constants

* refactor: improve npm package reliability with removing dynamic handlers and better error handling and validation

* fix: publish-npm workflow

* Update publish/npm/test.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>

* refactor(npm-workflow): use a more portable loop construct

* refactor: remove version field from package.json

* feat: use os.tmpdir() with mkdtempSync for cleaner temp directory handling

* fix: add redirect limit and cleanup to prevent infinite redirects and resource leaks

* remove test.js for npm publisher pack

* chore: test cmd cleanup

---------

Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Omkar Phansopkar <omkarphansopkar@gmail.com>
2025-07-04 12:42:37 +05:30

35 lines
1.0 KiB
JavaScript

// Configuration for npm binary wrapper
const ORG_NAME = "@safedep";
const PACKAGE_NAME = "pmg";
const BINARY_NAME = "pmg";
// GitHub repository information for releases
const REPO_OWNER = "safedep";
const REPO_NAME = "pmg";
// GitHub releases base URL (constructed from repo info)
const GITHUB_RELEASES_BASE = `https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download`;
// Platform-specific binary filename patterns (GoReleaser format)
const BINARY_PATTERNS = {
"darwin-x64": `${BINARY_NAME}_Darwin_all.tar.gz`,
"darwin-arm64": `${BINARY_NAME}_Darwin_all.tar.gz`,
"linux-x64": `${BINARY_NAME}_Linux_x86_64.tar.gz`,
"linux-arm64": `${BINARY_NAME}_Linux_arm64.tar.gz`,
"linux-ia32": `${BINARY_NAME}_Linux_i386.tar.gz`,
"win32-x64": `${BINARY_NAME}_Windows_x86_64.zip`,
"win32-arm64": `${BINARY_NAME}_Windows_arm64.zip`,
"win32-ia32": `${BINARY_NAME}_Windows_i386.zip`,
};
module.exports = {
ORG_NAME,
PACKAGE_NAME,
BINARY_NAME,
REPO_OWNER,
REPO_NAME,
GITHUB_RELEASES_BASE,
BINARY_PATTERNS,
};