Skip to content

Commit 1803391

Browse files
committed
Release js-migration branch
1 parent 5e6a7cf commit 1803391

6 files changed

+41
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## FusionAuth TypeScript Client
2-
![semver 2.0.0 compliant](http://img.shields.io/badge/semver-2.0.0-brightgreen.svg?style=flat-square)
2+
![semver 2.0.0 compliant](http://img.shields.io/badge/semver-2.0.0-brightgreen.svg?style=flat-square) ![npm](https://img.shields.io/npm/v/@fusionauth/typescript-client?style=flat-square)
33

44
If you're integrating FusionAuth with a Typescript application, this library will speed up your development time.
55

build.savant

+23-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,26 @@ target(name: "clean", description: "Cleans build directory") {
4444
}
4545

4646
target(name: "build", description: "Builds the js files") {
47-
def proc = 'npm install'.execute()
47+
def proc = 'npm ci'.execute()
4848
proc.consumeProcessOutput(System.out, System.err)
4949
proc.waitFor()
50+
if (proc.exitValue() != 0) {
51+
fail("Failed to get deps or compile typescript")
52+
}
53+
54+
proc = 'npm run build-browser'.execute()
55+
proc.consumeProcessOutput(System.out, System.err)
56+
proc.waitFor()
57+
if (proc.exitValue() != 0) {
58+
fail("Failed to build browser version of client")
59+
}
60+
61+
proc = 'npm run build-browser-min'.execute()
62+
proc.consumeProcessOutput(System.out, System.err)
63+
proc.waitFor()
64+
if (proc.exitValue() != 0) {
65+
fail("Failed to build minified browser version of client")
66+
}
5067
}
5168

5269
target(name: "int", description: "Releases a local integration build of the project", dependsOn: ["build"]) {
@@ -55,7 +72,11 @@ target(name: "int", description: "Releases a local integration build of the proj
5572
}
5673

5774
file.zip(file: "build/fusionauth-typescript-client.zip") {
58-
fileSet(dir: "build/src", includePatterns: [])
75+
fileSet(dir: "build", includePatterns: [
76+
~/index.*(js|ts)/,
77+
~/src\/+/
78+
])
79+
fileSet(dir: "dist", includePatterns: [~/fusionauth-typescript-client\..*js/])
5980
}
6081
}
6182

index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* language governing permissions and limitations under the License.
1515
*/
1616

17+
import FusionAuthClient from './src/FusionAuthClient'
18+
export default FusionAuthClient;
19+
1720
export * from './src/FusionAuthClient';
1821
export * from './src/IRESTClient';
1922
export * from './src/DefaultRESTClientBuilder';

package.json

+9-7
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
"build/src/*.d.ts",
1515
"build/*.js",
1616
"build/*.js.map",
17-
"build/*.d.ts"
17+
"build/*.d.ts",
18+
"dist/fusionauth-typescript-client.*"
1819
],
1920
"scripts": {
2021
"test": "karma start && mocha build/test/FusionAuthClientTest.js",
21-
"build-browser": "npx browserify index.ts --debug -p tsify -o dist/fusionauth-typescript-client.js",
22-
"pretest": "npx browserify test/FusionAuthClientTest.ts -t envify --debug -p tsify -o dist/fusionauth-typescript-client-test.js && npx tsc",
22+
"build-browser": "npx browserify index.ts --standalone FusionAuth --debug -p [ tsify --target=es5 ] -o dist/fusionauth-typescript-client.js",
23+
"build-browser-min": "npx browserify index.ts --standalone FusionAuth --debug -p [ tsify --target=es5 ] -t uglifyify | npx uglifyjs --source-map base -o dist/fusionauth-typescript-client.min.js",
24+
"pretest": "npx browserify test/FusionAuthClientTest.ts --debug -t envify -p [ tsify --target=es5 ] -t uglifyify | npx uglifyjs --source-map base -o dist/fusionauth-typescript-client-test.min.js && npx tsc",
2325
"prepare": "npx tsc"
2426
},
2527
"repository": {
@@ -52,12 +54,12 @@
5254
"mocha": "^7.0.0",
5355
"mocha-typescript": "^1.1.17",
5456
"tsify": "^4.0.1",
55-
"typescript": "^3.7.4"
57+
"typescript": "^3.7.4",
58+
"uglify-js": "^3.8.1",
59+
"uglifyify": "^5.0.2"
5660
},
5761
"dependencies": {
5862
"cross-fetch": "^3.0.4"
5963
},
60-
"browser": {
61-
"chai": ""
62-
}
64+
"browser": "dist/fusionauth-typescript-client.min.js"
6365
}

src/FusionAuthClient.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -3362,6 +3362,8 @@ export class FusionAuthClient {
33623362
}
33633363
}
33643364

3365+
export default FusionAuthClient;
3366+
33653367
/**
33663368
* A function that returns the JSON form of the response text.
33673369
*
@@ -3395,7 +3397,7 @@ async function ErrorJSONResponseHandler<ERT>(response: Response): Promise<Client
33953397
/**
33963398
* A 128 bit UUID in string format "8-4-4-4-12", for example "58D5E212-165B-4CA0-909B-C86B9CEE0111".
33973399
*/
3398-
type UUID = string;
3400+
export type UUID = string;
33993401

34003402

34013403
/**

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"exclude": [
1313
"node_modules",
14-
"build"
14+
"build",
15+
"dist"
1516
]
1617
}

0 commit comments

Comments
 (0)