Skip to content

Commit 4165de2

Browse files
committed
GitHub Packages CI
1 parent 7ba88f5 commit 4165de2

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@ jobs:
1818
run: npm publish --access public
1919
env:
2020
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21+
- name: Setup .npmrc file to publish to GitHub Packages
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: '12.x'
25+
registry-url: 'https://npm.pkg.github.com'
26+
scope: '@tomchen'
27+
- run: npm run addscope
28+
- name: Publish to GitHub Packages
29+
run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# typedoc-plugin-not-exported
22

3-
[![npm package](https://img.shields.io/badge/npm%20i-typedoc--plugin--not--exported-brightgreen)](https://www.npmjs.com/package/typedoc-plugin-not-exported) [![version number](https://img.shields.io/npm/v/typedoc-plugin-not-exported?color=green&label=version)](https://github.com/tomchen/typedoc-plugin-not-exported/releases) [![License](https://img.shields.io/github/license/tomchen/typedoc-plugin-not-exported)](https://github.com/tomchen/typedoc-plugin-not-exported/blob/main/LICENSE)
3+
[![npm package](https://img.shields.io/badge/npm%20i-typedoc--plugin--not--exported-brightgreen)](https://www.npmjs.com/package/typedoc-plugin-not-exported) [![version number](https://img.shields.io/npm/v/typedoc-plugin-not-exported?color=green&label=version)](https://github.com/tomchen/typedoc-plugin-not-exported/releases) [![Actions Status](https://github.com/tomchen/typedoc-plugin-not-exported/workflows/Test/badge.svg)](https://github.com/tomchen/typedoc-plugin-not-exported/actions) [![License](https://img.shields.io/github/license/tomchen/typedoc-plugin-not-exported)](https://github.com/tomchen/typedoc-plugin-not-exported/blob/main/LICENSE)
44

55
This [TypeDoc](https://typedoc.org/) plugin can force inclusion of specific symbols (variables) that are not exported, by making them fake exports.
66

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"test": "npm run test:gen && npm run test:jest && npm run test:cleanup",
88
"test:cleanup": "rimraf test/docs test/docs2",
99
"test:gen": "npm run test:cleanup && typedoc --options test/typedoc.json && typedoc --options test/typedoc2.json",
10-
"test:jest": "jest"
10+
"test:jest": "jest",
11+
"addscope": "node tools/packagejson name @tomchen/typedoc-plugin-not-exported && prettier --write package.json"
12+
},
13+
"publishConfig": {
14+
"access": "public"
1115
},
1216
"files": [
1317
"src"

tools/packagejson.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* eslint-disable */
2+
const fs = require('fs')
3+
const Path = require('path')
4+
const fileName = '../package.json'
5+
const file = require(fileName)
6+
/* eslint-enable */
7+
8+
const args = process.argv.slice(2)
9+
10+
for (let i = 0, l = args.length; i < l; i++) {
11+
if (i % 2 === 0) {
12+
file[args[i]] = args[i + 1]
13+
}
14+
}
15+
16+
fs.writeFile(
17+
Path.join(__dirname, fileName),
18+
JSON.stringify(file),
19+
function writeJSON(err) {
20+
if (err) {
21+
return console.log(err)
22+
}
23+
console.log(JSON.stringify(file))
24+
console.log('Writing to ' + fileName)
25+
}
26+
)

0 commit comments

Comments
 (0)