Skip to content

Commit 27e8daa

Browse files
feat(sdk): generated packages (#2029)
Co-authored-by: Alexandre Philibeaux <[email protected]>
1 parent 205b544 commit 27e8daa

File tree

468 files changed

+118894
-2461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

468 files changed

+118894
-2461
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
check-latest: true
2121
cache: 'pnpm'
2222
- run: pnpm install
23-
- run: pnpm run build
24-
- run: pnpm tsc --noEmit
23+
- run: pnpm typecheck
2524
lint:
2625
runs-on: ubuntu-24.04
2726
steps:

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ yarn.lock
88
# lint
99
.eslintcache
1010

11+
# turbo
12+
.turbo
13+
!.turbo/config.json
14+
packages/*/.turbo
15+
packages/*/dist
16+
packages_generated/*/.turbo
17+
packages_generated/*/.dist
18+
19+
1120
# test & build
1221
.reports
1322
docs

eslint.config.mjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default [
1919
'packages/clients/src/vendor/base64/index.js',
2020
'packages/client/src/vendor/base64/index.js',
2121
'packages/configuration-loader/.eslintrc.cjs',
22+
'scripts/generatePackages.ts',
2223
],
2324
},
2425
{
@@ -82,7 +83,12 @@ export default [
8283

8384
...scwTypescript.map(config => ({
8485
...config,
85-
files: ['**/*.test.ts', '__tests__/**/*.ts', '**/vite.config.ts'],
86+
files: [
87+
'**/*.test.ts',
88+
'__tests__/**/*.ts',
89+
'**/vite.config.ts',
90+
'vitest.config.ts',
91+
],
8692
rules: {
8793
...config.rules,
8894
'import/no-extraneous-dependencies': 'off',
@@ -91,7 +97,10 @@ export default [
9197

9298
...scwTypescript.map(config => ({
9399
...config,
94-
files: ['packages/clients/src/api/dedibox/v1/*.ts'],
100+
files: [
101+
'packages_generated/dedibox/src/v1/*.ts',
102+
'packages/clients/src/api/dedibox/v1/*.ts',
103+
],
95104
rules: {
96105
...config.rules,
97106
'no-use-before-define': 'off',

package.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22
"name": "root",
33
"private": true,
44
"workspaces": [
5-
"packages/*"
5+
"packages/*",
6+
"packages_generated/*"
67
],
78
"engines": {
89
"node": ">=18.0",
910
"pnpm": ">=9.4.0"
1011
},
1112
"type": "module",
1213
"scripts": {
13-
"build": "pnpm recursive run build",
14+
"generateIndex": "pnpm dlx tsx ./scripts/generatePackages.ts",
15+
"generateGlobalSdkPackage": "pnpm dlx tsx ./scripts/updateGlobalSdkPackage.ts",
16+
"prebuild": "pnpm run generateIndex && pnpm run generateGlobalSdkPackage && pnpm format",
17+
"build": "pnpm turbo build",
18+
"typecheck": "pnpm turbo typecheck",
1419
"build:profile": "cross-env PROFILE=true pnpm run build",
1520
"commit": "npx git-cz -a",
1621
"doc": "typedoc",
@@ -26,7 +31,7 @@
2631
"lint-staged": {
2732
"*.ts": [
2833
"pnpm run format",
29-
"eslint --fix ."
34+
"eslint --fix --quiet ."
3035
],
3136
"*.json": [
3237
"pnpm run format"
@@ -56,9 +61,9 @@
5661
"@scaleway/eslint-config-react": "4.0.9",
5762
"@scaleway/random-name": "5.1.1",
5863
"@typescript-eslint/eslint-plugin": "latest",
59-
"@vitest/coverage-istanbul": "2.1.9",
60-
"@vitest/coverage-v8": "2.1.9",
61-
"@vitest/ui": "2.1.9",
64+
"@vitest/coverage-istanbul": "3.1.1",
65+
"@vitest/coverage-v8": "3.1.1",
66+
"@vitest/ui": "3.1.1",
6267
"babel-plugin-annotate-pure-calls": "0.5.0",
6368
"browserslist": "4.24.4",
6469
"cross-env": "7.0.3",
@@ -75,10 +80,11 @@
7580
"react": "^19.0.0",
7681
"read-pkg": "9.0.1",
7782
"tsc-alias": "^1.8.10",
83+
"turbo": "2.5.0",
7884
"typedoc": "0.27.6",
79-
"typescript": "5.7.3",
80-
"vite": "5.4.18",
81-
"vitest": "2.1.9"
85+
"typescript": "5.8.3",
86+
"vite": "6.2.6",
87+
"vitest": "3.1.1"
8288
},
8389
"packageManager": "[email protected]"
8490
}

packages/sdk/.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/__tests__/**
2+
examples/
3+
src
4+
.eslintrc.cjs
5+
!.npmignore

packages/sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/sdk/package.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"name": "@scaleway/sdk-ts",
3+
"private": "true",
4+
"version": "2.0.0",
5+
"description": "Scaleway SDK TS.",
6+
"types": "dist/index.d.ts",
7+
"files": [
8+
"dist"
9+
],
10+
"type": "module",
11+
"exports": {
12+
".": {
13+
"types": "./dist/index.gen.d.ts",
14+
"import": "./dist/index.gen.js",
15+
"require": "./dist/index.gen.cjs",
16+
"default": "./dist/index.gen.js"
17+
},
18+
"./*": {
19+
"types": "./dist/*/index.gen.d.ts",
20+
"import": "./dist/*/index.gen.js",
21+
"require": "./dist/*/index.gen.cjs",
22+
"default": "./dist/*/index.gen.js"
23+
}
24+
},
25+
"repository": {
26+
"type": "git",
27+
"directory": "packages/sdk"
28+
},
29+
"engines": {
30+
"node": ">=20.19.0"
31+
},
32+
"scripts": {
33+
"package:check": "pnpm publint",
34+
"typecheck": "tsc --noEmit",
35+
"type:generate": "tsc --declaration -p tsconfig.build.json",
36+
"build": "vite build --config vite.config.ts && pnpm run type:generate",
37+
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
38+
},
39+
"dependencies": {
40+
"@scaleway/random-name": "5.1.1",
41+
"@scaleway/sdk-account": "workspace:*",
42+
"@scaleway/sdk-applesilicon": "workspace:*",
43+
"@scaleway/sdk-audit-trail": "workspace:*",
44+
"@scaleway/sdk-baremetal": "workspace:*",
45+
"@scaleway/sdk-billing": "workspace:*",
46+
"@scaleway/sdk-block": "workspace:*",
47+
"@scaleway/sdk-cockpit": "workspace:*",
48+
"@scaleway/sdk-container": "workspace:*",
49+
"@scaleway/sdk-dedibox": "workspace:*",
50+
"@scaleway/sdk-domain": "workspace:*",
51+
"@scaleway/sdk-edge-services": "workspace:*",
52+
"@scaleway/sdk-file": "workspace:*",
53+
"@scaleway/sdk-flexibleip": "workspace:*",
54+
"@scaleway/sdk-function": "workspace:*",
55+
"@scaleway/sdk-iam": "workspace:*",
56+
"@scaleway/sdk-inference": "workspace:*",
57+
"@scaleway/sdk-instance": "workspace:*",
58+
"@scaleway/sdk-interlink": "workspace:*",
59+
"@scaleway/sdk-iot": "workspace:*",
60+
"@scaleway/sdk-ipam": "workspace:*",
61+
"@scaleway/sdk-jobs": "workspace:*",
62+
"@scaleway/sdk-k8s": "workspace:*",
63+
"@scaleway/sdk-key-manager": "workspace:*",
64+
"@scaleway/sdk-lb": "workspace:*",
65+
"@scaleway/sdk-marketplace": "workspace:*",
66+
"@scaleway/sdk-mnq": "workspace:*",
67+
"@scaleway/sdk-mongodb": "workspace:*",
68+
"@scaleway/sdk-product-catalog": "workspace:*",
69+
"@scaleway/sdk-qaas": "workspace:*",
70+
"@scaleway/sdk-rdb": "workspace:*",
71+
"@scaleway/sdk-redis": "workspace:*",
72+
"@scaleway/sdk-registry": "workspace:*",
73+
"@scaleway/sdk-secret": "workspace:*",
74+
"@scaleway/sdk-serverless-sqldb": "workspace:*",
75+
"@scaleway/sdk-std": "workspace:*",
76+
"@scaleway/sdk-tem": "workspace:*",
77+
"@scaleway/sdk-test": "workspace:*",
78+
"@scaleway/sdk-vpc": "workspace:*",
79+
"@scaleway/sdk-vpcgw": "workspace:*",
80+
"@scaleway/sdk-webhosting": "workspace:*"
81+
},
82+
"devDependencies": {
83+
"@scaleway/sdk-client": "^1.1.1"
84+
},
85+
"peerDependencies": {
86+
"@scaleway/sdk-client": "^1.1.1"
87+
},
88+
"bundledDependencies": [
89+
"@scaleway/random-name"
90+
]
91+
}

packages/sdk/src/index.gen.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Auto-generated exports from all SDK packages
2+
3+
export * from '@scaleway/sdk-account'
4+
export * from '@scaleway/sdk-applesilicon'
5+
export * from '@scaleway/sdk-audit-trail'
6+
export * from '@scaleway/sdk-baremetal'
7+
export * from '@scaleway/sdk-billing'
8+
export * from '@scaleway/sdk-block'
9+
export * from '@scaleway/sdk-cockpit'
10+
export * from '@scaleway/sdk-container'
11+
export * from '@scaleway/sdk-dedibox'
12+
export * from '@scaleway/sdk-domain'
13+
export * from '@scaleway/sdk-edge-services'
14+
export * from '@scaleway/sdk-file'
15+
export * from '@scaleway/sdk-flexibleip'
16+
export * from '@scaleway/sdk-function'
17+
export * from '@scaleway/sdk-iam'
18+
export * from '@scaleway/sdk-inference'
19+
export * from '@scaleway/sdk-instance'
20+
export * from '@scaleway/sdk-interlink'
21+
export * from '@scaleway/sdk-iot'
22+
export * from '@scaleway/sdk-ipam'
23+
export * from '@scaleway/sdk-jobs'
24+
export * from '@scaleway/sdk-k8s'
25+
export * from '@scaleway/sdk-key-manager'
26+
export * from '@scaleway/sdk-lb'
27+
export * from '@scaleway/sdk-marketplace'
28+
export * from '@scaleway/sdk-mnq'
29+
export * from '@scaleway/sdk-mongodb'
30+
export * from '@scaleway/sdk-product-catalog'
31+
export * from '@scaleway/sdk-qaas'
32+
export * from '@scaleway/sdk-rdb'
33+
export * from '@scaleway/sdk-redis'
34+
export * from '@scaleway/sdk-registry'
35+
export * from '@scaleway/sdk-secret'
36+
export * from '@scaleway/sdk-serverless-sqldb'
37+
export * from '@scaleway/sdk-std'
38+
export * from '@scaleway/sdk-tem'
39+
export * from '@scaleway/sdk-test'
40+
export * from '@scaleway/sdk-vpc'
41+
export * from '@scaleway/sdk-vpcgw'
42+
export * from '@scaleway/sdk-webhosting'

packages/sdk/tsconfig.build.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": false,
5+
"emitDeclarationOnly": true,
6+
"rootDir": "src",
7+
"outDir": "dist"
8+
},
9+
"exclude": [
10+
"dist/*",
11+
"*.config.ts",
12+
"*.setup.ts",
13+
"**/__tests__",
14+
"**/__mocks__",
15+
"src/**/*.test.tsx"
16+
]
17+
}

packages/sdk/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"include": ["src/**/*.ts", "src/**/*.tsx", "*.config.ts"]
4+
}

0 commit comments

Comments
 (0)