rstuven / curlyfy Goto Github PK
View Code? Open in Web Editor NEWAdd curly brackets to a whitespace indented string.
License: MIT License
Add curly brackets to a whitespace indented string.
License: MIT License
Hi,
Curlyfy looks great; would love to give it a try with webpack/babel. Is there a loader for it?
Any plan on generating sourcemaps and adding a command line tool to the npm package?
Hi,
I really have no idea what's going on here. The code when run through typescript works just fine. But when run through curlyfy-loader, typescript throws errors.
input (howdy.cts
):
export function howdy(): void {
console.log('Hi there, howdy!')
}
output from curlyfy (runs just fine when put through typescript-loader):
export function howdy(): void {
console.log('Hi there, howdy!')
}
webpack config:
module.exports = {
resolve: {
extensions: ['', '.ts', '.webpack.js', '.web.js', '.js', '.cjs', '.cts'] // note: I use .cts instead of .noncurly.ts, etc.
},
module: {
loaders: [
{ test: /\.noncurly\.js$/,
exclude: /node_modules/,
loader: 'babel!curlyfy'
},
{ test: /\.cjs$/,
exclude: /node_modules/,
loader: 'babel!curlyfy'
},
{ test: /\.ts$/,
exclude: /node_modules/,
loader: 'typescript-loader'
},
{ test: /\.cts$/,
exclude: /node_modules/,
loader: 'typescrip-loadert!curlyfy'
}
]
}
}
Traceback:
Hash: c013f1aa35af69143dd4
Version: webpack 1.9.4
Time: 1701ms
Asset Size Chunks Chunk Names
out.js 2.45 kB 0 [emitted] main
[0] ./index.js 180 bytes {0} [built] [1 error]
+ 3 hidden modules
ERROR in ./howdy.cts
Module build failed: TypeError: Cannot read property 'declarations' of undefined
at Object.getDeclarationOfKind (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:2826:34)
at checkFunctionLikeDeclaration (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:16767:43)
at checkFunctionDeclaration (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:16755:13)
at checkSourceElement (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:17652:28)
at Object.forEach (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:586:30)
at checkSourceFile (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:17781:20)
at getDiagnostics (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:17810:17)
at Object.hasSemanticErrors (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:18223:20)
at Object.emitFiles (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:10849:46)
at Object.invokeEmitter [as emitFiles] (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:18306:23)
at Object.getEmitOutput (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/typescript/bin/typescriptServices.js:24693:56)
at TypeScriptWebpackHost.<anonymous> (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/lib/TypeScriptWebpackHost.js:208:33)
at tryCatcher (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/bluebird/js/main/promise.js:454:31)
at Promise._settlePromiseAt (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromiseAtPostResolution (/Users/alex/djcode/curlyfiddle/node_modules/typescript-loader/node_modules/bluebird/js/main/promise.js:224:10)
@ ./index.js 2:12-30
curlyfy had worked at some point, but I can't get it working again...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.