Skip to content

Commit f105c67

Browse files
authored
Dev (#20)
* update packagejson --add publicConfig * update CD workflow * update CD workflow * create github registry package
1 parent 4877590 commit f105c67

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

.github/workflows/CD.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,24 @@ jobs:
3636
- name: Configure npm for GitHub Packages
3737
run: |
3838
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
39-
echo "@wojtekKrol:registry=https://npm.pkg.github.com" >> ~/.npmrc
39+
echo "@wojtekkrol:registry=https://npm.pkg.github.com" >> ~/.npmrc
40+
41+
- name: Insert repository owner as scope into package name
42+
run: |
43+
cp package.json package.json.bak
44+
node <<EOF
45+
const fs = require('fs').promises;
46+
fs.readFile('package.json', 'utf8').then((data) => JSON.parse(data)).then((json) => {
47+
json.name = '@' + process.env.GITHUB_REPOSITORY.split('/')[0].toLowerCase() + '/' + json.name;
48+
console.info('Package name changed to %s', json.name);
49+
return fs.writeFile('package.json', JSON.stringify(json, null, 2), 'utf8');
50+
}).catch(error => {
51+
console.error(error);
52+
process.exit(1);
53+
});
54+
EOF
55+
env:
56+
GITHUB_REPOSITORY: ${{ github.repository }}
4057

4158
- name: Insert repository owner as scope into package name
4259
run: |

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zod-to-fields",
3-
"version": "0.1.32",
3+
"version": "0.1.33",
44
"description": "Turn your Zod schemas into configurable field arrays for easy integration with HTML, React, Vue, and more.",
55
"main": "lib/cjs/index.js",
66
"module": "lib/esm/index.js",
@@ -12,7 +12,7 @@
1212
"bugs": "https://github.com/wojtekKrol/zod-to-fields/issues"
1313
},
1414
"publishConfig": {
15-
"registry": "https://npm.pkg.github.com/@wojtekKrol"
15+
"registry": "https://npm.pkg.github.com/@wojtekkrol"
1616
},
1717
"engines": {
1818
"node": ">=18"
@@ -64,7 +64,7 @@
6464
"coverage": "jest --coverage",
6565
"test": "jest",
6666
"publish:npm": "pnpm publish --access public",
67-
"publish:github": "pnpm publish --registry=https://npm.pkg.github.com/"
67+
"publish:github": "pnpm publish --registry=https://npm.pkg.github.com/ --no-git-checks"
6868
},
6969
"devDependencies": {
7070
"@changesets/cli": "^2.27.6",

0 commit comments

Comments
 (0)