Skip to content

Commit

Permalink
Merge branch 'fix/sourcetype-map' into release/v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrichtr committed Aug 18, 2023
2 parents 0f2ff53 + 29af582 commit 9168a42
Show file tree
Hide file tree
Showing 15 changed files with 561 additions and 265 deletions.
101 changes: 91 additions & 10 deletions .build/profiles/default/sourcetypes.config.psd1
Original file line number Diff line number Diff line change
@@ -1,12 +1,93 @@
<#
The map identifies a path => SourceItem Properties
The path root is the Source directory
There are three "top level keys":
- FileTypes: This identifies which files are considered SourceItems. Each key represents a file extension and
its value is the FileTypes property of the object
- Path: An array of values where each index represents a "level" of subfolder below the root
Each index can be either a "Field Name" or a hashtable of regular expressions with Field Name => value.
Value can be a regex match group
- Name: A hashtable of regular expressions with Field Name => value.
Value can be a regex match group
#>

@{
'public' = @{ Visibility = 'public'; Type = 'function' }
'class' = @{ Visibility = 'private'; Type = 'class' }
'classes' = @{ Visibility = 'private'; Type = 'class' }
'enum' = @{ Visibility = 'private'; Type = 'enum' }
'private' = @{ Visibility = 'private'; Type = 'function' }
'tasks' = @{ Visibility = 'public' ; Type = 'task' }
'resource' = @{ Visibility = 'private'; Type = 'resource' }
'assembly' = @{ Visibility = 'private'; Type = 'resource' }
'assemblies' = @{ Visibility = 'private'; Type = 'resource' }
'data' = @{ Visibility = 'private'; Type = 'resource' }
FileTypes = @{
'\.ps1$' = @{
FileType = 'PowerShell File'
}
'\.eps1$' = @{
FileType = 'Embedded PowerShell'
Type = 'template'

}
'\.psd1$' = @{
FileType = 'PowerShell Data File'
Type = 'data'
}
'\.psm1$' = @{
FileType = 'PowerShell Module File'
Type = 'module'
Visibility = 'public'
}
}

<#
An example path (relative to the source directory):
Path : Module1/public/Engine/Start-RocketEngine.ps1
Level : 0 1 2 3
#>
Path = @(
# Level 0
'Module',
# Level 1
@{
'^private' = @{
Visibility = 'private'
Type = 'function'
}
'^public' = @{
Visibility = 'public'
Type = 'function'
}
'^enum' = @{
Visibility = 'private'
Type = 'enum'
}
'operations' = @{
Visibility = 'private'
Type = 'operation'
}
},
# Level 2
@{
# does not have a '.' in the word
# '(^[^.]+$)' = @{
'{t.dir}' = @{
Component = '{n}'
}
}
)
Name = @{
'Configuration\.psd1' = @{
FileType = 'Module Configuration'
Visibility = 'private'
Type = 'Settings'
}
'(\w+)-(\w+)' = @{
Verb = '{1}'
Noun = '{2}'
}
'(.*?)\.task' = @{
Visibility = 'public'
Type = 'task-file'
Name = '{1}'
}
'(.*?)\.build' = @{
Visibility = 'public'
Type = 'build-script'
Name = '{1}'
}
}

}
Loading

0 comments on commit 9168a42

Please sign in to comment.