Skip to content

Commit

Permalink
change src to build/src
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-Lazarov committed Feb 20, 2025
1 parent 265e3c5 commit b4edefb
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 12 deletions.
11 changes: 5 additions & 6 deletions build/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.0.8",
"version": "0.0.9",
"license": "MIT",
"types": "./src/index.d.ts",
"types": "./build/src/index.d.ts",
"description": "Helpers library for application",
"scripts": {
"build": "npm run build:cjs && npm run build:esm && tsc --outDir build/src && node scripts/build-package.js",
Expand All @@ -25,13 +25,12 @@
"registry": "https://npm.pkg.github.com"
},
"files": [
"build",
"src"
"build"
],
"exports": {
".": {
"import": "./src/index.js",
"require": "./src/index.js"
"import": "./build/src/index.js",
"require": "./build/src/index.js"
}
},
"dependencies": {
Expand Down
58 changes: 58 additions & 0 deletions npm package at github.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
The most important part is paths to files so they can set variables and tokens

/.npmrc
/.github/workflows/publish.yml


env:
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} - write it above from place that is going to be used

${{ secrets.GITHUB_TOKEN }} - this is get automatically from github

echo "@Peter-Lazarov:registry=https://npm.pkg.github.com" > ~/.npmrc - watch good where the npmrc file is
echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> ~/.npmrc

example of publish yml file
name: Publish
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm install
- run: npm run build
- run: |
echo "@Peter-Lazarov:registry=https://npm.pkg.github.com" > ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
- run: npm publish
working-directory: ./build


Manually publish if needed
------------------------------------------------------------
Linux konsole and from folder where the library is

npm login
peter-lazarov
YOUR_GITHUB_TOKEN
email

//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
@your-username:registry=https://npm.pkg.github.com

npm adduser --registry=https://npm.pkg.github.com

npm publish
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.0.8",
"version": "0.0.9",
"license": "MIT",
"types": "./src/index.d.ts",
"types": "./build/src/index.d.ts",
"description": "Helpers library for application",
"scripts": {
"build": "npm run build:cjs && npm run build:esm && tsc --outDir build/src && node scripts/build-package.js",
Expand All @@ -25,13 +25,12 @@
"registry": "https://npm.pkg.github.com"
},
"files": [
"build",
"src"
"build"
],
"exports": {
".": {
"import": "./src/index.js",
"require": "./src/index.js"
"import": "./build/src/index.js",
"require": "./build/src/index.js"
}
},
"dependencies": {
Expand Down

0 comments on commit b4edefb

Please sign in to comment.