Skip to content

Commit 7ef913f

Browse files
adadoucheAbdelhalim Dadouche
andauthored
Minor updates (#22)
* moving the code to cdk folder * - switching from npm to yarn - updating libraries to new cdk version and requirements * adjusting the example to the new code from adadouche/aws4embeddedlinux-ci#dev-adadouche * doc adjustments * updated documentation * adjusting to aws4embeddedlinux-ci latest version * adjusting to aws4embeddedlinux-ci latest version * fixing package reference * doc adjustments * updating eslint, removing unused tests code * updating dependencies --------- Co-authored-by: Abdelhalim Dadouche <[email protected]>
1 parent 62dc596 commit 7ef913f

14 files changed

+5195
-2996
lines changed

.editorconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ root = true
77
[*]
88
end_of_line = lf
99
insert_final_newline = true
10-
11-
[*.{js,json,yml}]
1210
charset = utf-8
1311
indent_style = space
14-
indent_size = 2
12+
tab_width = 2

.gitignore

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
node_modules
1+
*.js
2+
!jest.config.js
3+
!.eslintrc.js
4+
!.prettierrc.js
5+
6+
!lib/**/*.ts
7+
!test/**/*.ts
8+
*.d.ts
9+
210
dist
11+
node_modules
12+
13+
# yarn asset
14+
yarn-install.log
15+
.yarn
16+
!.yarn/releases/
17+
!.yarn/plugins/
18+
!.yarn/versions/
19+
!.yarn/sdks/
20+
.pnp.*
321

422
# yarn asset
523
yarn-install.log

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"eslint.alwaysShowStatus": true,
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll.eslint": true
5+
},
6+
"explorer.autoReveal": false
7+
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ where **\<pipeline-id\>** can be one or more of the following:
117117

118118
Again, the created pipeline can be found in the AWS console under `Developer Tools > Pipeline - CodePipeline > Pipelines`.
119119

120-
> [!**NXP-IMX**]
120+
> [!NOTE] **NXP-IMX**
121121
>
122122
> The deployed pipeline for **NXP-IMX** will not complete as you should first accept the EULA and update the `build.buildspec.yml` file accordingly. See the [IMX Yocto Users Guide](https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf) for more detail.
123123
>
@@ -130,7 +130,7 @@ Again, the created pipeline can be found in the AWS console under `Developer Too
130130
> Once you have adjusted the content, you can update and upload the zip back to Amazon S3, and the pipeline will restart.
131131
>
132132
133-
> [!**Renesas**]
133+
> [!NOTE] **Renesas**
134134
>
135135
> The deployed pipeline for **Renesas** will complete. However, it won't include the Multimedia and Graphics library and related Linux drivers. See the [Renesas](https://github.com/adadouche/aws4embeddedlinux-ci/blob/dev-adadouche/README.md#renesas) section for more detail.
136136
> The source files are available in a S3 bucket that you can get with the following command:
@@ -142,7 +142,7 @@ Again, the created pipeline can be found in the AWS console under `Developer Too
142142
> Once you have adjusted the content, you can update and upload the zip back to Amazon S3, and the pipeline will restart.
143143
>
144144
145-
> [!**Custom Pipeline**]
145+
> [!NOTE] **Custom Pipeline**
146146
>
147147
> When using the **Custom** pipeline, you will need to provide your own `build.buildspec.yml` file.
148148
>
@@ -161,7 +161,7 @@ To deploy _all_ the example pipelines, you can use the CDK deploy command:
161161
cdk deploy aws4el-ci-pipelines --require-approval never --concurrency 3
162162
```
163163
164-
> [!*NOTE*]
164+
> [!NOTE]
165165
>
166166
> `aws4el-ci-pipelines`is an empty stack that depends on the other stacks, so that if you deploy it, it will deploy the others.
167167
>

cdk/.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

cdk/.eslintrc.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

cdk/bin/app.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
import path = require("path");
2+
import * as path from "path";
33

44
import * as cdk from "aws-cdk-lib";
55
import {
@@ -39,7 +39,7 @@ const pipelineResourcesStack = new PipelineResourcesStack(
3939
{
4040
...defaultProps,
4141
resource_prefix: resource_prefix,
42-
}
42+
},
4343
);
4444

4545
const baseImageStack = new EmbeddedLinuxCodePipelineBaseImageStack(
@@ -51,7 +51,7 @@ const baseImageStack = new EmbeddedLinuxCodePipelineBaseImageStack(
5151
pipelineArtifactBucket: pipelineResourcesStack.pipelineArtifactBucket,
5252
ecrRepository: pipelineResourcesStack.ecrRepository,
5353
encryptionKey: pipelineResourcesStack.encryptionKey,
54-
}
54+
},
5555
);
5656

5757
/**
@@ -66,7 +66,7 @@ new EmbeddedLinuxCodeBuildProjectStack(
6666
ecrRepositoryImageTag: baseImageStack.ecrRepositoryImageTag,
6767
vpc: pipelineResourcesStack.vpc,
6868
encryptionKey: pipelineResourcesStack.encryptionKey,
69-
}
69+
},
7070
);
7171

7272
/**
@@ -97,18 +97,23 @@ for (const projectType of projectTypes) {
9797
pipelineArtifactPrefix: `pipeline-${projectType}`,
9898
vpc: pipelineResourcesStack.vpc,
9999
encryptionKey: pipelineResourcesStack.encryptionKey,
100-
}
100+
},
101101
);
102102
projectPipeline.addDependency(pipelineResourcesStack);
103-
pipelines.addDependency(projectPipeline)
103+
pipelines.addDependency(projectPipeline);
104104
}
105105

106106
/**
107107
* Create custom project pipeline.
108108
*/
109109
const projectType = ProjectType.Custom;
110110

111-
const sourceCustomPath : string = path.join(__dirname, "..", "source-repo", projectType);
111+
const sourceCustomPath: string = path.join(
112+
__dirname,
113+
"..",
114+
"source-repo",
115+
projectType,
116+
);
112117
console.log(`Using custom source path: ${sourceCustomPath}`);
113118

114119
const projectPipeline = new EmbeddedLinuxCodePipelineStack(
@@ -125,11 +130,11 @@ const projectPipeline = new EmbeddedLinuxCodePipelineStack(
125130
pipelineArtifactPrefix: `pipeline-${projectType}`,
126131
vpc: pipelineResourcesStack.vpc,
127132
encryptionKey: pipelineResourcesStack.encryptionKey,
128-
sourceCustomPath : sourceCustomPath
129-
}
133+
sourceCustomPath: sourceCustomPath,
134+
},
130135
);
131136
projectPipeline.addDependency(pipelineResourcesStack);
132-
pipelines.addDependency(projectPipeline)
137+
pipelines.addDependency(projectPipeline);
133138

134139
// Synthetize the app
135-
app.synth();
140+
app.synth();

cdk/eslint.config.mjs

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
2+
import simpleImportSort from "eslint-plugin-simple-import-sort";
3+
import tsdoc from "eslint-plugin-tsdoc";
4+
import globals from "globals";
5+
import tsParser from "@typescript-eslint/parser";
6+
import path from "node:path";
7+
import { fileURLToPath } from "node:url";
8+
import eslintjs from "@eslint/js";
9+
import eslintts from "typescript-eslint";
10+
import { FlatCompat } from "@eslint/eslintrc";
11+
12+
const __filename = fileURLToPath(import.meta.url);
13+
const __dirname = path.dirname(__filename);
14+
15+
import { includeIgnoreFile } from "@eslint/compat";
16+
const gitignorePath = path.resolve(__dirname, "..", ".gitignore");
17+
18+
const compat = new FlatCompat({
19+
baseDirectory: __dirname,
20+
recommendedConfig: eslintjs.configs.recommended,
21+
allConfig: eslintjs.configs.all,
22+
});
23+
24+
export default [
25+
...compat.extends(
26+
"eslint:recommended",
27+
"plugin:@typescript-eslint/recommended",
28+
"plugin:prettier/recommended"
29+
),
30+
...eslintts.configs.recommended,
31+
{
32+
...eslintjs.configs.recommended,
33+
plugins: {
34+
"@typescript-eslint": typescriptEslintEslintPlugin,
35+
"simple-import-sort": simpleImportSort,
36+
tsdoc,
37+
},
38+
39+
languageOptions: {
40+
globals: {
41+
...globals.node,
42+
...globals.jest,
43+
},
44+
45+
parser: tsParser,
46+
ecmaVersion: "latest",
47+
sourceType: "module",
48+
49+
parserOptions: {
50+
sourceType: "module",
51+
project: "./tsconfig.eslint.json",
52+
},
53+
},
54+
55+
rules: {
56+
"tsdoc/syntax": "warn",
57+
58+
"max-len": [
59+
"error",
60+
{
61+
code: 150,
62+
ignoreUrls: true,
63+
ignoreStrings: true,
64+
ignoreTemplateLiterals: true,
65+
ignoreComments: true,
66+
ignoreRegExpLiterals: true,
67+
},
68+
],
69+
70+
"prettier/prettier": [
71+
"error",
72+
{
73+
singleQuote: false,
74+
trailingComma: "all",
75+
},
76+
],
77+
78+
"@typescript-eslint/no-unused-vars": [
79+
"error",
80+
{
81+
args: "all",
82+
argsIgnorePattern: "^_",
83+
caughtErrors: "all",
84+
caughtErrorsIgnorePattern: "^_",
85+
destructuredArrayIgnorePattern: "^_",
86+
varsIgnorePattern: "^_",
87+
ignoreRestSiblings: true,
88+
},
89+
],
90+
},
91+
ignores: [
92+
"jest.config.js",
93+
"package.json",
94+
"package-lock.json",
95+
"tsconfig.json",
96+
"typedoc.json",
97+
"/cdk.out/**",
98+
"/dist/**",
99+
"/docs/**",
100+
"/test/**",
101+
"/tmp/**",
102+
],
103+
},
104+
includeIgnoreFile(gitignorePath),
105+
];

0 commit comments

Comments
 (0)