Sha256: 692fe686248b3b027c2e461aed7c8742d739bdb9ca268ed0a5f6cfe95cb6bbcc
Contents?: true
Size: 974 Bytes
Versions: 18
Compression:
Stored size: 974 Bytes
Contents
# frozen_string_literal: true require "pathname" module Script module Layers module Infrastructure class AssemblyScriptTsConfig TSCONFIG_FILE = "tsconfig.json" attr_reader :config def initialize(dir_to_write_in:) @dir_to_write_in = dir_to_write_in @config = {} end def with_extends_assemblyscript_config(relative_path_to_node_modules:) relative_path = Pathname.new(relative_path_to_node_modules).relative_path_from(@dir_to_write_in) @config[:extends] = "#{relative_path}/node_modules/assemblyscript/std/assembly.json" self end def with_module_resolution_paths(paths:) @config[:compilerOptions] = { baseUrl: ".", paths: paths, } self end def write File.write("#{@dir_to_write_in}/#{TSCONFIG_FILE}", JSON.pretty_generate(@config)) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems