Skip to content

Commit

Permalink
chore(applet-js): Switch to JS-YAML for consistency (#950)
Browse files Browse the repository at this point in the history
Switch to JS-YAML, in order to use the same library than the CDK Toolkit.
  • Loading branch information
RomainMuller authored Oct 17, 2018
1 parent e907d84 commit e790db5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/@aws-cdk/applet-js/bin/cdk-applet-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import 'source-map-support/register';

import cdk = require('@aws-cdk/cdk');
import fs = require('fs-extra');
import path = require('path');

// tslint:disable-next-line:no-var-requires
const YAML = require('yamljs');
const YAML = require('js-yaml');

main().catch(e => {
// tslint:disable-next-line:no-console
Expand All @@ -22,7 +23,7 @@ async function main() {
}

// read applet properties from the provided file
const props = YAML.load(appletFile);
const props = YAML.safeLoad(await fs.readFile(appletFile, { encoding: 'utf-8' }));

// the 'applet' attribute tells us how to load the applet. in the javascript case
// it will be in the format <module>:<class> where <module> is technically passed to "require"
Expand Down
7 changes: 5 additions & 2 deletions packages/@aws-cdk/applet-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
},
"dependencies": {
"@aws-cdk/cdk": "^0.12.0",
"source-map-support": "^0.5.6",
"yamljs": "^0.2.0"
"@types/fs-extra": "^5.0.4",
"@types/js-yaml": "^3.11.2",
"fs-extra": "^7.0.0",
"js-yaml": "^3.12.0",
"source-map-support": "^0.5.6"
},
"repository": {
"url": "https://github.com/awslabs/aws-cdk.git",
Expand Down

0 comments on commit e790db5

Please sign in to comment.