5.1.2 • Published 2 months ago

@feinarbyte/pluginbase v5.1.2

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
2 months ago

don't repeat your self

coding is fun, but many projects and frameworks end up in a lot of repetetive tedious work. Ofen the task is not very complex but automating it would take to much time. Goal of this project is to minimize the time required to define a simple pattern and apply it to your codebase.

It is done in form of a visual studio code extension, that allows to define small patterns.

export const AutoThunk: Pattern<MethodDeclaration> = {
    // filter projects in which to look for the pattern
    sourceProjects: (lp) => lp.config.type === "backend",
    // filter projects that might be relevant to the pattern
    targetProjects: (lp) => lp.config.type === "frontend",
    // a ts-query selector to match all method declarations that have a certain decorator
    query: `MethodDeclaration:has(Decorator Identifier[name="Query"],[name="Mutation"],[name="Subscription"])`,
    // this will render the text of each vs-code lens
    title: (node, context, target) => `+thunk in ${target.config.name ?? target.config.type}`,
    // include/exclude pathes
    include: [/Resolver.ts/, /\.resolver\.ts/],
    // the handler that will be executed 
    handler: function* (node, context, target) {
        // some custom code
        yield* createThunk(node, target, context);
    },
};

This subproject is for some usefull code

types and definitions

  • Pattern: allows to quickly define a pattern
  • Plugin: probably obsoleted by pattern
  • LoadedProject: representation of the various projects in a workspace
  • FileEditOperations: operations that can be generated by patterns and plugins

helper code

  • refToNode: get a referrenced node from typeReference or Identifier
  • shared: helpers to use ts-query on ts-morph
  • writeType: cleanup type from import
5.1.2

2 months ago

5.1.1

8 months ago

5.1.0

8 months ago

5.0.1

8 months ago

5.0.0-0

1 year ago

5.0.0

12 months ago

4.5.0

1 year ago

4.4.0

1 year ago

4.2.2

1 year ago

4.6.0

1 year ago

4.3.0

1 year ago

4.2.1

1 year ago

4.1.0

1 year ago

4.0.1

1 year ago

4.1.2

1 year ago

4.2.0

1 year ago

4.1.1

1 year ago

4.0.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.0

1 year ago

4.0.0

1 year ago

2.5.0

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.3.4

1 year ago

2.4.2

1 year ago

2.3.3

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

1.3.0

1 year ago

2.3.0

1 year ago

2.0.3

1 year ago

2.2.0

1 year ago

2.0.2

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

0.20.2

2 years ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

0.20.1

2 years ago

0.20.0

2 years ago

0.19.1

2 years ago

0.19.0

2 years ago

0.18.1

2 years ago

0.18.0

2 years ago

0.17.0

2 years ago

0.16.1

2 years ago