From 53f5699eee55a8ca39878a09491fdeed40fafa4e Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Fri, 17 Feb 2023 17:33:44 +0100 Subject: [PATCH 1/2] parent f0d0e832d4a25b7e09964d04f3f80c5783f1dd93 author Vincent Germain 1676651624 +0100 committer Vincent Germain 1676971452 +0100 chore: release v1 ci: bump to major for this one feat: adjust some URLs --- .github/workflows/deploy-package.yml | 2 +- CONTRIBUTING.md | 2 +- README.md | 13 +++++-------- lerna.json | 1 - packages/clients/README.md | 2 +- .../clients/src/scw/__tests__/client-ini-profile.ts | 6 +++--- packages/clients/src/scw/client-ini-profile.ts | 6 +++--- packages/clients/src/scw/client.ts | 4 ++-- packages/configuration-loader/src/yml-loader.ts | 4 ++-- 9 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/deploy-package.yml b/.github/workflows/deploy-package.yml index d0a121510..54dcc5c48 100644 --- a/.github/workflows/deploy-package.yml +++ b/.github/workflows/deploy-package.yml @@ -33,7 +33,7 @@ jobs: - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: pnpm lerna publish -y --create-release github + - run: pnpm lerna publish -y --bump major --create-release github env: HUSKY: 0 GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a5acb124..68ac74e61 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ If there is a match, thumbs up the issue with a 👍 and leave a comment if you When reporting an issue, include the following: - The version of `scaleway-sdk-js` you are using (e.g. v1.0.0-beta1, v2.0.0, master, ...) -- The environment and its version (e.g. NodeJS v16.10) +- The environment and its version (e.g. NodeJS v18.10) ## Suggesting a feature diff --git a/README.md b/README.md index d6fcc0853..50103652b 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,8 @@ This SDK enables you to interact with Scaleway APIs. -**⚠️  Notes:** -* The project is in beta, but should be fairly stable. -* SDK only works from a node.js runtime, browser calls aren't supported yet. +> **Warning** +> SDK only works from a node.js runtime, browser calls aren't supported yet. **🔗  Important links:** * [Reference documentation](https://scaleway.github.io/scaleway-sdk-js) @@ -13,7 +12,7 @@ This SDK enables you to interact with Scaleway APIs. ## Getting Started -You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key) on how to retrieve them. +You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/) on how to retrieve them. **A minimal setup** would look like this: @@ -75,13 +74,11 @@ The project is coded with Typescript, so don't hesitate to take advantage of it. 2. We export **errors** in the namespace `Errors`, allowing you to differentiate the cases (e.g. `Errors.PermissionsDeniedError`). -## Notes - -### Contributing Guidelines +## Contributing Guidelines This repository is at its early stage and is still in active development. If you are looking for a way to contribute please read [CONTRIBUTING.md](./CONTRIBUTING.md). -### Reach us +## Reach us We love feedback. Feel free to reach us on [Scaleway Slack community](https://slack.scaleway.com/), we are waiting for you on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource). diff --git a/lerna.json b/lerna.json index 51746246b..fc3b95f27 100644 --- a/lerna.json +++ b/lerna.json @@ -5,7 +5,6 @@ "version": "independent", "command": { "publish": { - "conventionalPrerelease": true, "conventionalCommits": true, "changelogPreset": "conventionalcommits" }, diff --git a/packages/clients/README.md b/packages/clients/README.md index 7858fa5a2..feb86e52a 100644 --- a/packages/clients/README.md +++ b/packages/clients/README.md @@ -9,7 +9,7 @@ This SDK enables you to interact with Scaleway APIs. ## Getting Started -You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key) on how to retrieve them. +You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/) on how to retrieve them. **A minimal setup** would look like this: diff --git a/packages/clients/src/scw/__tests__/client-ini-profile.ts b/packages/clients/src/scw/__tests__/client-ini-profile.ts index 1bedb4913..b6646ed56 100644 --- a/packages/clients/src/scw/__tests__/client-ini-profile.ts +++ b/packages/clients/src/scw/__tests__/client-ini-profile.ts @@ -46,7 +46,7 @@ describe('assertValidAuthenticationSecrets', () => { assertValidAuthenticationSecrets(value) }).toThrow( new Error( - `Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key`, + `Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/`, ), ) }) @@ -59,7 +59,7 @@ describe('assertValidAuthenticationSecrets', () => { }) }).toThrow( new Error( - `Invalid access key format 'SCW0123', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key`, + `Invalid access key format 'SCW0123', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/`, ), ) }) @@ -72,7 +72,7 @@ describe('assertValidAuthenticationSecrets', () => { }) }).toThrow( new Error( - `Invalid secret key format 'e4b83996-4c60-449a-98d2', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key`, + `Invalid secret key format 'e4b83996-4c60-449a-98d2', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/`, ), ) }) diff --git a/packages/clients/src/scw/client-ini-profile.ts b/packages/clients/src/scw/client-ini-profile.ts index 1c4a00ad3..8b5bf3a0e 100644 --- a/packages/clients/src/scw/client-ini-profile.ts +++ b/packages/clients/src/scw/client-ini-profile.ts @@ -99,17 +99,17 @@ export function assertValidAuthenticationSecrets( ): asserts obj is AuthenticationSecrets { if (!(obj.accessKey && obj.secretKey)) { throw new Error( - `Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key`, + `Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/`, ) } if (!isAccessKey(obj.accessKey)) { throw new Error( - `Invalid access key format '${obj.accessKey}', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key`, + `Invalid access key format '${obj.accessKey}', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/`, ) } if (!isSecretKey(obj.secretKey)) { throw new Error( - `Invalid secret key format '${obj.secretKey}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key`, + `Invalid secret key format '${obj.secretKey}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/`, ) } } diff --git a/packages/clients/src/scw/client.ts b/packages/clients/src/scw/client.ts index 82bad7339..2455be74e 100644 --- a/packages/clients/src/scw/client.ts +++ b/packages/clients/src/scw/client.ts @@ -67,7 +67,7 @@ export const createAdvancedClient = (...configs: ClientConfig[]): Client => { * Creates a Scaleway client with a profile. * * @example - * Creates a client with credentials & default values (see https://www.scaleway.com/docs/console/my-project/how-to/generate-api-key): + * Creates a client with credentials & default values (see https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/): * ``` * import { createClient } from '@scaleway/sdk' * @@ -82,7 +82,7 @@ export const createAdvancedClient = (...configs: ClientConfig[]): Client => { * * @example * Creates a client by loading values from the environment (see https://www.scaleway.com/en/docs/console/my-project/how-to/generate-api-key/#how-to-use-your-api-key) - * or the config file created by CLI `scw init` (see https://www.scaleway.com/cli): + * or the config file created by CLI `scw init` (see https://www.scaleway.com/en/cli/): * ``` * import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader' * import { createClient } from '@scaleway/sdk' diff --git a/packages/configuration-loader/src/yml-loader.ts b/packages/configuration-loader/src/yml-loader.ts index 5427f8807..9dd449cca 100644 --- a/packages/configuration-loader/src/yml-loader.ts +++ b/packages/configuration-loader/src/yml-loader.ts @@ -6,9 +6,9 @@ const DETECT_SECTION_REGEX = /^\s*([^]+):\s*$/ const DETECT_ITEM_REGEX = /^\s*(.+?)\s*:\s*(.+?)\s*$/ /** - * Converts Yaml to configuration map. + * Converts YAML to configuration map. * - * @param input - Yaml string + * @param input - YAML string * @returns The configuration map * * @internal From b25b7628d26c62655599406eac7f622ce0957ac1 Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Tue, 21 Feb 2023 11:39:22 +0100 Subject: [PATCH 2/2] fix: add node/types to serverless example --- examples/serverless-function-minimal/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/serverless-function-minimal/package.json b/examples/serverless-function-minimal/package.json index 99f501ac4..d585f5bf0 100644 --- a/examples/serverless-function-minimal/package.json +++ b/examples/serverless-function-minimal/package.json @@ -12,6 +12,7 @@ }, "devDependencies": { "serverless-scaleway-functions": "^0.4.5", + "@types/node": "^18.11.18", "typescript": "^4.9.5" }, "description": "Minimal Typescript template to run Scaleway SDK-JS in a Function."