Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dist
examples/.dat
static/*.bundle.js*
static/*.worker.js*
static/*.ttf
test/lib/test-data
bin/test-data
translations
Expand Down
7 changes: 3 additions & 4 deletions .storybook/__mocks__/fs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { action } = require('@storybook/addon-actions')
const through = require('through2')
const concat = require('concat-stream')
const FileSaver = require('file-saver')
Expand All @@ -8,18 +7,18 @@ module.exports = {
const stream = through()
stream.pipe(
concat(data => {
action('fs.createWriteStream')(filepath)
console.log('fs.createWriteStream', filepath)
})
)
return stream
},
writeFile: (filepath, data, cb) => {
action('fs.writeFile')(filepath)
console.log('fs.writeFile', filepath)
const blob = new Blob([data], { type: 'application/octet-stream' })
FileSaver.saveAs(blob, filepath)
cb()
},
readFileSync: filepath => {
action('fs.readFileSync')(filepath)
console.log('fs.readFileSync', filepath)
}
}
15 changes: 15 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const path = require('path')

module.exports = {
webpackFinal: async (config, { configType }) => {
// Configure worker-loader for PDF renderer
config.module.rules.unshift({
test: /\.worker\.js$/,
include: path.join(__dirname, '../src'),
use: [{ loader: 'worker-loader' }, { loader: 'babel-loader' }]
})

// Return the altered config
return config
}
}
2 changes: 1 addition & 1 deletion flow-typed/npm/@react-pdf/renderer_vx.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare module '@react-pdf/renderer' {
|}
declare type ImagePropTypes = {|
wrap?: boolean,
src?: string,
src?: string | Promise<{ data: Buffer, format: 'png' | 'jpg' }>,
style?: any,
debug?: boolean,
fixed?: boolean,
Expand Down
Loading