Giter VIP home page Giter VIP logo

pdf-export-component's Introduction

PDF Export Component Wrapper - @react-pdf

This is a module for using API like wrappers for getting food data for use in many projects. Just Like an database and fetch API in JS

Build Status JavaScript Style Guide

Maintainability

Test Coverage

npm version

Table of Contents

Quick Start

Several quick start options are available:

  • Clone the repo: git clone https://github.com/GroceriStar/pdf-export.git
  • Install with npm: npm install @groceristar/pdf-export
  • Install with yarn: yarn add @groceristar/pdf-export

What's included

Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:

//@TODO update readme

.
├── docs
│   └── readme.md           # Secondary information about project
└── src               
    ├── projects            # Tests for self-titled projects
    │   ├── ChickenKyiv
    │   ├── GraphQL
    │   ├── GroceriStar
    │   ├── GS-Loopback
    │   ├── MealCalendar
    │   ├── Search
    │   ├── Showcase
    │   └── UnitConvertion
    ├── import
    ├── index.js    
    ├── index.test.js     
    └── utils.js    
.gitignore
README.md
package.json
babel.config.js
jest.config.js
rollup.config.js
LICENSE

We provide compiled JS, as well as compiled and minified JS.

To Find out about all the functionality use https://groceristar.github.io/groceristar-fetch/.

Contributors

@vadim9999, @atherdon, @hirdbluebird

@TODO review latest changes, that was made in @react-pdf and maybe update/improve our code base

pdf-export-component's People

Contributors

atherdon avatar dependabot-support avatar dependabot[bot] avatar hirdbluebird avatar renovate-bot avatar snyk-bot avatar souzasmatheus avatar vadim9999 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

pdf-export-component's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @babel/plugin-proposal-class-properties Unavailable
npm babel-preset-es2015 Unavailable
npm npm-run-all Available
npm rollup-plugin-babel Available
npm rollup-plugin-commonjs Unavailable
npm rollup-plugin-node-resolve Available
npm rollup-plugin-replace Unavailable
npm rollup-watch Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency npm-run-all with npm-run-all2 5.0.0
  • chore(deps): replace dependency rollup-plugin-node-resolve with @rollup/plugin-node-resolve 6.0.0
  • chore(deps): update dependency standard to v17.1.0
  • fix(deps): update dependency @react-pdf/renderer to v2.3.0
  • fix(deps): update dependency antd to v4.24.16
  • fix(deps): update dependency eslint to v8.57.0
  • chore(deps): update dependency babel-plugin-module-resolver to v5
  • chore(deps): update dependency browser-sync to v3
  • chore(deps): update dependency rollup to v4
  • fix(deps): update dependency antd to v5
  • fix(deps): update dependency eslint to v9
  • fix(deps): update dependency uuid to v10
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @babel/cli ^7.4.4
  • @react-pdf/renderer ^2.1.2
  • antd ^4.0.0
  • babel-preset-es2015 ^6.24.1
  • eslint ^8.0.0
  • uuid ^8.0.0
  • snyk ^1.465.0
  • @babel/cli 7.8.4
  • @babel/core 7.9.0
  • @babel/plugin-proposal-class-properties 7.8.3
  • @babel/plugin-proposal-decorators 7.8.3
  • @babel/plugin-syntax-dynamic-import 7.8.3
  • @babel/plugin-transform-react-jsx-compat 7.8.3
  • @babel/plugin-transform-react-jsx-self 7.9.0
  • @babel/plugin-transform-runtime 7.9.0
  • @babel/preset-env 7.9.0
  • @babel/preset-react 7.9.4
  • babel-plugin-external-helpers 6.22.0
  • babel-plugin-module-resolver 4.1.0
  • browser-sync 2.26.14
  • coveralls 3.0.11
  • enzyme 3.11.0
  • enzyme-adapter-react-16 1.15.2
  • jest 28.1.0
  • npm-run-all 4.1.5
  • react 18.1.0
  • react-dom 18.1.0
  • rollup 2.46.0
  • rollup-plugin-babel 4.4.0
  • rollup-plugin-commonjs 10.1.0
  • rollup-plugin-node-globals 1.4.0
  • rollup-plugin-node-resolve 5.2.0
  • rollup-plugin-replace 2.2.0
  • rollup-plugin-uglify 6.0.4
  • rollup-watch 4.3.1
  • shx 0.3.4
  • snazzy 9.0.0
  • standard 17.0.0
  • react ^16.8.4 || ^17.0.0 || ^18.0.0
  • react-dom ^16.8.4 || ^17.0.0 || ^18.0.0
  • npm >=3.0.0
  • node >=6.0.0
travis
.travis.yml
  • node 10

  • Check this box to trigger a request for Renovate to run again on this repository

improve our code

in order to see warnings that we have (we're using module standard, but it's just a wrapper around ESLint) - you need to run yarn code-fix and you'll see warnings that we have
This can be your second task @ronniebhatt

React task

  1. make one entry point for importing styles for different types of document styles
  2. improve this construction. The goal is to reduce the size of this component, simplify logic and it should work https://github.com/GroceriStar/pdf-export-component/blob/master/src/components/DocumentLayouts.js#L24-L44

Take time, think, review the whole code of the package. There a lot of hints, that should or could help you. If you will not be able to solve this task - that I'm not sure if you're ready to follow my lead @ronniebhatt

looks like a mistake

Describe the bug
A clear and concise description of what the bug is.
image

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

component should contain

  • inside DocumentLayouts we should have one of RenderList by passing different type
  • DownloadLink -> Button with PDFDownloadLink
  • RenderList
  • GeneratePDFButton
  • ...

example:

describe('<MyComponent />', () => {
  
  it('renders a header', () => {
    const wrapper = shallow(<MyComponent />);
    expect(wrapper.contains(<h1>My Component</h1>)).toBe(true);
  });

  it('renders three <Foo /> components', () => {
    const wrapper = shallow(<MyComponent />);
    expect(wrapper.find(Foo).length).toBe(3);
  });
  
  it('expects to change the status when clicking the button', () => {
    const wrapper = shallow(<MyComponent />);
    
    expect(wrapper.state().status).toBe(false);
    expect(wrapper.contains(<p>Status is {'Off'}</p>)).toBe(true);
  
    wrapper.find('button').simulate('click');
    
    expect(wrapper.state().status).toBe(true);
    expect(wrapper.contains(<p>Status is {'On'}</p>)).toBe(true);
  });
  
});

Bug when starting build

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
sudo npm run build

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@groceristar/[email protected] prebuild /home/vadim/work/javascript/pdf-export-component
npm run std --silent

internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module 'prelude-ls'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/vadim/work/javascript/pdf-export-component/node_modules/levn/lib/parse-string.js:4:12)
at Object. (/home/vadim/work/javascript/pdf-export-component/node_modules/levn/lib/parse-string.js:113:4)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

@groceristar/[email protected] build /home/vadim/work/javascript/pdf-export-component
rollup -c config/prod.js

Error: ENOENT: no such file or directory, lstat '/home/vadim/work/javascript/pdf-export-component/config/prod.js'
at Object.realpathSync (fs.js:1461:7)
at runRollup (/home/vadim/work/javascript/pdf-export-component/node_modules/rollup/bin/rollup:3929:20)
at Object. (/home/vadim/work/javascript/pdf-export-component/node_modules/rollup/bin/rollup:4014:2)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @groceristar/[email protected] build: rollup -c config/prod.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @groceristar/[email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/vadim/.npm/_logs/2019-06-23T20_34_48_241Z-debug.log

bug of react-pdf

it's without header
image
but when I add header the space between boxes are random like this
image

basic tests. part1

all RenderList* components should have *test file with describe, related to passing data attribute.

sample of how we use one fo these components:

<View style={styles.direction}>
            <RenderLists2 data={data} />

          </View>

Note: by default data is array, but pay attention.

testing pt2

we have different layout types.
and this layout types expect a different data structures inside of them. so if layout expect to have an id - we should pass it. if no - then we should alarm about it

question

at our Document layouts i see this line
but we don't have this files. Am i right that we didn't move them from showcase, right? or we don't need them

duplicated components

i think it's obvious task

when i see this import, it's easy to find out what should be improved.
https://github.com/GroceriStar/pdf-export-component/blob/master/src/index.js#L15-L29

So right now we have 4 components that triplicated, because we have 3 different cases for displaying data.
But i also want to have 4th case to add, but this will be a problem - because a lot of code is similar.
I think we should create some sort of a component, where we'll pass a type property and it'll define which case we'll cover.

https://www.freecodecamp.org/news/introducing-the-single-element-pattern-dfbd2c295c5d/

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Is it was created as task at GitHub issues? Please provide an issue number or link

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

simple task

All is simple:

  • review our current codebase
  • find out that we have 4 components that doing the same thing
  • make one component that will work in our 4 cases
  • after publishing on npm - install to react-pdf-sandbox and check is everything working OK
    @hirdbluebird do you want to grab it?

finish my reogranizations

I decide to reduce confusion, it should make our components clearner.
You can see what I did at RenderLists1. Please apply the same logic to our other RenderList components

old links to pdf stuff

preparation for publish

I moved maybe everything files, related too our pdf functionality from showcase.
You should check everything after me:
folder structure
import structure, connection between files, etc...

when everything will be good - please run build and publish at npm.
then install this package at https://github.com/GroceriStar/react-print-pdf and recreate the logic that we had at showcase. this will be our major place to test pdf stuff. and when we'll need - we'll update our separated react package - reconnect it here, test and when everything will be perfect - we'll move it into showcase - and clean it up there...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.