Skip to content

Commit

Permalink
[cascading] from release/9.6 to main (#1277)
Browse files Browse the repository at this point in the history
<!--
{"currentBranch":"release/9.6","targetBranch":"main","bypassReviewers":false,"isConflicting":false}
-->

## Cascading from release/9.6 to main

---

:heavy_exclamation_mark: The pull request is conflicting with the target
branch.
You can fix the issue locally with the following commands:

<details open>
  <summary>Using <b>gh CLI</b></summary>

  ```shell
  gh pr checkout 1277
  git pull --ff origin main
  ```

  and update this Pull Request with

  ```shell
  gh pr push 1277
  ```
</details>

<details>
  <summary>Using <b>git</b> only</summary>

  ```shell
  git fetch origin
  git checkout origin/cascading/9.6.0-main
  git pull --ff origin main
  ```

  and update this Pull Request with

  ```shell
  git push origin HEAD:cascading/9.6.0-main
  ```
</details>

---

<small>This Pull Request has been generated with :heart: by the
[Otter](https://github.com/AmadeusITGroup/otter) cascading tool.</small>
  • Loading branch information
kpanot authored Jan 26, 2024
2 parents 7db9da0 + 52eeaa0 commit ca47c5f
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 127 deletions.
1 change: 1 addition & 0 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
jobs:
markdown-link-check:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
Expand Down
6 changes: 2 additions & 4 deletions packages/@ama-sdk/create/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env node
/* eslint-disable no-console */

import { execSync, spawnSync } from 'node:child_process';
import { dirname, join, resolve } from 'node:path';
import * as minimist from 'minimist';

const packageManagerEnv = process.env.npm_config_user_agent?.split('/')[0];
const defaultScope = 'sdk';
const binPath = resolve(require.resolve('@angular-devkit/schematics-cli/package.json'), '../bin/schematics.js');
const args = process.argv.slice(2);
const argv = minimist(args);

const packageManagerEnv = process.env.npm_config_user_agent?.split('/')[0];
let defaultPackageManager = 'npm';
if (packageManagerEnv && ['npm', 'yarn'].includes(packageManagerEnv)) {
defaultPackageManager = packageManagerEnv;
Expand All @@ -18,7 +19,6 @@ if (packageManagerEnv && ['npm', 'yarn'].includes(packageManagerEnv)) {
const packageManager: string = argv['package-manager'] || defaultPackageManager;

if (argv._.length < 2) {
// eslint-disable-next-line no-console
console.error('The SDK type and project name are mandatory');
console.info(`usage: ${packageManager} create @ama-sdk typescript <@scope/package>`);
process.exit(-1);
Expand All @@ -28,7 +28,6 @@ const sdkType = argv._[0];
let [name, pck] = argv._[1].replace(/^@/, '').split('/');

if (sdkType !== 'typescript') {
// eslint-disable-next-line no-console
console.error('Only the generation of "typescript" SDK is available');
process.exit(-2);
}
Expand Down Expand Up @@ -96,7 +95,6 @@ const run = () => {
.filter((err) => !!err);

if (errors.length > 0) {
// eslint-disable-next-line no-console
errors.forEach((err) => console.error(err));
process.exit(1);
}
Expand Down
3 changes: 1 addition & 2 deletions packages/@o3r/create/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const logo = `
'|. || || || || ||
''|...|' '|.' '|.' '|...' .||.
`;

const packageManager = process.env.npm_config_user_agent?.split('/')[0];
const binPath = join(require.resolve('@angular/cli/package.json'), '../bin/ng.js');
const args = process.argv.slice(2).filter((a) => a !== '--create-application');

Expand All @@ -89,7 +89,6 @@ if (!args.some((a) => a.startsWith('--preset'))) {

const hasPackageManagerArg = args.some((a) => a.startsWith('--package-manager'));
if (!hasPackageManagerArg) {
const packageManager = process.env.npm_config_user_agent?.split('/')[0];
if (packageManager && ['npm', 'pnpm', 'yarn', 'cnpm'].includes(packageManager)) {
args.push('--package-manager', packageManager);
}
Expand Down
3 changes: 2 additions & 1 deletion packages/@o3r/design/builders/generate-css/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default createBuilder<GenerateCssSchematicsSchema>(async (options, contex

return resolve(context.workspaceRoot, options.defaultStyleFile);
};
const tokenVariableNameRenderer: TokenKeyRenderer | undefined = options.prefix ? (variable) => options.prefix + variable.getKey() : undefined;
const tokenVariableNameRenderer: TokenKeyRenderer | undefined = options.prefix ? (variable) => options.prefix! + variable.getKey() : undefined;
const logger = context.logger;
const sassRenderer = getSassTokenDefinitionRenderer({
tokenVariableNameRenderer: (v) => (options?.prefixPrivate || '') + tokenVariableNameSassRenderer(v),
Expand Down Expand Up @@ -111,6 +111,7 @@ export default createBuilder<GenerateCssSchematicsSchema>(async (options, contex
acc.success = false;
if (res.reason) {
acc.error ||= '';
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
acc.error += EOL + res.reason;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const tokenReferenceRegExp = /\{([^}]+)\}/g;
const getTokenReferenceName = (tokenName: string, parents: string[]) => (`${parents.join('.')}.${tokenName}`);
const getExtensions = (parentNode: DesignTokenNode[]) => {
return parentNode.reduce((acc, node) => {
const o3rMetadata = {...acc.o3rMetadata, ...node.$extensions?.o3rMetadata};
const o3rMetadata = { ...acc.o3rMetadata, ...node.$extensions?.o3rMetadata };
return ({ ...acc, ...node.$extensions, o3rMetadata });
}, {} as DesignTokenGroupExtensions & DesignTokenExtensions);
};
Expand Down
Loading

0 comments on commit ca47c5f

Please sign in to comment.