forked from AmadeusITGroup/otter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63b5bc1
commit 48e3818
Showing
105 changed files
with
3,880 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/showcase/scripts/prepare-training-exercises/index.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const {readdir, readFile, writeFile} = require('node:fs/promises'); | ||
const {getFilesTree} = require('@o3r/training-tools'); | ||
const {dirname, join, resolve} = require('node:path'); | ||
const glob = require('globby'); | ||
|
||
/** | ||
* The Chrome Extension mechanism does not accept exports in loaded module | ||
* The purpose of this script is to remove the empty `export` generated by TSC | ||
*/ | ||
|
||
void (async () => { | ||
const root = resolve(__dirname, '..', '..'); | ||
const files = await glob('src/assets/*-training/**/(exercise|solution)/**', {cwd: root}); | ||
const paths = files.reduce((exercisePaths, file) => { | ||
const exerciseDirectory = dirname(file).match('(.*/(?:exercise|solution))')[0]; | ||
exercisePaths.add(`${exerciseDirectory}`); | ||
return exercisePaths; | ||
}, new Set()); | ||
for (const folder of paths) { | ||
const filePath = join(root, folder); | ||
const exerciseStructure = await getFilesTree([{isDir: true, path: `${filePath}`}], {readdir, readFile}); | ||
const [_, commonPath, folderName] = folder.match('(.*)/(exercise|solution)'); | ||
const targetPath = join(commonPath, `${folderName}.json`); | ||
const content = JSON.stringify(exerciseStructure); | ||
await writeFile(targetPath, content); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './sdk-training.component'; |
3 changes: 3 additions & 0 deletions
3
apps/showcase/src/app/sdk-training/sdk-training.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
o3r-training { | ||
height: calc(100vh - 4rem); | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/showcase/src/app/sdk-training/sdk-training.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { SdkTrainingComponent } from './sdk-training.component'; | ||
|
||
describe('SdkTrainingComponent', () => { | ||
let component: SdkTrainingComponent; | ||
let fixture: ComponentFixture<SdkTrainingComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [SdkTrainingComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(SdkTrainingComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/showcase/src/app/sdk-training/sdk-training.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
import { | ||
TrainingComponent | ||
} from '../../components'; | ||
|
||
@Component({ | ||
selector: 'o3r-sdk-training', | ||
standalone: true, | ||
imports: [ | ||
TrainingComponent | ||
], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
template: '<o3r-training [title]="\'SDK Training\'" [trainingPath]="\'sdk-training\'"></o3r-training>', | ||
styleUrls: ['./sdk-training.component.scss'] | ||
}) | ||
export class SdkTrainingComponent {} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
[ | ||
{ | ||
"title": "Welcome to the Otter SDK tutorial", | ||
"htmlContentUrl": "./steps/welcome/instructions.html" | ||
}, | ||
{ | ||
"title": "Introduction", | ||
"htmlContentUrl": "./steps/introduction/instructions.html" | ||
}, | ||
{ | ||
"title": "How to use the Otter SDK?", | ||
"htmlContentUrl": "./steps/typescript-sdk/instructions.html" | ||
}, | ||
{ | ||
"title": "Customize your fetch client with plugins", | ||
"htmlContentUrl": "./steps/plugins/instructions.html" | ||
}, | ||
{ | ||
"title": "Integrate your component in Angular", | ||
"htmlContentUrl": "./steps/angular-integration/instructions.html", | ||
"filesConfiguration": { | ||
"name": "angular-integration", | ||
"startingFile": "apps/tutorial-app/src/app/app.component.ts", | ||
"urls": { | ||
".": "./shared/monorepo-template.json", | ||
"./libs/sdk/src": "@o3r/training-sdk/folder-structure.json" | ||
}, | ||
"mode": "interactive", | ||
"commands": ["npm install --legacy-peer-deps --ignore-scripts --force", "npm run ng run sdk:build", "npm run ng run tutorial-app:serve"] | ||
} | ||
}, | ||
{ | ||
"title": "Generate your first SDK - Specifications", | ||
"htmlContentUrl": "./steps/sdk-specs/instructions.html", | ||
"filesConfiguration": { | ||
"name": "sdk-specification", | ||
"startingFile": "open-api.yaml", | ||
"solutionUrls": { | ||
".": "@o3r/training-sdk/openapi-structure.json" | ||
}, | ||
"mode": "readonly", | ||
"commands": [] | ||
} | ||
}, | ||
{ | ||
"title": "Generate your first SDK - Command", | ||
"htmlContentUrl": "./steps/sdk-generation/instructions.html", | ||
"filesConfiguration": { | ||
"name": "generate-sdk", | ||
"startingFile": "src/api/dummy/dummy-api.ts", | ||
"solutionUrls": { | ||
"src": "@o3r/training-sdk/folder-structure.json", | ||
".": "@o3r/training-sdk/openapi-structure.json" | ||
}, | ||
"mode": "readonly", | ||
"commands": [] | ||
} | ||
}, | ||
{ | ||
"title": "SDK with Dates - Generation", | ||
"htmlContentUrl": "./steps/date-sdk-generation/instructions.html", | ||
"filesConfiguration": { | ||
"name": "generate-date-sdk", | ||
"startingFile": "open-api.yaml", | ||
"urls": { | ||
".": "@o3r/training-sdk/openapi-structure.json" | ||
}, | ||
"solutionUrls": { | ||
".": "@o3r/training-sdk/openapi-structure.json", | ||
"./src": "@o3r/training-sdk/folder-structure.json" | ||
}, | ||
"mode": "readonly", | ||
"commands": [] | ||
} | ||
}, | ||
{ | ||
"title": "SDK with Dates - How to use", | ||
"htmlContentUrl": "./steps/date/instructions.html", | ||
"filesConfiguration": { | ||
"name": "utils-date", | ||
"startingFile": "apps/app/src/app/app.component.ts", | ||
"urls": { | ||
".": "./shared/empty.json", | ||
"./apps/app/src/app": "./steps/date/exercise.json" | ||
}, | ||
"solutionUrls": { | ||
"./apps/app/src/app": "./steps/date/solution.json" | ||
}, | ||
"mode": "interactive", | ||
"commands": [ | ||
"npm install --legacy-peer-deps --ignore-scripts --force", | ||
"npm run ng run app:serve" | ||
] | ||
} | ||
}, | ||
{ | ||
"title": "SDK with model extension", | ||
"htmlContentUrl": "./steps/model-extension/instructions.html", | ||
"filesConfiguration": { | ||
"name": "model-extension", | ||
"startingFile": "package.json", | ||
"urls": { | ||
".": "./shared/monorepo-template.json" | ||
}, | ||
"mode": "interactive", | ||
"commands": [ | ||
"npm install --legacy-peer-deps --ignore-scripts --force", | ||
"npm run ng run sdk:build", | ||
"npm run ng run tutorial-app:serve" | ||
] | ||
} | ||
} | ||
] |
127 changes: 127 additions & 0 deletions
127
apps/showcase/src/assets/sdk-training/shared/empty.json
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.