# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license

load("//tools:defaults.bzl", "ts_library")
load("//tools:ts_json_schema.bzl", "ts_json_schema")

licenses(["notice"])  # MIT

package(default_visibility = ["//visibility:public"])

ts_library(
    name = "schematics",
    srcs = glob(
        include = ["**/*.ts"],
        exclude = [
            "**/*_spec.ts",
            "**/*_benchmark.ts",
            "schematic/files/**",
            "blank/project-files/**",
            "blank/schematic-files/**",
            # NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
            "node_modules/**",
        ],
    ) + [
        # @external_begin
        # These files are generated from the JSON schema
        "//packages/schematics/schematics:blank/schema.ts",
        "//packages/schematics/schematics:schematic/schema.ts",
        # @external_end
    ],
    data = glob(
        include = [
            "collection.json",
            "package.json",
            "blank/schema.json",
            "blank/project-files/**/*",
            "blank/schematic-files/**/*",
            "schematic/schema.json",
            "schematic/files/**/*",
        ],
    ),
    module_name = "@schematics/schematics",
    deps = [
        "//packages/angular_devkit/core",
        "//packages/angular_devkit/schematics",
        "//packages/angular_devkit/schematics/tasks",
        "@npm//@types/node",
        "@npm//rxjs",
    ],
)

ts_json_schema(
    name = "blank_schema",
    src = "blank/schema.json",
)

ts_json_schema(
    name = "schematic_schema",
    src = "schematic/schema.json",
)
