Skip to content

Commit 5e88f23

Browse files
authored
some cleanup in prep for open sourcing (#196)
* rename package to match existing NPM org Our npm organization is `nginx`, not `nginxinc`, renames across the board and a few incidental `devDependencies` updates. * fix rollup warning It wanted us to be explicit about our options instead of relying on the default values. * update README - prep for public npm consumption - simplify / rework a little
1 parent f32abbb commit 5e88f23

File tree

13 files changed

+40
-48
lines changed

13 files changed

+40
-48
lines changed

examples/autocomplete/highlight.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getDirectives, Directive } from '@nginxinc/reference-lib'
1+
import { getDirectives, Directive } from '@nginx/reference-lib'
22

33
/** kinds of tokens used for highlighting */
44
type token =

examples/autocomplete/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getDirectives, Format, Directive } from '@nginxinc/reference-lib'
1+
import { getDirectives, Format, Directive } from '@nginx/reference-lib'
22
type autocomplete = {
33
/** name of the NGINX module */
44
m: string

examples/autocomplete/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/autocomplete/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"highlight": "mkdir -p dist && node --loader=ts-node/esm highlight.ts > dist/highlight.ts"
1010
},
1111
"dependencies": {
12-
"@nginxinc/reference-lib": "file:../../reference-lib",
12+
"@nginx/reference-lib": "file:../../reference-lib",
1313
"@types/node": "^20.14.0",
1414
"ts-node": "^10.9.2",
1515
"typescript": "^5.4.5"

examples/ref-browser/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/ref-browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@nginxinc/reference-lib": "file:../../reference-lib",
13+
"@nginx/reference-lib": "file:../../reference-lib",
1414
"react": "^18.3.1",
1515
"react-dom": "^18.3.1",
1616
"react-router-dom": "^6.23.1"

examples/ref-browser/src/Description.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react'
2-
import { Format, find } from '@nginxinc/reference-lib'
2+
import { Format, find } from '@nginx/reference-lib'
33

44
type DescriptionProps = {
55
module: string

examples/ref-browser/src/Directive.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Format, getDirectives } from '@nginxinc/reference-lib'
1+
import { Format, getDirectives } from '@nginx/reference-lib'
22
import Description from './Description'
33

44
type Dir = {

examples/ref-browser/src/Tree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use client'
2-
import { getDirectives } from '@nginxinc/reference-lib'
2+
import { getDirectives } from '@nginx/reference-lib'
33
import { useCallback, useState } from 'react'
44
import { SearchBox } from './SearchBox'
55
import { Link } from 'react-router-dom'

reference-lib/README.md

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
# Reference Library
2-
NGINX directive reference in Markdown and HTML format
3-
4-
# Installation
5-
6-
1. Generate a github personal access token with read:packages permission
7-
2. Create a ~/.npmrc file with the following content
8-
```
9-
@nginxinc:registry=http://npm.pkg.github.com
10-
//npm.pkg.github.com/:_authToken=$TOKEN
11-
```
12-
3. Run
13-
```bash
14-
npm install --save @nginxinc/[email protected]
15-
```
16-
17-
# Usage
18-
1. find
19-
```javascript
20-
import { find, Format } from '@nginxinc/reference-lib'
21-
const content = find('listen', undefined, Format.HTML)
22-
```
23-
24-
2. getDirectives
25-
```javascript
26-
import { getDirectives, Format } from '@nginxinc/reference-lib'
27-
const directive = getDirectives(Format.HTML)
28-
```
2+
3+
Machine-readable NGINX directive documentation, with Markdown and HTML formats.
4+
5+
This library is generated from the official NGINX documentation, and intended for use in other tools that work with NGINX configuration files. This provides more accurate and up-to-date information than web scraping <https://nginx.org>.
6+
7+
Every time the NGINX documentation changes, this library will be updated and published with a new version number.
8+
9+
## Installation
10+
11+
`npm install --save @nginx/reference-lib`
12+
13+
## Usage
14+
15+
We export two functions (with type definitions) to navigate the documentation:
16+
17+
1. `getDirectives` returns a flat list of all directives in any official module
18+
2. `find` returns a specific directive by name
19+
20+
See [examples](./examples) for more usage.

reference-lib/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@nginxinc/reference-lib",
2+
"name": "@nginx/reference-lib",
33
"version": "1.0.14",
44
"description": "",
55
"main": "dist/index.js",

reference-lib/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export default {
66
output: {
77
file: 'dist/index.js',
88
},
9-
plugins: [json(), typescript()],
9+
plugins: [json(), typescript({ outputToFilesystem: true })],
1010
}

0 commit comments

Comments
 (0)