Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Add SDK library generator #50

Merged
merged 9 commits into from
Aug 13, 2022
Merged

Add SDK library generator #50

merged 9 commits into from
Aug 13, 2022

Conversation

domjtalbot
Copy link
Owner

@domjtalbot domjtalbot commented Aug 9, 2022

sdk

Create a GraphQL Mesh SDK library for Nx.

nx generate @domjtalbot/nx-plugin-graphql-mesh:sdk my-mesh-sdk

# Alias
nx generate @domjtalbot/nx-plugin-graphql-mesh:sdk-library my-mesh-sdk
nx generate @domjtalbot/nx-plugin-graphql-mesh:library my-mesh-sdk

Example Output

TSC
>  NX  Generating @domjtalbot/nx-plugin-graphql-mesh:sdk

CREATE libs/my-mesh-sdk/README.md
CREATE libs/my-mesh-sdk/.babelrc
CREATE libs/my-mesh-sdk/package.json
CREATE libs/my-mesh-sdk/src/index.ts
CREATE libs/my-mesh-sdk/tsconfig.json
CREATE libs/my-mesh-sdk/tsconfig.lib.json
UPDATE tsconfig.base.json
CREATE libs/my-mesh-sdk/project.json
UPDATE workspace.json
CREATE libs/my-mesh-sdk/.eslintrc.json
CREATE libs/my-mesh-sdk/jest.config.ts
CREATE libs/my-mesh-sdk/tsconfig.spec.json
CREATE libs/my-mesh-sdk/.meshrc.yml
CREATE libs/my-mesh-sdk/src/lib/sdk.ts
UPDATE nx.json
SWC
>  NX  Generating @domjtalbot/nx-plugin-graphql-mesh:sdk

CREATE libs/my-mesh-sdk/README.md
CREATE libs/my-mesh-sdk/package.json
CREATE libs/my-mesh-sdk/src/index.ts
CREATE libs/my-mesh-sdk/tsconfig.json
CREATE libs/my-mesh-sdk/tsconfig.lib.json
UPDATE tsconfig.base.json
CREATE libs/my-mesh-sdk/project.json
UPDATE workspace.json
CREATE libs/my-mesh-sdk/.eslintrc.json
CREATE libs/my-mesh-sdk/jest.config.ts
CREATE libs/my-mesh-sdk/tsconfig.spec.json
CREATE libs/my-mesh-sdk/.lib.swcrc
CREATE libs/my-mesh-sdk/.meshrc.json
CREATE libs/my-mesh-sdk/src/lib/sdk.ts

Options

Name Alias Type Required Default Description
name - string - What name would you like to use?
directory d string - - The directory of the new sdk.
meshConfig mc cjs, js, json, yml - yml Which config format would you like to use?
babelJest - boolean - false Use babel instead of ts-jest.
compiler - tsc, swc - tsc The compiler used by the build and test targets.
importPath - string - - The library name used to import it, like @myorg/my-awesome-lib. Must be a valid npm name.
js - boolean - false Generate JavaScript files rather than TypeScript files.
linter - eslint, tslint - eslint The tool to use for running lint checks.?
pascalCaseFiles p boolean - false Use pascal case file names.
rootDir - string - - Sets the rootDir for TypeScript compilation. When not defined, it uses the project's root property, or srcRootForCompilationRoot if it is defined.
setParserOptionsProject - boolean - false Whether or not to configure the ESLint parserOptions.project option. We do not do this by default for lint performance reasons.
simpleModuleName - boolean - false Keep the module name simple (when using --directory).
skipFormat - boolean - false Skip formatting files.
skipTsConfig - boolean - false Do not update tsconfig.base.json for development experience.
standaloneConfig - boolean - false Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json
strict - boolean - false Whether to enable tsconfig strict mode or not.
tags t string - - Add tags to the application (used for linting).
testEnvironment - jsdom, none - jsdom The test environment to use if unitTestRunner is set to jest.
unitTestRunner - jest, none - jest Test runner to use for unit tests.

@nx-cloud
Copy link

nx-cloud bot commented Aug 9, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 9085330. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 5 targets

Sent with 💌 from NxCloud.

@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2022

🦋 Changeset detected

Latest commit: 9085330

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nx-plugin-graphql-mesh Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@domjtalbot domjtalbot self-assigned this Aug 10, 2022
@domjtalbot domjtalbot added the feature Indicates new functionality label Aug 10, 2022
@domjtalbot domjtalbot added this to the v1.0.0 milestone Aug 10, 2022
@domjtalbot domjtalbot linked an issue Aug 10, 2022 that may be closed by this pull request
@domjtalbot domjtalbot merged commit 329c391 into main Aug 13, 2022
@domjtalbot domjtalbot deleted the feature/sdk-generator branch August 13, 2022 15:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Indicates new functionality
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Generate a Mesh SDK library
1 participant