GithubHelp home page GithubHelp logo

Type declarations about react-env HOT 15 CLOSED

andrewmclagan avatar andrewmclagan commented on June 6, 2024
Type declarations

from react-env.

Comments (15)

AnthonyCrowcroft avatar AnthonyCrowcroft commented on June 6, 2024 1

@vimutti77 if you look within the dist directory there is a types.d.ts file if you copy and paste that into your solution it will work, I'm currently looking into why this isnt being picked up automatically

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024 1

released: https://www.npmjs.com/package/@beam-australia/react-env

from react-env.

AnthonyCrowcroft avatar AnthonyCrowcroft commented on June 6, 2024 1

@andrewmclagan thank you for sorting that man been slammed at work today so wasn't going to get to it till tonight

from react-env.

AnthonyCrowcroft avatar AnthonyCrowcroft commented on June 6, 2024 1

I'm currently not using the docker image as we are react applications within IIS still but future goal is move it to azure blob storage or the likes. The main motivator for us to use the library was to be able to do deployment time injections so we can do a build once deploy anywhere approach

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024

Hello. For sure, I'd accept a PR for this.

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024

Great your PR is merged and should be released as v2.1.0 thank you

@AnthonyCrowcroft

from react-env.

AnthonyCrowcroft avatar AnthonyCrowcroft commented on June 6, 2024

While the definition is correct I still needed to shim this in so if you'd be happy to reopen it I will do more research to get this pulling through correctly, apologises was to eager to get it done.

from react-env.

vimutti77 avatar vimutti77 commented on June 6, 2024

How can I use it. I try to use it like this

import env from '@beam-australia/react-env';

export default {
  secret: new URL(env('MY_SECRET')),
};

and I got this error

Could not find a declaration file for module '@beam-australia/react-env'

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024

@AnthonyCrowcroft?

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024
{
    "name": "awesome",
    "author": "Vandelay Industries",
    "version": "1.0.0",
    "main": "./lib/main.js",
    "types": "./lib/main.d.ts"
}

Want to write a PR. You reference them in package json

from react-env.

vimutti77 avatar vimutti77 commented on June 6, 2024

@AnthonyCrowcroft Look like if I try to move types.d.ts from node_modules/@beam-australia/react-env/dist to node_modules/@beam-australia/react-env and rename it to index.d.ts. The types will be picked up properly.

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024

Yeah although this is not desirable. We want it to pick them up via package.json

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024

#10

will release as v2.1.1

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024

@vimutti77 you can now npm install and use as normal

from react-env.

andrewmclagan avatar andrewmclagan commented on June 6, 2024

No problem. Out of interest, you guys using the docker image in this repo for CRA?

from react-env.

Related Issues (20)

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.