Coder Social home page Coder Social logo

republish as @koa/cors? about cors HOT 10 CLOSED

koajs avatar koajs commented on May 2, 2024 11
republish as @koa/cors?

from cors.

Comments (10)

ianstormtaylor avatar ianstormtaylor commented on May 2, 2024 2

Or even get the koa-cors maintainer to give up the name ideally.

But yeah, +1 because it's hard to remember what kcors is when looking through dependencies...

from cors.

stevehipwell avatar stevehipwell commented on May 2, 2024 1

I'm not sure that @koa/cors is the best name for this package as it's not consistent with the other core koa packages. Ideally you could get the koa-cors package name, otherwise maybe something more like koa-cors-official.

from cors.

stevehipwell avatar stevehipwell commented on May 2, 2024 1

@jonathanong - If this is the policy for all koa packages then it makes sense, however you might want to notify the relevant TypeScript definition authors that the package has moved as @koa/cors doesn't have any definitions but kcors does.

from cors.

raphaelsoul avatar raphaelsoul commented on May 2, 2024 1

currently I copy declare code from @types/koa2-cors to my index.d.ts

declare module "@koa/cors" {
    import * as Koa from 'koa';
    namespace cors {
        interface Options {
            origin?: string | ((ctx: Koa.Context) => boolean | string);
            exposeHeaders?: string[];
            maxAge?: number;
            credentials?: boolean;
            allowMethods?: string[];
            allowHeaders?: string[];
        }
    }

    function cors(options?: cors.Options): Koa.Middleware;

    export = cors;
}

from cors.

fengmk2 avatar fengmk2 commented on May 2, 2024

I'm ok for this. @jonathanong just do it and add a deprecated message on the kcors package.

from cors.

jonathanong avatar jonathanong commented on May 2, 2024

done

from cors.

jonathanong avatar jonathanong commented on May 2, 2024

i do not have access to kcors

from cors.

jonathanong avatar jonathanong commented on May 2, 2024

@stevehipwell we can slowly move koa packages to @koa/*, which would be somewhat ideal Imo

from cors.

vladshcherbin avatar vladshcherbin commented on May 2, 2024

The name without @ is better because now it differs from the rest of koa family and is the first one in dependency list, even above packages that start with a letter.

Will stick with kcors for now.

from cors.

fengmk2 avatar fengmk2 commented on May 2, 2024

done https://www.npmjs.com/package/@koa/cors

from cors.

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.