New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

reactifex

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactifex - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

bash_scripts/hashed_data.txt

10

main.js

@@ -26,12 +26,8 @@ #!/usr/bin/env node

var messageInfo = JSON.parse(fs.readFileSync(__dirname + "/bash_scripts/hashmap.json"));
var scriptPath = __dirname + "/bash_scripts/put_comments.sh";
fs.writeFileSync(scriptPath, "#!/bin/bash\n");
var dataPath = __dirname + "/bash_scripts/hashed_data.txt";
fs.writeFileSync(dataPath, "");
inData.forEach((message) => {
var info = messageInfo.find(mi => mi.key == message.id);
if (info) {
var header = " -H \"Content-Type: application/json\"";
var escapedDescription = message.description.replace(/(["])/g, "\\\\\\$1");
var data = " --data \"{\\\"comment\\\": \\\"" + escapedDescription + "\\\"}\"";
var url = " $1" + info.string_hash;
fs.appendFileSync(scriptPath, "curl -L -w \"\\n\" --user $SECRET_USER:$SECRET_PWD -X PUT" + header + data + url + "\n");
fs.appendFileSync(dataPath, info.string_hash + "|" + message.description + "\n");
} else {

@@ -38,0 +34,0 @@ process.stdout.write("string " + message.id + " does not yet exist on transifex!\n");

{
"name": "reactifex",
"version": "1.0.1",
"version": "1.0.2",
"description": "A helper for moving react-intl messages to transifex and back",

@@ -9,3 +9,3 @@ "bin": "./main.js",

"test_compile": "node main.js test_data/input/ test_data/test_output.json && diff test_data/test_output.json test_data/expected_output/messages.json",
"test_comments": "node main.js test_data/input/ --comments && diff bash_scripts/put_comments.sh test_data/expected_output/put_comments.sh"
"test_comments": "node main.js test_data/input/ --comments && SECRET_USER=uname SECRET_PWD=password bash -x ./bash_scripts/put_comments.sh http://totally_real.notfake.com/api/ 2>&1 | grep PUT > output.txt && diff -w output.txt test_data/expected_output/test_curl.txt"
},

@@ -12,0 +12,0 @@ "repository": {

@@ -41,4 +41,4 @@ # reactifex

- Next, the main reactifex script (node js) runs with an additional `--comments` flag, and no output file. This has the effect of gathering up all your `babel-plugin-react-intl` extracted messages *with* their comments attached. From there, it's simple enough to match up each message with its `string_hash`, and makes it possible to generate `bash_scripts/put_comments.sh` (a series of curl requests, one per message)
- Next, the main reactifex script (node js) runs with an additional `--comments` flag, and no output file. This has the effect of gathering up all your `babel-plugin-react-intl` extracted messages *with* their comments attached. From there, it's simple enough to match up each message with its `string_hash`, and save these pairs in a '|'-delimited list, for later consumption.
- Finally, `bash_scripts/put_comments.sh` is run with the base PUT url as an argument (we generated the specific `string_hash` portion in the previous step), updating translator comments for each message on Transifex via their API.
- Finally, `bash_scripts/put_comments.sh` is run with the base PUT url as an argument (also reads the data file we created in the previous step), updating translator comments for each message on Transifex via their API.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc