Skip to content

Commit 717e5d1

Browse files
authored
Merge pull request #7 from ianacaburian/develop
v1
2 parents 76581d6 + 0ca6753 commit 717e5d1

17 files changed

+29
-23
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
- name: Install dependencies
3636
run: npm install
3737

38-
- name: Lint, install tests, and build package.
38+
- name: Lint, install tests, and build package
3939
run: npm run build
4040

41-
- name: Perform single test run.
41+
- name: Perform single test run
4242
run: npm run test run

README.md

+21-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
Ports juce_KeyGeneration::generateKeyFile() to node.
44

5-
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ianacaburian/generate-key-file/build.yml)
6-
![NPM Version](https://img.shields.io/npm/v/%40ianacaburian%2Fgenerate-key-file)
7-
![GitHub License](https://img.shields.io/github/license/ianacaburian/generate-key-file)
8-
![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ianacaburian)
5+
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ianacaburian/generate-key-file/build.yml)](https://github.com/ianacaburian/generate-key-file/actions)
6+
[![NPM Version](https://img.shields.io/npm/v/%40ianacaburian%2Fgenerate-key-file)](https://www.npmjs.com/package/@ianacaburian/generate-key-file)
7+
[![X (formerly Twitter) URL](https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2Fintent%2Fpost%3Ftext%3DNeed%2520to%2520auth%2520a%2520JUCE%2520app%2520in%2520nodejs%2520%253F%2520Check%2520out%2520generate-key-file%2520by%2520%2540ianacaburian%2520%2520%26url%3Dhttps%253A%252F%252Fgithub.com%252Fianacaburian%252Fgenerate-key-file)](https://twitter.com/intent/tweet?text=Need%20to%20auth%20a%20JUCE%20app%20in%20nodejs%20%3F%20Check%20out%20generate-key-file%20by%20%40ianacaburian%20%20&url=https%3A%2F%2Fgithub.com%2Fianacaburian%2Fgenerate-key-file)
98

109
## Installation
1110

@@ -15,7 +14,15 @@ npm i @ianacaburian/generate-key-file
1514

1615
## Usage
1716

18-
- `generateKeyFile(params: GenerateKeyFileParams, date: Date = new Date()) => string`
17+
### `generateKeyFile`
18+
19+
- Signature:
20+
21+
```
22+
generateKeyFile(params: GenerateKeyFileParams, date: Date = new Date()) => string
23+
```
24+
25+
- Example:
1926

2027
```
2128
import { generateKeyFile } from '@ianacaburian/generate-key-file'
@@ -54,7 +61,15 @@ const keyFileContent = generateKeyFile({
5461
*/
5562
```
5663

57-
- `generateExpiringKeyFile(params: GenerateExpiringKeyFileParams, date: Date = new Date()) => string`
64+
### `generateExpiringKeyFile`
65+
66+
- Signature:
67+
68+
```
69+
generateExpiringKeyFile(params: GenerateExpiringKeyFileParams, date: Date = new Date()) => string
70+
```
71+
72+
- Example:
5873

5974
```
6075
import { generateExpiringKeyFile } from '@ianacaburian/generate-key-file'

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ianacaburian/generate-key-file",
3-
"version": "0.1.3",
3+
"version": "1.0.0",
44
"description": "Ports juce_KeyGeneration::generateKeyFile() to node.",
55
"type": "module",
66
"main": "./dist/index.js",
@@ -14,7 +14,7 @@
1414
"lint": "eslint src",
1515
"clean:test": "rm -rf test/bin/* && cd test/console && ./script/clean-build.sh",
1616
"open:test/console": "cd test/console && ./script/open-xcode-macos-dev.sh",
17-
"install:test/console": "cmake -S test/console -B test/console/build && cmake --build test/console/build && cmake --install test/console/build --prefix test/bin",
17+
"install:test/console": "cmake -S test/console -B test/console/build && cmake --build test/console/build && cmake --install test/console/build --prefix test",
1818
"build": "npm run lint && npm run install:test/console && tsup",
1919
"test": "vitest"
2020
},

src/juce/JuceKeyFileUtils.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ const xmlAttributeValueProcessor = (value: unknown): string =>
3838
const xmlBuilder = new XMLBuilder({
3939
ignoreAttributes: false,
4040
suppressEmptyNode: true,
41-
processEntities: false, // Disabled since it doesn't port to juce as is
41+
// processEntities is disabled since it doesn't port to juce as is
42+
processEntities: false,
4243
attributeValueProcessor: (_, value) => xmlAttributeValueProcessor(value)
4344
})
4445

@@ -62,7 +63,7 @@ export class JuceKeyFileUtils {
6263
'@_email': userEmail,
6364
[`@_${machineNumbersAttributeName}`]: machineNumbers,
6465
'@_app': appName,
65-
'@_date': date, // Does not affect key file decryption
66+
'@_date': date,
6667
...(expiryTime ? { '@_expiryTime': expiryTime } : {})
6768
}
6869
}

src/test/JuceKeyGeneration.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ describe('JuceKeyGeneration', () => {
208208
)
209209
}
210210
)
211-
// { numRuns: 50000, seed: 1 }
212211
)
213212
console.log(latest)
214213
})

src/test/test-utils.ts

-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ export const hexArbitrary = fc.string({
88
maxLength: 1000
99
})
1010

11-
export const rsaKeyArbitrary = fc.string({
12-
unit: fc.constantFrom(...'0123456789abcdef'),
13-
minLength: 300,
14-
maxLength: 1000
15-
})
16-
1711
export const execTestBin = (bin: string, input?: string): string => {
1812
try {
1913
return execSync(path.join(__dirname, '..', '..', 'test', 'bin', bin), {

test/bin/apply-key-file

0 Bytes
Binary file not shown.

test/bin/apply-to-value

0 Bytes
Binary file not shown.

test/bin/create-key-file

0 Bytes
Binary file not shown.

test/bin/create-key-file-comment

0 Bytes
Binary file not shown.

test/bin/create-key-file-content-line

0 Bytes
Binary file not shown.

test/bin/create-key-pair

0 Bytes
Binary file not shown.

test/bin/divide-by

0 Bytes
Binary file not shown.

test/bin/encrypt-xml-line

0 Bytes
Binary file not shown.

test/bin/exponent-modulo

0 Bytes
Binary file not shown.

test/bin/load-from-memory-block

0 Bytes
Binary file not shown.

test/console/cmake/ConfigTarget.cmake

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ macro(console_config_target TARGET_NAME)
2121
PRIVATE
2222
${PROJECT_SOURCE_DIR}
2323
)
24-
set(console_INSTALL_DIR "${PROJECT_SOURCE_DIR}/../bin")
2524
install(TARGETS ${TARGET_NAME}
26-
RUNTIME DESTINATION "${console_INSTALL_DIR}"
27-
LIBRARY DESTINATION "${console_INSTALL_DIR}"
28-
ARCHIVE DESTINATION "${console_INSTALL_DIR}"
25+
RUNTIME DESTINATION "bin"
2926
)
3027
endmacro()

0 commit comments

Comments
 (0)