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

alamode

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alamode - npm Package Compare versions

Comparing version 1.6.1 to 1.7.0

17

build/index.js
const { addHook } = require('pirates');
let transpileJsx = require('@a-la/jsx'); if (transpileJsx && transpileJsx.__esModule) transpileJsx = transpileJsx.default;
const { syncTransform } = require('./lib/transform');
let added
/** Enable transpilation of files on-the file as a require hook. */
const alamode = () => {
const alamode = ({
pragma = 'const { h } = require("preact");',
} = {}) => {
if (added) return
added = true
addHook(

@@ -13,4 +19,13 @@ (code, filename) => {

)
addHook(
(code, filename) => {
const r = syncTransform(code, filename, true)
const res = transpileJsx(r, { quoteProps: 1 })
const hc = `${pragma}${res}`
return hc
},
{ exts: ['.jsx'] }
)
}
module.exports=alamode

5

build/lib/transform.js

@@ -103,4 +103,5 @@ const { Replaceable } = require('restream');

*/
const syncTransform = (source, filename, advanced) => {
const replaced = transformString(source, advanced)
const syncTransform = (source, filename, noMap) => {
const replaced = transformString(source)
if (noMap) return replaced
const file = basename(filename)

@@ -107,0 +108,0 @@ const sourceRoot = dirname(filename)

@@ -0,1 +1,7 @@

## 24 January 2019
### 1.7.0
- [feature] Add `JSX` hook.
## 9 December 2018

@@ -2,0 +8,0 @@

{
"name": "alamode",
"version": "1.6.1",
"version": "1.7.0",
"description": "A Regex-based Transpiler Of Source Code To Allow Writing Import And Export Statements.",

@@ -19,3 +19,3 @@ "main": "build",

"build": "yarn-s b doc",
"b": "yarn dev src -o build2 -i bin/index.js -s",
"b": "yarn dev src -o build -i bin/index.js -s",
"bf": "yarn dev test/fixture/src -o build2"

@@ -65,2 +65,3 @@ },

"eslint-config-artdeco": "1.0.1",
"preact": "8.4.2",
"snapshot-context": "2.0.4",

@@ -75,2 +76,3 @@ "spawncommand": "2.1.0",

"@a-la/import": "1.7.0",
"@a-la/jsx": "1.2.2",
"@a-la/markers": "1.0.3",

@@ -77,0 +79,0 @@ "@wrote/ensure-path": "1.0.3",

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