From 50d0f1efb4b5e5eaaba0d87365fcef63a0014bab Mon Sep 17 00:00:00 2001 From: Wojciech Date: Sun, 30 Jun 2024 12:33:23 +0200 Subject: [PATCH 1/4] update packagejson --add publicConfig --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3db3412..41b8f47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zod-to-fields", - "version": "0.1.30", + "version": "0.1.31", "description": "Turn your Zod schemas into configurable field arrays for easy integration with HTML, React, Vue, and more.", "main": "lib/cjs/index.js", "module": "lib/esm/index.js", @@ -11,6 +11,9 @@ "url": "https://github.com/wojtekKrol/zod-to-fields.git", "bugs": "https://github.com/wojtekKrol/zod-to-fields/issues" }, + "publishConfig": { + "registry": "https://npm.pkg.github.com/@wojtekKrol" + }, "engines": { "node": ">=18" }, From baabd71480392804d6a4f7370ae028d5cb1716c0 Mon Sep 17 00:00:00 2001 From: Wojciech Date: Sun, 30 Jun 2024 12:50:36 +0200 Subject: [PATCH 2/4] update CD workflow --- .github/workflows/CD.yml | 20 ++++++++++++++++++++ package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index f010f47..712e720 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -38,11 +38,31 @@ jobs: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc echo "@wojtekKrol:registry=https://npm.pkg.github.com" >> ~/.npmrc + - name: Insert repository owner as scope into package name + run: | + cp package.json package.json.bak + node < JSON.parse(data)).then((json) => { + json.name = '@' + process.env.GITHUB_REPOSITORY.split('/')[0] + '/' + json.name; + console.info('Package name changed to %s', json.name); + return fs.writeFile('package.json', JSON.stringify(json, null, 2), 'utf8'); + }).catch(error => { + console.error(error); + process.exit(1); + }); + EOF + env: + GITHUB_REPOSITORY: ${{ github.repository }} + - name: Publish to GitHub Packages run: pnpm publish:github env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Revert package.json + run: mv package.json.bak package.json + - name: Publish to npm run: pnpm publish:npm env: diff --git a/package.json b/package.json index 41b8f47..d06fd49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zod-to-fields", - "version": "0.1.31", + "version": "0.1.32", "description": "Turn your Zod schemas into configurable field arrays for easy integration with HTML, React, Vue, and more.", "main": "lib/cjs/index.js", "module": "lib/esm/index.js", From eadb33e7a9bc0d57e7b3cff829c23aaada3a9a3a Mon Sep 17 00:00:00 2001 From: Wojciech Date: Sun, 30 Jun 2024 12:59:49 +0200 Subject: [PATCH 3/4] update CD workflow --- .github/workflows/CD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 712e720..2c629ae 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -56,7 +56,7 @@ jobs: GITHUB_REPOSITORY: ${{ github.repository }} - name: Publish to GitHub Packages - run: pnpm publish:github + run: pnpm publish --registry=https://npm.pkg.github.com/ --no-git-checks env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7cbb00bb4a0248e1ccc47926f6e227e1b7e82261 Mon Sep 17 00:00:00 2001 From: Wojciech Date: Sun, 30 Jun 2024 13:16:40 +0200 Subject: [PATCH 4/4] create github registry package --- .github/workflows/CD.yml | 6 +++--- package.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 2c629ae..79cece8 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -36,7 +36,7 @@ jobs: - name: Configure npm for GitHub Packages run: | echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc - echo "@wojtekKrol:registry=https://npm.pkg.github.com" >> ~/.npmrc + echo "@wojtekkrol:registry=https://npm.pkg.github.com" >> ~/.npmrc - name: Insert repository owner as scope into package name run: | @@ -44,7 +44,7 @@ jobs: node < JSON.parse(data)).then((json) => { - json.name = '@' + process.env.GITHUB_REPOSITORY.split('/')[0] + '/' + json.name; + json.name = '@' + process.env.GITHUB_REPOSITORY.split('/')[0].toLowerCase() + '/' + json.name; console.info('Package name changed to %s', json.name); return fs.writeFile('package.json', JSON.stringify(json, null, 2), 'utf8'); }).catch(error => { @@ -56,7 +56,7 @@ jobs: GITHUB_REPOSITORY: ${{ github.repository }} - name: Publish to GitHub Packages - run: pnpm publish --registry=https://npm.pkg.github.com/ --no-git-checks + run: pnpm publish:github env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index d06fd49..b2fa49e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zod-to-fields", - "version": "0.1.32", + "version": "0.1.33", "description": "Turn your Zod schemas into configurable field arrays for easy integration with HTML, React, Vue, and more.", "main": "lib/cjs/index.js", "module": "lib/esm/index.js", @@ -12,7 +12,7 @@ "bugs": "https://github.com/wojtekKrol/zod-to-fields/issues" }, "publishConfig": { - "registry": "https://npm.pkg.github.com/@wojtekKrol" + "registry": "https://npm.pkg.github.com/@wojtekkrol" }, "engines": { "node": ">=18" @@ -64,7 +64,7 @@ "coverage": "jest --coverage", "test": "jest", "publish:npm": "pnpm publish --access public", - "publish:github": "pnpm publish --registry=https://npm.pkg.github.com/" + "publish:github": "pnpm publish --registry=https://npm.pkg.github.com/ --no-git-checks" }, "devDependencies": { "@changesets/cli": "^2.27.6",