Skip to content

Commit

Permalink
Remove TS dependency, unify docs... (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicfv authored Apr 11, 2024
1 parent 5e67a31 commit 90ef614
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 52 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ publish=false
if [[ "${1}" == 'publish' ]] ; then
publish=true
fi
docdir='.docs'

# Check for and set npm token
if "${publish}" ; then
if [[ -z "${NPM_TOKEN}" ]] ; then
echo 'Missing environment variable NPM_TOKEN'
exit 1
else
mkdir .docs || exit 1
cp .github/workflows/home/* .docs
mkdir "${docdir}" || exit 1
cp .github/workflows/home/* "${docdir}"
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
fi
fi
Expand Down Expand Up @@ -117,7 +118,7 @@ for dir in */ ; do
echo "packages['${package_name//"'"/"\\'"}'].time = '${package_date//"'"/"\\'"}';"
echo "packages['${package_name//"'"/"\\'"}'].ver = '${local_version//"'"/"\\'"}';"
echo "packages['${package_name//"'"/"\\'"}'].dir = '${dir//"'"/"\\'"}';"
} >> '../.docs/index.js'
} >> "../${docdir}/index.js"
# Copy over the template readme file and replace variables
echo 'Generating readme...'
cp '../.github/workflows/template.md' README.md
Expand All @@ -144,8 +145,8 @@ for dir in */ ; do
# package generates documentation, then it will
# overwrite the GH pages archive with that dir only
echo 'Generating documentation...'
npm run docs || exit 1
mv docs "../.docs/${dir}"
npm run build || exit 1
mv docs "../${docdir}/${dir}"
# Reset the readme file to its original state
echo "${readme}" > README.md
fi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ nicfv's public NPM packages in one repository

## Developer Notes
- Each package must have the following scripts
- `build`
- `test`
- `docs`
- `clean`
- Something to compile on `npm publish`
- Each package must contain `README.md` and `CHANGELOG.md`
Expand Down
10 changes: 10 additions & 0 deletions datafit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 1.4.3

- Update dependency versions
- Minor documentation update for `F`
- Use global TypeDoc configuration file
- Compile and build documentation simultaneously
- Remove dependency on typescript (TypeDoc will take care of this)
- Remove declaration types for test on build output
- Output `tsc` version on `npm test`

## 1.4.2

- Update dependency versions
Expand Down
2 changes: 1 addition & 1 deletion datafit/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"clean": "rm -rf node_modules package-lock.json"
},
"dependencies": {
"datafit": "file:datafit-1.4.2.tgz"
"datafit": "file:datafit-1.4.3.tgz"
}
}
14 changes: 6 additions & 8 deletions datafit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datafit",
"version": "1.4.2",
"version": "1.4.3",
"description": "Simple curve-fitting algorithm",
"homepage": "https://npm.nicfv.com/datafit",
"bin": "",
Expand All @@ -11,12 +11,11 @@
"types"
],
"scripts": {
"build": "rm -rf dist types && tsc && node dist/test.js && rm dist/test.js",
"test": "tsc --noEmit",
"build": "rm -rf dist types docs && typedoc --options ../typedoc.json src && node dist/test.js && rm dist/test.js types/test.d.ts",
"test": "tsc -v && tsc --noEmit",
"clean": "rm -rf node_modules package-lock.json dist types docs",
"docs": "rm -rf docs && typedoc --includeVersion --disableSources --hideGenerator src",
"prepack": "npm run build",
"postpack": "rm -rf dist types"
"postpack": "npm run clean"
},
"keywords": [
"math",
Expand Down Expand Up @@ -51,11 +50,10 @@
"repository": "github:nicfv/npm",
"license": "MIT",
"dependencies": {
"smath": "1.7.0"
"smath": "1.8.1"
},
"devDependencies": {
"exray": "1.0.3",
"typedoc": "0.25.12",
"typescript": "5.4.4"
"typedoc": "0.25.13"
}
}
2 changes: 1 addition & 1 deletion datafit/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type VariableType = number | Array<number>;
* return a2 * x ** 2 + a1 * x + a0;
* }
* ```
* Multivariable function Typescript, general plane equation:
* Multivariable function in Typescript, general plane equation:
* ```ts
* function f([x, y]: number[], cx: number, cy: number, cz: number): number {
* return cx * x + cy * y + cz;
Expand Down
9 changes: 9 additions & 0 deletions dimensional/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.1.1

- Use global TypeDoc configuration file
- Compile and build documentation simultaneously
- Remove dependency on typescript (TypeDoc will take care of this)
- Remove declaration types for test on build output
- Output `tsc` version on `npm test`
- For now, export `lib`

## 0.1.0

- Install relevant dependencies
Expand Down
2 changes: 1 addition & 1 deletion dimensional/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"clean": "rm -rf node_modules package-lock.json"
},
"dependencies": {
"dimensional": "file:dimensional-0.1.0.tgz"
"dimensional": "file:dimensional-0.1.1.tgz"
}
}
12 changes: 5 additions & 7 deletions dimensional/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dimensional",
"version": "0.1.0",
"version": "0.1.1",
"description": "Dimensional analysis and unit conversions",
"homepage": "https://npm.nicfv.com/dimensional",
"bin": "",
Expand All @@ -11,12 +11,11 @@
"types"
],
"scripts": {
"build": "rm -rf dist types && tsc && node dist/test.js && rm dist/test.js",
"test": "tsc --noEmit",
"build": "rm -rf dist types docs && typedoc --options ../typedoc.json src && node dist/test.js && rm dist/test.js types/test.d.ts",
"test": "tsc -v && tsc --noEmit",
"clean": "rm -rf node_modules package-lock.json dist types docs",
"docs": "rm -rf docs && typedoc --includeVersion --disableSources --hideGenerator --excludePrivate --excludeProtected src",
"prepack": "npm run build",
"postpack": "rm -rf dist types"
"postpack": "npm run clean"
},
"keywords": [],
"author": {
Expand All @@ -35,7 +34,6 @@
},
"devDependencies": {
"exray": "1.0.3",
"typedoc": "0.25.13",
"typescript": "5.4.5"
"typedoc": "0.25.13"
}
}
3 changes: 2 additions & 1 deletion dimensional/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
* Exports the public-facing API for `dimensional`
*/
export * from './dimension';
export * from './unit';
export * from './unit';
export * from './lib';
9 changes: 9 additions & 0 deletions exray/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.0.4

- Use global TypeDoc configuration file
- Compile and build documentation simultaneously
- Remove dependency on typescript (TypeDoc will take care of this)
- Remove declaration types for test on build output
- Minor output change for test #1
- Output `tsc` version on `npm test`

## 1.0.3

- Update typescript dependency version to 5.4.4
Expand Down
5 changes: 4 additions & 1 deletion exray/examples/1-Assert-Boolean-Values.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ function alwaysReturnsFalse() {
return false;
}
// This test should pass
X.false(alwaysReturnsFalse());
X.false(alwaysReturnsFalse());

// Show that all tests passed.
console.log('All tests passed!');
2 changes: 1 addition & 1 deletion exray/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"clean": "rm -rf node_modules package-lock.json"
},
"dependencies": {
"exray": "file:exray-1.0.3.tgz"
"exray": "file:exray-1.0.4.tgz"
}
}
12 changes: 5 additions & 7 deletions exray/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exray",
"version": "1.0.3",
"version": "1.0.4",
"description": "Lightweight assertion testing framework",
"homepage": "https://npm.nicfv.com/exray",
"bin": "",
Expand All @@ -11,12 +11,11 @@
"types"
],
"scripts": {
"build": "rm -rf dist types && tsc && node dist/test.js && rm dist/test.js",
"test": "tsc --noEmit",
"build": "rm -rf dist types docs && typedoc --options ../typedoc.json src && node dist/test.js && rm dist/test.js types/test.d.ts",
"test": "tsc -v && tsc --noEmit",
"clean": "rm -rf node_modules package-lock.json dist types docs",
"docs": "rm -rf docs && typedoc --includeVersion --disableSources --hideGenerator src",
"prepack": "npm run build",
"postpack": "rm -rf dist types"
"postpack": "npm run clean"
},
"keywords": [
"except",
Expand All @@ -41,7 +40,6 @@
"repository": "github:nicfv/npm",
"license": "MIT",
"devDependencies": {
"typedoc": "0.25.12",
"typescript": "5.4.4"
"typedoc": "0.25.13"
}
}
8 changes: 8 additions & 0 deletions smath/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.8.2

- Use global TypeDoc configuration file
- Compile and build documentation simultaneously
- Remove dependency on typescript (TypeDoc will take care of this)
- Remove declaration types for test on build output
- Output `tsc` version on `npm test`

## 1.8.1

- Fix an extremely rare case in `rint()` where it could generate a value 1 below the minimum value, if the random number generated by `Math.random()` is *exactly* zero and the input range is negative. Realistically, this would never happen, the odds of this are about one in `2^53`, or one in 9 quadrillion. You would need to generate **one million** numbers every second consistently for 285 years for a chance to see this happen once.
Expand Down
2 changes: 1 addition & 1 deletion smath/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"clean": "rm -rf node_modules package-lock.json"
},
"dependencies": {
"smath": "file:smath-1.8.1.tgz"
"smath": "file:smath-1.8.2.tgz"
}
}
12 changes: 5 additions & 7 deletions smath/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smath",
"version": "1.8.1",
"version": "1.8.2",
"description": "Small math function library",
"homepage": "https://npm.nicfv.com/smath",
"bin": "dist/bin.js",
Expand All @@ -11,12 +11,11 @@
"types"
],
"scripts": {
"build": "rm -rf dist types && tsc && node dist/test.js && rm dist/test.js",
"test": "tsc --noEmit",
"build": "rm -rf dist types docs && typedoc --options ../typedoc.json src && node dist/test.js && rm dist/test.js types/test.d.ts",
"test": "tsc -v && tsc --noEmit",
"clean": "rm -rf node_modules package-lock.json dist types docs",
"docs": "rm -rf docs && typedoc --includeVersion --disableSources --hideGenerator --excludePrivate --excludeProtected src",
"prepack": "npm run build",
"postpack": "rm -rf dist types"
"postpack": "npm run clean"
},
"keywords": [
"small",
Expand Down Expand Up @@ -59,7 +58,6 @@
"devDependencies": {
"@types/node": "20.12.7",
"exray": "1.0.3",
"typedoc": "0.25.13",
"typescript": "5.4.5"
"typedoc": "0.25.13"
}
}
10 changes: 10 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"disableSources": true,
"emit": "both",
"excludeExternals": true,
"excludePrivate": true,
"excludeProtected": true,
"hideGenerator": true,
"includeVersion": true,
"treatValidationWarningsAsErrors": true,
}
9 changes: 9 additions & 0 deletions viridis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.1.2

- Update dependency versions
- Use global TypeDoc configuration file
- Compile and build documentation simultaneously
- Remove dependency on typescript (TypeDoc will take care of this)
- Remove declaration types for test on build output
- Output `tsc` version on `npm test`

## 1.1.1

- Update dependency versions
Expand Down
2 changes: 1 addition & 1 deletion viridis/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"clean": "rm -rf node_modules package-lock.json"
},
"dependencies": {
"viridis": "file:viridis-1.1.1.tgz"
"viridis": "file:viridis-1.1.2.tgz"
}
}
16 changes: 7 additions & 9 deletions viridis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viridis",
"version": "1.1.1",
"version": "1.1.2",
"description": "Color gradients for data visualization",
"homepage": "https://npm.nicfv.com/viridis",
"bin": "",
Expand All @@ -11,12 +11,11 @@
"types"
],
"scripts": {
"build": "rm -rf dist types && tsc && node dist/test.js && rm dist/test.js",
"test": "tsc --noEmit",
"build": "rm -rf dist types docs && typedoc --options ../typedoc.json src && node dist/test.js && rm dist/test.js types/test.d.ts",
"test": "tsc -v && tsc --noEmit",
"clean": "rm -rf node_modules package-lock.json dist types docs",
"docs": "rm -rf docs && typedoc --includeVersion --disableSources --hideGenerator src",
"prepack": "npm run build",
"postpack": "rm -rf dist types"
"postpack": "npm run clean"
},
"keywords": [
"color",
Expand All @@ -43,11 +42,10 @@
"repository": "github:nicfv/npm",
"license": "MIT",
"dependencies": {
"smath": "1.6.1"
"smath": "1.8.1"
},
"devDependencies": {
"exray": "1.0.2",
"typedoc": "0.25.12",
"typescript": "5.4.4"
"exray": "1.0.3",
"typedoc": "0.25.13"
}
}

0 comments on commit 90ef614

Please sign in to comment.