constructor()

in projenrc/projects/aws-arch-project.ts [11:114]


  constructor(parent: Project) {
    super({
      parent,
      author: "AWS APJ COPE",
      authorAddress: "apj-cope@amazon.com",
      defaultReleaseBranch: "mainline",
      name: "aws-arch",
      keywords: ["aws", "pdk", "jsii", "projen", "icons", "assets", "cfnspec"],
      repositoryUrl: "https://github.com/aws/aws-pdk",
      devDeps: [
        "@aws-cdk/cfnspec",
        "@types/lodash",
        "@types/fs-extra@9.0.13",
        "@types/node-fetch@2",
        "@types/sharp",
        "@types/unzipper",
        "@types/xml-flow",
        "execa@5.1.1",
        "fs-extra",
        "lodash",
        "node-fetch@^2.6.7",
        "projen",
        "sharp",
        "tree-cli",
        "unzipper",
        "xml-flow",
      ],
      peerDeps: ["projen", "constructs"],
      stability: Stability.STABLE,
    });

    this.eslint?.addIgnorePattern("scripts/**");
    this.addGitIgnore("/src/generated/");
    this.addGitIgnore("/assets/");

    this.jest?.addIgnorePattern("src/internal/");

    this.package.addField("files", [
      "assets",
      "lib",
      "LICENSE_THIRD_PARTY",
      "NOTICE",
      ".jsii",
    ]);

    this.addTask("fetch-pricing-manifest", {
      exec: "ts-node ./scripts/aws-arch/fetch-pricing-manifest.ts",
    });

    const generateTasks = [
      this.addTask("clean", {
        exec: "rm -rf assets src/generated",
      }),
      this.addTask("generate:assets", {
        exec: "ts-node ./scripts/aws-arch/generate-assets.ts",
      }),
      this.addTask("generate:cfnspec-types", {
        exec: "ts-node ./scripts/aws-arch/generate-cfnspec-types.ts",
      }),
      this.addTask("generate:drawio-spec", {
        exec: "ts-node ./scripts/aws-arch/generate-drawio-spec.ts",
      }),
      this.addTask("generate:pricing-manifest", {
        exec: "ts-node ./scripts/aws-arch/generate-pricing-manifest.ts",
      }),
      this.addTask("generate:mappings", {
        exec: "ts-node ./scripts/aws-arch/generate-mappings.ts",
      }),
    ];

    this.addTask("generate", {
      steps: generateTasks.map(
        (task): TaskStep => ({
          spawn: task.name,
        })
      ),
    });

    // Invoke with nx to support caching
    this.preCompileTask.exec("pnpm nx run generate");

    const generateOutputs = [
      "{projectRoot}/assets",
      "{projectRoot}/src/generated",
    ];

    this.nx.setTarget("generate", {
      inputs: [
        "{projectRoot}/scripts/**",
        "{projectRoot}/static/**",
        "!{projectRoot}/src/*",
        "{projectRoot}/src/!(generated)/**",
      ],
      outputs: generateOutputs,
    });

    this.nx.setTarget(
      "build",
      {
        outputs: generateOutputs,
      },
      true
    );
  }