Skip to content

Commit

Permalink
Merge 6cb7fcc into 42b32ea
Browse files Browse the repository at this point in the history
  • Loading branch information
brianneisler authored Mar 28, 2021
2 parents 42b32ea + 6cb7fcc commit 01bf43b
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 1,875 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Release v0.2.2

- Update API docs
- Break AST parser out into separate module called firetree
- Bump node-notifier from 8.0.0 to 8.0.1
- Add .opensource. Install firetree.
- Bump node-fetch from 2.6.0 to 2.6.1
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Copyright (c) 2020 Brian Neisler https://brianneisler.com
Copyright (c) 2021 Brian Neisler https://brianneisler.com

firemin may be freely distributed under the Apache-2.0 license.
49 changes: 40 additions & 9 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,94 @@

This guide is a simple instruction set for releasing a new version of `firemin`


## Notes

- We use git tags for releasing `firemin` through Travis.

## Instructions

- Make sure your local master is up to date with latest commits.

```sh
git checkout master
git pull --rebase
```

- Checkout a new release branch. Replace Xs with the version number you are releasing.

```sh
git checkout -b release-vX.X.X
git checkout -b release/vX.X.X
```

- Update package.json to new version number
- Cleanse project (clears out package-lock.json and installed node_modules)

```sh
npm run cleanse
```

- Setup project

```sh
npm run setup
```

- Version numbers are now updated

- run lint to ensure files have bene linted. If lint is not passing, abort release and fix lint issues.

```sh
npm run lint
```

- Run test to ensure tests are passing. If tests are not, abort release and fix tests.

```sh
npm run test
```
- run lint to ensure files have bene linted. If lint is not passing, abort release and fix lint issues.

- Update docs with new version numbers

```sh
npm run lint
npm run docs:generate
```
- Update docs with new version numbers

- generate the change log

```sh
npm run docs:gen
git log --pretty="- %s" --no-merges origin/release/vX.X.X..release/vX.X.X >> CHANGELOG.md
```
- Commit file changes with new version numbers. Replace Xs with new version number.

- Commit files changes with new version numbers. Replace Xs with new version number.

```sh
git add -A
git commit -m"Releasing vX.X.X"
git push origin release-vX.X.X
git commit -m"Release vX.X.X"
git push origin release/vX.X.X
```

- Open PR on github for new release
- Pase changes for version from changelog into PR
- Get PR review from core contributor
- After reviewed and after Travis has passed build, merge PR.
- Checkout master from git and pull version changes

```sh
git checkout master
git pull --rebase
```

- Tag a new release in git

```sh
git tag vX.X.X
```

- Push tags

```sh
git push --tags
```

- Travis will release the new version from tag.
- Relax and enjoy the new version!
31 changes: 9 additions & 22 deletions docs/API.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
# API

<!-- AUTO-GENERATED-CONTENT:START (TOC) -->

- [minimizer](#minimizer)
- [function minimize()](#function-minimize)
* [function minimize()](#function-minimize)
- [lang.util](#langutil)
- [**private** function cacheChain()](#private-function-cachechain)
- [**private** function functionDefineLength()](#private-function-functiondefinelength)
<!-- AUTO-GENERATED-CONTENT:END -->
* [**private** function cacheChain()](#private-function-cachechain)
* [**private** function functionDefineLength()](#private-function-functiondefinelength)
<!-- AUTO-GENERATED-CONTENT:END -->

<!-- AUTO-GENERATED-CONTENT:START (METHODS) -->

## minimizer

### function minimize()

[source](https://github.com/brianneisler/firemin.git/tree/v0.2.1/src/minimizer/minimize.js#L8)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; since v0.1.0

[source](https://github.com/brianneisler/firemin.git/tree/v0.2.2/src/minimizer/minimize.js#L8)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; since v0.1.0
<p>Minimizes the rules contained at the given filePath.<br />
If given an outputFilePath this method will output the result to the given<br />
file path instead of returning a minimize string.</p>

**Params**

<p><code>context</code>: <code>Context</code> - </p>
<p><code>options</code>: <code>{<br />
filePath: String,<br />
Expand All @@ -33,7 +29,6 @@ file path instead of returning a minimize string.</p>
<br /><p><code>String | Null</code> - </p>

**Example**

```js
const context = setupContext()

Expand All @@ -48,15 +43,13 @@ await minimize(context, {
outputFilePath: './path/to/firestore.min.rules'
})
```

<br /><br />

## lang.util

### **private** function cacheChain()

[source](https://github.com/brianneisler/firemin.git/tree/v0.2.1/src/utils/cacheChain.js#L42)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; since v0.1.0

[source](https://github.com/brianneisler/firemin.git/tree/v0.2.2/src/utils/cacheChain.js#L42)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; since v0.1.0
<p>This method generates a specific object instance for use in a WeakMap cache.<br />
The object instance is unique based upon the parameters that are passed to<br />
the this method.</p>
Expand All @@ -67,43 +60,37 @@ WeakMap as part of a chain. If that object is ever removed from memory all<br />
cache chains connected to the object will automatically be removed from the cache.</p>

**Params**

<p><code>args</code>: <code>...&ast;</code> - The arguments to generate a cache key for</p>

**Returns**
<br /><p><code>Object</code> - The cache key</p>

**Example**

```js

```

<br /><br />

### **private** function functionDefineLength()

[source](https://github.com/brianneisler/firemin.git/tree/v0.2.1/src/utils/functionDefineLength.js#L55)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; since v0.1.0

[source](https://github.com/brianneisler/firemin.git/tree/v0.2.2/src/utils/functionDefineLength.js#L55)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; since v0.1.0
<p>Defines <code>length</code> for the given <code>func</code></p>
<p>Note: This mutates <code>func</code></p>

**Params**

<p><code>func</code>: <code>Function</code> - The function to define the length of.</p>
<p><code>length</code>: <code>Number</code> - The length of the function parameters.</p>

**Returns**
<br /><p><code>Function</code> - The `func` function.</p>

**Example**

```js
const result = functionDefineLength(function (abc) {}, 2)
const result = functionDefineLength(function(abc) {}, 2)
result.length
//=> 2
```

<br /><br />


<!-- AUTO-GENERATED-CONTENT:END -->
Loading

0 comments on commit 01bf43b

Please sign in to comment.