Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E4E-0]: Make package public under @encoura scope #21

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
- run: npm i
- run: npm run test
- run: npm run build
- run: npm publish
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ npx apollo-rest-utils <path_to_swagger_file_or_url> <output_directory_where_you_
Then you can use those definitions to make GraphQL calls within an Apollo context:

```TypeScript
import { wrapRestQuery } from 'apollo-rest-utils';
import { wrapRestQuery } from '@encoura/apollo-rest-utils';

import ROUTES from 'path/to/directory_specified_in_cli_call/__generatedRestEndpoints';

Expand Down Expand Up @@ -88,8 +88,8 @@ should be requested in camel case format. I.e. if your REST API returns a
#### `HeadersLink` Setup

```ts
import { HeadersLink } from '@encoura/apollo-rest-utils';
import { RestLink } from 'apollo-link-rest';
import { HeadersLink } from 'apollo-rest-utils';

const headersLink = new HeadersLink();
const restLink = new RestLink({ ... });
Expand Down
4 changes: 2 additions & 2 deletions lib/generateRoutes/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('generateTypescript', () => {

const typeImport = await generateTypes(apiPath, path.join(buildFolder, `${randomUUID()}_types.ts`));

const tsData = generateTypescript(api, typeImport).replace(/apollo-rest-utils/g, '../../lib');
const tsData = generateTypescript(api, typeImport).replace(/@encoura\/apollo-rest-utils/g, '../../lib');

expect(tsData).toBeTruthy(); // Not empty, null, or undefined

Expand All @@ -67,7 +67,7 @@ describe('generateTypescript', () => {

const typeImport = await generateTypes(apiPath, path.join(buildFolder, `${randomUUID()}_types.ts`));

const tsData = generateTypescript(api, typeImport, 'TEST').replace(/apollo-rest-utils/g, '../../lib');
const tsData = generateTypescript(api, typeImport, 'TEST').replace(/@encoura\/apollo-rest-utils/g, '../../lib');

expect(tsData).toBeTruthy(); // Not empty, null, or undefined

Expand Down
4 changes: 2 additions & 2 deletions lib/generateRoutes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ export function generateTypescript(api: OpenAPI.Document, typeImportLocation: st
// eslint-disable-next-line lodash/prefer-includes
if (generatedTSEndpoints.indexOf('Input<') > -1) {
// eslint-disable-next-line max-len
generatedTSEndpoints = `${warningHeader}import { paths } from '${typeImportLocation}'\n\nimport { IRestEndpoint, Input } from 'apollo-rest-utils';\n\n\n${generatedTSEndpoints}`;
generatedTSEndpoints = `${warningHeader}import { paths } from '${typeImportLocation}'\n\nimport { IRestEndpoint, Input } from '@encoura/apollo-rest-utils';\n\n\n${generatedTSEndpoints}`;
} else {
// eslint-disable-next-line max-len
generatedTSEndpoints = `${warningHeader}import { paths } from '${typeImportLocation}'\n\nimport { IRestEndpoint } from 'apollo-rest-utils';\n\n\n${generatedTSEndpoints}`;
generatedTSEndpoints = `${warningHeader}import { paths } from '${typeImportLocation}'\n\nimport { IRestEndpoint } from '@encoura/apollo-rest-utils';\n\n\n${generatedTSEndpoints}`;
}

return generatedTSEndpoints;
Expand Down
Loading