Skip to content

Commit 386f00c

Browse files
authored
Merge branch 'main' into fix/index-settings
2 parents 1b0557b + 4f82b4b commit 386f00c

Some content is hidden

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

61 files changed

+231
-247
lines changed

.github/actions/setup/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ runs:
4747
shell: bash
4848
run: YARN_ENABLE_HARDENED_MODE=0 YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
4949

50-
- name: Build scripts
51-
shell: bash
52-
run: yarn workspace scripts build:cli
53-
5450
# JavaScript client deps
5551
- name: Get yarn js-client cache directory path
5652
if: ${{ inputs.language == 'javascript' }}

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
"build": "yarn build:eslint && yarn scripts:build",
1616
"build:eslint": "yarn workspace eslint-plugin-automation-custom build && yarn install",
1717
"clean": "rm -rf **/dist **/build **/.build **/node_modules **/.gradle **/vendor **/bin **/obj **/__pycache__ || true",
18-
"cli": "cd scripts && yarn build:cli && yarn start",
18+
"cli": "yarn workspace scripts start",
1919
"docker:setup": "./scripts/docker/setup.sh",
2020
"fix:json": "eslint --ext=json . --fix",
2121
"fix:mustache": "eslint --ext=mustache templates/**/tests/ --fix",
2222
"github-actions:lint": "eslint --ext=yml .github/",
23-
"postinstall": "husky && yarn workspace eslint-plugin-automation-custom build && yarn workspace scripts build:cli",
23+
"postinstall": "husky && yarn workspace eslint-plugin-automation-custom build",
2424
"playground:browser": "yarn workspace javascript-browser-playground start",
25-
"scripts:build": "yarn workspace scripts build",
25+
"scripts:build": "yarn workspace scripts build:actions",
2626
"scripts:lint": "yarn workspace scripts lint",
2727
"scripts:test": "yarn workspace scripts test",
2828
"specs:fix": "eslint --ext=yml $0 --fix",
@@ -40,7 +40,6 @@
4040
"husky": "9.1.7",
4141
"lint-staged": "15.3.0",
4242
"oxlint": "0.11.1",
43-
"pinst": "3.0.0",
4443
"prettier": "3.4.2",
4544
"prettier-plugin-java": "2.6.5",
4645
"prettier-plugin-organize-imports": "4.1.0",

scripts/__tests__/common.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { execa } from 'execa';
22
import { afterEach, describe, expect, it, vi } from 'vitest';
33

4-
import { capitalize, createClientName, gitCommit } from '../common.js';
5-
import { getClientsConfigField } from '../config.js';
4+
import { capitalize, createClientName, gitCommit } from '../common.ts';
5+
import { getClientsConfigField } from '../config.ts';
66

77
vi.mock('execa', () => {
88
return {

scripts/buildLanguages.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { existsSync } from 'node:fs';
22

3-
import { createClientName, run, toAbsolutePath } from './common.js';
4-
import { getLanguageFolder } from './config.js';
5-
import { formatter } from './formatter.js';
6-
import { createSpinner } from './spinners.js';
7-
import type { Generator, Language } from './types.js';
3+
import { createClientName, run, toAbsolutePath } from './common.ts';
4+
import { getLanguageFolder } from './config.ts';
5+
import { formatter } from './formatter.ts';
6+
import { createSpinner } from './spinners.ts';
7+
import type { Generator, Language } from './types.ts';
88

99
type BuildType = 'client' | 'guides' | 'playground' | 'snippets';
1010

scripts/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fsp from 'fs/promises';
22

33
import { hashElement } from 'folder-hash';
44

5-
import { exists } from './common.js';
5+
import { exists } from './common.ts';
66

77
export class Cache {
88
folder: string;

scripts/ci/codegen/__tests__/codegen.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { describe, expect, it, vi } from 'vitest';
22

3-
import { pushGeneratedCode } from '../pushGeneratedCode.js';
3+
import { pushGeneratedCode } from '../pushGeneratedCode.ts';
44

5-
vi.mock('../../../common.js', async (importOriginal) => {
6-
const mod = await importOriginal<typeof import('../../../common.js')>();
5+
vi.mock('../../../common.ts', async (importOriginal) => {
6+
const mod = await importOriginal<typeof import('../../../common.ts')>();
77
return {
88
...mod,
99
run: vi.fn().mockResolvedValue(''),

scripts/ci/codegen/__tests__/spreadGeneration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, it } from 'vitest';
22

3-
import { cleanUpCommitMessage } from '../spreadGeneration.js';
4-
import text from '../text.js';
3+
import { cleanUpCommitMessage } from '../spreadGeneration.ts';
4+
import text from '../text.ts';
55

66
describe('spread generation', () => {
77
describe('cleanUpCommitMessage', () => {

scripts/ci/codegen/createGitHubReleases.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import fsp from 'fs/promises';
2-
import { ensureGitHubToken, getOctokit, OWNER, run, setVerbose, toAbsolutePath } from '../../common.js';
3-
import { isPreRelease } from '../../release/versionsHistory.js';
4-
import type { Language } from '../../types.js';
5-
import { cloneRepository } from '../utils.js';
2+
import { ensureGitHubToken, getOctokit, OWNER, run, setVerbose, toAbsolutePath } from '../../common.ts';
3+
import { isPreRelease } from '../../release/versionsHistory.ts';
4+
import type { Language } from '../../types.ts';
5+
import { cloneRepository } from '../utils.ts';
66

77
import { resolve } from 'path';
8-
import { stripCommitMessage } from '../../release/common.js';
9-
import { commitStartRelease } from './text.js';
8+
import { stripCommitMessage } from '../../release/common.ts';
9+
import { commitStartRelease } from './text.ts';
1010

1111
async function createGitHubRelease(lang: Language): Promise<void> {
1212
// **Full Changelog**:

scripts/ci/codegen/pushGeneratedCode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { setOutput } from '@actions/core';
22

3-
import { configureGitHubAuthor, ensureGitHubToken, MAIN_BRANCH, run } from '../../common.js';
4-
import { getNbGitDiff } from '../utils.js';
3+
import { configureGitHubAuthor, ensureGitHubToken, MAIN_BRANCH, run } from '../../common.ts';
4+
import { getNbGitDiff } from '../utils.ts';
55

6-
import text, { commitStartPrepareRelease } from './text.js';
6+
import text, { commitStartPrepareRelease } from './text.ts';
77

88
async function isUpToDate(baseBranch: string): Promise<boolean> {
99
await run('git fetch origin');

scripts/ci/codegen/pushToRepository.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import {
1313
run,
1414
setVerbose,
1515
toAbsolutePath,
16-
} from '../../common.js';
17-
import { getNbGitDiff } from '../utils.js';
18-
import { GuidesToPush, pushToRepositoryConfiguration, RepositoryConfiguration, SpecsToPush } from './types.js';
16+
} from '../../common.ts';
17+
import { getNbGitDiff } from '../utils.ts';
18+
import { GuidesToPush, pushToRepositoryConfiguration, RepositoryConfiguration, SpecsToPush } from './types.ts';
1919

20-
import { getClientsConfigField } from '../../config.js';
21-
import { commitStartRelease } from './text.js';
20+
import { getClientsConfigField } from '../../config.ts';
21+
import { commitStartRelease } from './text.ts';
2222

2323
async function handleSpecFiles(spec: SpecsToPush, tempGitDir: string): Promise<void> {
2424
const pathToSpecs = toAbsolutePath(`${tempGitDir}/${spec.output}`);

scripts/ci/codegen/spreadGeneration.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import {
1111
run,
1212
setVerbose,
1313
toAbsolutePath,
14-
} from '../../common.js';
15-
import { getLanguageFolder, getPackageVersionDefault } from '../../config.js';
16-
import { getNewReleasedTag } from '../../release/common.js';
17-
import type { Language } from '../../types.js';
18-
import { cloneRepository, getNbGitDiff } from '../utils.js';
14+
} from '../../common.ts';
15+
import { getLanguageFolder, getPackageVersionDefault } from '../../config.ts';
16+
import { getNewReleasedTag } from '../../release/common.ts';
17+
import type { Language } from '../../types.ts';
18+
import { cloneRepository, getNbGitDiff } from '../utils.ts';
1919

20-
import text, { commitStartRelease } from './text.js';
20+
import text, { commitStartRelease } from './text.ts';
2121

2222
export function cleanUpCommitMessage(commitMessage: string, version: string): string {
2323
if (commitMessage.startsWith(commitStartRelease)) {

scripts/ci/codegen/text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TODAY } from '../../common.js';
1+
import { TODAY } from '../../common.ts';
22

33
export const commitStartPrepareRelease = 'chore: prepare release';
44
export const commitStartRelease = 'chore: release';

scripts/ci/codegen/waitForAllReleases.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { components } from '@octokit/openapi-types';
22

3-
import { exists, getOctokit, run, setVerbose, toAbsolutePath } from '../../common.js';
4-
import { getClientsConfigField, getLanguageFolder } from '../../config.js';
5-
import { getTargetBranch } from '../../release/common.js';
6-
import type { Language } from '../../types.js';
3+
import { exists, getOctokit, run, setVerbose, toAbsolutePath } from '../../common.ts';
4+
import { getClientsConfigField, getLanguageFolder } from '../../config.ts';
5+
import { getTargetBranch } from '../../release/common.ts';
6+
import type { Language } from '../../types.ts';
77

8-
import { commitStartRelease } from './text.js';
8+
import { commitStartRelease } from './text.ts';
99

1010
type Run = {
1111
language: Language;

scripts/ci/githubActions/createMatrix.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import fsp from 'fs/promises';
22

33
import { setOutput } from '@actions/core';
44

5-
import { CLIENTS, createClientName, exists, GENERATORS, LANGUAGES, toAbsolutePath } from '../../common.js';
6-
import { getClientsConfigField, getLanguageFolder, getTestExtension, getTestOutputFolder } from '../../config.js';
5+
import { CLIENTS, createClientName, exists, GENERATORS, LANGUAGES, toAbsolutePath } from '../../common.ts';
6+
import { getClientsConfigField, getLanguageFolder, getTestExtension, getTestOutputFolder } from '../../config.ts';
77

8-
import type { ClientMatrix, CreateMatrix, ToRunMatrix } from './types.js';
9-
import { COMMON_DEPENDENCIES, DEPENDENCIES, isBaseChanged } from './utils.js';
8+
import type { ClientMatrix, CreateMatrix, ToRunMatrix } from './types.ts';
9+
import { COMMON_DEPENDENCIES, DEPENDENCIES, isBaseChanged } from './utils.ts';
1010

1111
// This empty matrix is required by the CI, otherwise it throws
1212
const EMPTY_MATRIX = { client: ['no-run'] };

scripts/ci/githubActions/setRunVariables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as core from '@actions/core';
22

3-
import { DEPENDENCIES, isBaseChanged } from './utils.js';
3+
import { DEPENDENCIES, isBaseChanged } from './utils.ts';
44

55
/**
66
* Outputs variables used in the CI to determine if a job should run.

scripts/ci/githubActions/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as core from '@actions/core';
22

3-
import { LANGUAGES } from '../../common.js';
4-
import { getLanguageFolder } from '../../config.js';
5-
import type { Language } from '../../types.js';
6-
import { getNbGitDiff } from '../utils.js';
3+
import { LANGUAGES } from '../../common.ts';
4+
import { getLanguageFolder } from '../../config.ts';
5+
import type { Language } from '../../types.ts';
6+
import { getNbGitDiff } from '../utils.ts';
77

88
export const COMMON_DEPENDENCIES = {
99
GITHUB_ACTIONS_CHANGED: ['.github/actions', '.github/workflows'],

scripts/ci/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import fsp from 'fs/promises';
22
import { resolve } from 'path';
33

4-
import { run } from '../common.js';
5-
import { getGitHubUrl } from '../config.js';
6-
import { getTargetBranch } from '../release/common.js';
7-
import type { Language } from '../types.js';
4+
import { run } from '../common.ts';
5+
import { getGitHubUrl } from '../config.ts';
6+
import { getTargetBranch } from '../release/common.ts';
7+
import type { Language } from '../types.ts';
88

99
/**
1010
* Returns the number of diff between a `branch` and its `HEAD` for the given `path`.

scripts/cli/index.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import { Argument, program } from 'commander';
22
import semver from 'semver';
33

4-
import { buildLanguages } from '../buildLanguages.js';
5-
import { CI, CLIENTS, LANGUAGES, run, setVerbose, toAbsolutePath } from '../common.js';
6-
import { getLanguageFolder } from '../config.js';
7-
import { ctsGenerateMany } from '../cts/generate.js';
8-
import { runCts } from '../cts/runCts.js';
9-
import { startTestServer } from '../cts/testServer/index.js';
10-
import { docsGenerateMany } from '../docs/generate.js';
11-
import { formatter } from '../formatter.js';
12-
import { generate } from '../generate.js';
13-
import { playground } from '../playground.js';
14-
import { createReleasePR } from '../release/createReleasePR.js';
15-
import { buildSpecs } from '../specs/index.js';
16-
import type { Language } from '../types.js';
4+
import { buildLanguages } from '../buildLanguages.ts';
5+
import { CI, CLIENTS, LANGUAGES, run, setVerbose, toAbsolutePath } from '../common.ts';
6+
import { getLanguageFolder } from '../config.ts';
7+
import { ctsGenerateMany } from '../cts/generate.ts';
8+
import { runCts } from '../cts/runCts.ts';
9+
import { startTestServer } from '../cts/testServer/index.ts';
10+
import { docsGenerateMany } from '../docs/generate.ts';
11+
import { formatter } from '../formatter.ts';
12+
import { generate } from '../generate.ts';
13+
import { playground } from '../playground.ts';
14+
import { createReleasePR } from '../release/createReleasePR.ts';
15+
import { buildSpecs } from '../specs/index.ts';
16+
import type { Language } from '../types.ts';
1717

1818
import { existsSync } from 'node:fs';
19-
import type { LangArg } from './utils.js';
20-
import { ALL, generatorList, getClientChoices, PROMPT_CLIENTS, PROMPT_LANGUAGES, transformSelection } from './utils.js';
19+
import type { LangArg } from './utils.ts';
20+
import { ALL, generatorList, getClientChoices, PROMPT_CLIENTS, PROMPT_LANGUAGES, transformSelection } from './utils.ts';
2121

2222
const args = {
2323
language: new Argument('[language]', 'The language').choices(PROMPT_LANGUAGES),

scripts/cli/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CLIENTS, GENERATORS, LANGUAGES } from '../common.js';
2-
import type { Generator, Language } from '../types.js';
1+
import { CLIENTS, GENERATORS, LANGUAGES } from '../common.ts';
2+
import type { Generator, Language } from '../types.ts';
33

44
export const ALL = 'all';
55
export const PROMPT_LANGUAGES = [ALL, ...LANGUAGES];

scripts/common.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@ import type { ExecaError } from 'execa';
66
import { execa, execaCommand } from 'execa';
77
import { remove } from 'fs-extra';
88

9-
import clientsConfig from '../config/clients.config.json' assert { type: 'json' };
10-
import releaseConfig from '../config/release.config.json' assert { type: 'json' };
11-
12-
import { Cache } from './cache.js';
13-
import { getDockerImage } from './config.js';
14-
import { generateOpenapitools } from './pre-gen/index.js';
15-
import { getGitAuthor } from './release/common.js';
16-
import { buildSpecs } from './specs/index.js';
17-
import { createSpinner } from './spinners.js';
18-
import type { Generator, GeneratorMode, Language, RunOptions } from './types.js';
19-
20-
export const fullReleaseConfig = releaseConfig;
9+
import clientsConfig from '../config/clients.config.json' with { type: 'json' };
10+
import releaseConfig from '../config/release.config.json' with { type: 'json' };
11+
12+
import { Cache } from './cache.ts';
13+
import { getDockerImage } from './config.ts';
14+
import { generateOpenapitools } from './pre-gen/index.ts';
15+
import { getGitAuthor } from './release/common.ts';
16+
import { buildSpecs } from './specs/index.ts';
17+
import { createSpinner } from './spinners.ts';
18+
import type { Generator, GeneratorMode, Language, RunOptions } from './types.ts';
2119

2220
export const MAIN_BRANCH = releaseConfig.mainBranch;
2321
export const OWNER = releaseConfig.owner;

scripts/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import clientsConfig from '../config/clients.config.json' assert { type: 'json' };
1+
import clientsConfig from '../config/clients.config.json' with { type: 'json' };
22

3-
import { CI } from './common.js';
4-
import type { Language, LanguageConfig } from './types.js';
3+
import { CI } from './common.ts';
4+
import type { Language, LanguageConfig } from './types.ts';
55

66
export function getClientsConfigField(
77
language: Language,

scripts/cts/generate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { callGenerator, run, setupAndGen } from '../common.js';
2-
import { getTestOutputFolder } from '../config.js';
3-
import { formatter } from '../formatter.js';
4-
import type { Generator } from '../types.js';
1+
import { callGenerator, run, setupAndGen } from '../common.ts';
2+
import { getTestOutputFolder } from '../config.ts';
3+
import { formatter } from '../formatter.ts';
4+
import type { Generator } from '../types.ts';
55

66
export async function ctsGenerateMany(generators: Generator[], languageVersion = ''): Promise<void> {
77
await setupAndGen(

scripts/cts/runCts.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import fsp from 'fs/promises';
22

3-
import { exists, isVerbose, run, runComposerInstall, toAbsolutePath } from '../common.js';
4-
import { getTestOutputFolder } from '../config.js';
5-
import { createSpinner } from '../spinners.js';
6-
import type { Language } from '../types.js';
3+
import { exists, isVerbose, run, runComposerInstall, toAbsolutePath } from '../common.ts';
4+
import { getTestOutputFolder } from '../config.ts';
5+
import { createSpinner } from '../spinners.ts';
6+
import type { Language } from '../types.ts';
77

8-
import { printBenchmarkReport } from './testServer/benchmark.js';
9-
import { assertChunkWrapperValid } from './testServer/chunkWrapper.js';
10-
import { startTestServer } from './testServer/index.js';
11-
import { assertValidReplaceAllObjects } from './testServer/replaceAllObjects.js';
12-
import { assertValidReplaceAllObjectsFailed } from './testServer/replaceAllObjectsFailed.js';
13-
import { assertValidReplaceAllObjectsScopes } from './testServer/replaceAllObjectsScopes.js';
14-
import { assertValidTimeouts } from './testServer/timeout.js';
15-
import { assertValidWaitForApiKey } from './testServer/waitFor.js';
8+
import { printBenchmarkReport } from './testServer/benchmark.ts';
9+
import { assertChunkWrapperValid } from './testServer/chunkWrapper.ts';
10+
import { startTestServer } from './testServer/index.ts';
11+
import { assertValidReplaceAllObjects } from './testServer/replaceAllObjects.ts';
12+
import { assertValidReplaceAllObjectsFailed } from './testServer/replaceAllObjectsFailed.ts';
13+
import { assertValidReplaceAllObjectsScopes } from './testServer/replaceAllObjectsScopes.ts';
14+
import { assertValidTimeouts } from './testServer/timeout.ts';
15+
import { assertValidWaitForApiKey } from './testServer/waitFor.ts';
1616

1717
export type CTSType = 'benchmark' | 'client' | 'e2e' | 'requests';
1818

scripts/cts/testServer/apiKey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Server } from 'http';
33
import { expect } from 'chai';
44
import type { Express, Request, Response } from 'express';
55

6-
import { setupServer } from './index.js';
6+
import { setupServer } from './index.ts';
77

88
// Checks that the client sends a different API key after the first request.
99
function addRoutes(app: Express): void {

scripts/cts/testServer/benchmark.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import chalk from 'chalk';
66
import type { Express } from 'express';
77
import express from 'express';
88

9-
import { CI, toAbsolutePath } from '../../common.js';
9+
import { CI, toAbsolutePath } from '../../common.ts';
1010

11-
import { setupServer } from './index.js';
11+
import { setupServer } from './index.ts';
1212

1313
const benchmarkStatus: Record<
1414
string,

0 commit comments

Comments
 (0)