This projen project template is used to create a new OVOS Skill, which can be used with both OVOS and Neon.AI voice assistants. It can also be used to retrofit an existing MycroftSkill to work with OVOS' most current development practices.
Projen was created by primarily TypeScript developers working in the AWS CDK ecosystem, so it is written in TypeScript and requires Node.js to run.
Generally, it is recommended to use nvm
(Node Version Manager) to install Node.js on Linux and macOS. Instructions for installing nvm
can be found at github.com/nvm-sh/nvm.
After you've installed Node, projen can be installed globally with:
npm install -g projen
Generally, most projen
users alias the npx projen
command to pj
for convenience. This can be done with:
alias pj='npx projen'
Add that to your ~/.bashrc
or ~/.zshrc
file to make it permanent. Be sure to run source ~/.bashrc
or source ~/.zshrc
to reload your shell after adding the line above.
In a new directory, run:
npx projen new ovosskill --from "@mikejgray/ovos-skill-projen@latest"
NOTE: This repo is not yet available on NPM. Please add the following to your ~/.npmrc
file (create one if it doesn't exist), with a GitHub token that has packages:read permissions:
//npm.pkg.github.com/:_authToken=ghp_aeojghxotdj583r38fgzrh48
@mikejgray:registry=https://npm.pkg.github.com
After the skill has been created with default options, a file called .projenrc.json
will be generated. This file contains all of the options used to create the skill, and can be edited to change the skill's configuration. For a full list of supported options, see API.md
.
Most commonly, you will want to change the name
, author
, authorAddress
, authorHandle
, skillClass
, and repositoryUrl
options. If you prefer to have an explicitly named directory for your source code instead of the default src
, then packageDir
should also be set. The type
option should be left alone, as it is used to tell projen which project template to use.
Example:
{
"type": "@mikejgray/ovos-skill-projen.OVOSSkillProject",
"name": "test-skill",
"author": "Mike Gray",
"authorAddress": "[email protected]",
"authorHandle": "mikejgray",
"repositoryUrl": "https://github.com/mikejgray/test-skill",
"packageDir": "test_skill",
"skillClass": "TestSkill"
}
After editing .projenrc.json
, run pj
to regenerate the project files. This can automatically keep your project up to date with the latest changes, including managing your setup.py
file.
In a new directory, run:
npx projen new ovosphalproject --from "@mikejgray/ovos-skill-projen@latest"
The instructions are the same as for creating a new skill template, except that you have an additional option to set the PHAL plugin as admin or not. The default is false
, indicating that the PHAL plugin will not run as root.
NOTE: If you do set the PHAL plugin to admin
and thus run as root, you will also need to update your OVOS config to explicitly allow your root plugins. This is a security risk and should only be done if you understand the implications. For more information about Admin PHAL, see the OVOS technical manual.
Example OVOS config:
{
"PHAL": {
"admin": "ovos-phal-plugin-helloworld": {"enabled": true}
}
}
Note that projen takes ownership of the setup.py
file, and the expectation is that manual edits are not allowed. If you need to make changes to the setup.py
file, you should do so by editing .projenrc.json
and running pj
to regenerate the file.
If you prefer not to keep the skill repository under projen's management, simply delete node_modules
, .projenrc.json
, .gitattributes
, .projen
, and package.json
from the skill directory. You can also delete .github/workflows
if you do not want to use GitHub Actions automation workflows.
If you have an existing Mycroft skill that you'd like to convert to an OVOS skill, you can do so by running the following command in your skill directory:
projen new ovosskill --from "@mikejgray/ovos-skill-projen@latest" --retrofit
This will:
- Add the OVOS skill requirements to your
requirements.txt
file, creating one if it does not exist - Overwrite your .gitignore file with a standard Python .gitignore plus
node_modules
and.DS_Store
- Create a dev branch, if one does not exist, and commit the changes to it
- Add all of OVOS' standard GitHub Actions workflows to your
.github/workflows
directory - Move files in
ui
,intent
,dialog
, etc. directories tolocale
, respecting the language folders within - Replace Mycroft imports with their OVOS replacements in your
__init__.py
file, assuming it is in the root of the repo
It will not:
- Overwrite your README.md file, if it exists, or create one if it does not exist
- Create sample code
- Touch your LICENSE file
- Note that official OVOS and Neon skills have skill license requirements that may not be compatible with your existing license, if you want to submit it as part of one of those organizations. Please review the OVOS skill license requirements. If you are not submitting your skill to OVOS or Neon, you can use any license you like, and should set
skillLicenseTest: false
in your.projenrc.json
file.
- Note that official OVOS and Neon skills have skill license requirements that may not be compatible with your existing license, if you want to submit it as part of one of those organizations. Please review the OVOS skill license requirements. If you are not submitting your skill to OVOS or Neon, you can use any license you like, and should set
Once the retrofit is complete, you can review the changes needed for modernization with grep TODO __init__.py
. This project attempts to handle as many as possible, but due to differences in code style and structure, some changes will need to be made manually.
If your skill code is not in __init__.py
in the repository root, the retrofit code won't be able to find it. PRs welcome to add support for other skill structures.
import { OVOSPHALProjectOptions } from '@mikejgray/ovos-skill-projen'
const oVOSPHALProjectOptions: OVOSPHALProjectOptions = { ... }
Name | Type | Description |
---|---|---|
name |
string |
This is the name of your project. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
gitIgnoreOptions |
projen.IgnoreFileOptions |
Configuration options for .gitignore file. |
gitOptions |
projen.GitOptions |
Configuration options for git. |
logging |
projen.LoggerOptions |
Configure logging options such as verbosity. |
outdir |
string |
The root directory of the project. |
parent |
projen.Project |
The parent project, if this project is part of a bigger project. |
projenCommand |
string |
The shell command to use in order to run the projen CLI. |
projenrcJson |
boolean |
Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
projenrcJsonOptions |
projen.ProjenrcJsonOptions |
Options for .projenrc.json. |
renovatebot |
boolean |
Use renovatebot to handle dependency upgrades. |
renovatebotOptions |
projen.RenovatebotOptions |
Options for renovatebot. |
autoApproveOptions |
projen.github.AutoApproveOptions |
Enable and configure the 'auto approve' workflow. |
autoMerge |
boolean |
Enable automatic merging on GitHub. |
autoMergeOptions |
projen.github.AutoMergeOptions |
Configure options for automatic merging on GitHub. |
clobber |
boolean |
Add a clobber task which resets the repo to origin. |
devContainer |
boolean |
Add a VSCode development environment (used for GitHub Codespaces). |
github |
boolean |
Enable GitHub integration. |
githubOptions |
projen.github.GitHubOptions |
Options for GitHub integration. |
gitpod |
boolean |
Add a Gitpod development environment. |
mergify |
boolean |
Whether mergify should be enabled on this repository or not. |
mergifyOptions |
projen.github.MergifyOptions |
Options for mergify. |
projectType |
projen.ProjectType |
Which type of project this is (library/app). |
projenCredentials |
projen.github.GithubCredentials |
Choose a method of providing GitHub API access for projen workflows. |
projenTokenSecret |
string |
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
readme |
projen.SampleReadmeProps |
The README setup. |
stale |
boolean |
Auto-close of stale issues and pull request. |
staleOptions |
projen.github.StaleOptions |
Auto-close stale issues and pull requests. |
vscode |
boolean |
Enable VSCode integration. |
author |
string |
The name of the skill's author. |
authorAddress |
string |
The email address of the skill's author. |
authorHandle |
string |
The GitHub handle of the skill's author. |
condenseLocaleFolders |
boolean |
Restructure locale folders to be more OVOS-like? |
githubWorkflows |
boolean |
Add Github Actions workflows? |
license |
string |
The license of the skill. |
packageDir |
string |
The name of the directory containing the skill's code. |
pypiName |
string |
The name of the skill's PyPi package. |
repositoryUrl |
string |
The URL of the skill's GitHub repository. |
retrofit |
boolean |
Retrofit an existing Mycroft skill to OVOS? |
sampleCode |
boolean |
Include sample code? |
skillClass |
string |
The name of the skill class. |
skillDescription |
string |
The description of the skill. |
skillKeywords |
string |
Keywords for your skill package. |
skillLicenseTest |
boolean |
Include a test to check that the skill's license is FOSS? |
admin |
boolean |
Is this an admin PHAL plugin? |
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
public readonly gitIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
public readonly gitOptions: GitOptions;
- Type: projen.GitOptions
Configuration options for git.
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
public readonly outdir: string;
- Type: string
- Default: "."
The root directory of the project.
Relative to this directory, all files are synthesized.
If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other sub-projects.
public readonly parent: Project;
- Type: projen.Project
The parent project, if this project is part of a bigger project.
public readonly projenCommand: string;
- Type: string
- Default: "npx projen"
The shell command to use in order to run the projen CLI.
Can be used to customize in special environments.
public readonly projenrcJson: boolean;
- Type: boolean
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
public readonly renovatebot: boolean;
- Type: boolean
- Default: false
Use renovatebot to handle dependency upgrades.
public readonly renovatebotOptions: RenovatebotOptions;
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
public readonly autoApproveOptions: AutoApproveOptions;
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
public readonly autoMerge: boolean;
- Type: boolean
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
public readonly autoMergeOptions: AutoMergeOptions;
- Type: projen.github.AutoMergeOptions
- Default: see defaults in
AutoMergeOptions
Configure options for automatic merging on GitHub.
Has no effect if
github.mergify
or autoMerge
is set to false.
public readonly clobber: boolean;
- Type: boolean
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
public readonly github: boolean;
- Type: boolean
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
public readonly githubOptions: GitHubOptions;
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
- Deprecated: use
githubOptions.mergify
instead
public readonly mergify: boolean;
- Type: boolean
- Default: true
Whether mergify should be enabled on this repository or not.
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
- Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
- Type: projen.ProjectType
- Default: ProjectType.UNKNOWN
Which type of project this is (library/app).
public readonly projenCredentials: GithubCredentials;
- Type: projen.github.GithubCredentials
- Default: use a personal access token named PROJEN_GITHUB_TOKEN
Choose a method of providing GitHub API access for projen workflows.
- Deprecated: use
projenCredentials
public readonly projenTokenSecret: string;
- Type: string
- Default: "PROJEN_GITHUB_TOKEN"
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
This token needs to have the repo
, workflows
and packages
scope.
public readonly readme: SampleReadmeProps;
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
public readonly stale: boolean;
- Type: boolean
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
public readonly staleOptions: StaleOptions;
- Type: projen.github.StaleOptions
- Default: see defaults in
StaleOptions
Auto-close stale issues and pull requests.
To disable set stale
to false
.
public readonly vscode: boolean;
- Type: boolean
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
public readonly author: string;
- Type: string
- Default: "TODO: Your Name"
The name of the skill's author.
Example
"Mike Gray"
public readonly authorAddress: string;
- Type: string
- Default: "TODO: Your Email"
The email address of the skill's author.
Example
public readonly authorHandle: string;
- Type: string
- Default: ""
The GitHub handle of the skill's author.
Example
"mikejgray"
public readonly condenseLocaleFolders: boolean;
- Type: boolean
- Default: true
Restructure locale folders to be more OVOS-like?
public readonly githubWorkflows: boolean;
- Type: boolean
- Default: true
Add Github Actions workflows?
public readonly license: string;
- Type: string
- Default: Apache-2.0
The license of the skill.
Example
MIT
public readonly packageDir: string;
- Type: string
- Default: "" (root)
The name of the directory containing the skill's code.
Example
"hello_world_skill"
public readonly pypiName: string;
- Type: string
The name of the skill's PyPi package.
Example
ovos-hello-world-skill
public readonly repositoryUrl: string;
- Type: string
- Default: "TODO: PLACEHOLDER"
The URL of the skill's GitHub repository.
Example
"https://github.com/OpenVoiceOS/ovos-hello-world-skill"
public readonly retrofit: boolean;
- Type: boolean
- Default: false
Retrofit an existing Mycroft skill to OVOS?
public readonly sampleCode: boolean;
- Type: boolean
- Default: true
Include sample code?
public readonly skillClass: string;
- Type: string
The name of the skill class.
Example
HelloWorldSkill
public readonly skillDescription: string;
- Type: string
- Default: ""
The description of the skill.
Used in setup.py.
Example
"A simple skill that says hello world"
public readonly skillKeywords: string;
- Type: string
- Default: "ovos skill plugin"
Keywords for your skill package.
public readonly skillLicenseTest: boolean;
- Type: boolean
- Default: true
Include a test to check that the skill's license is FOSS?
public readonly admin: boolean;
- Type: boolean
- Default: false
Is this an admin PHAL plugin?
import { OVOSSkillProjectOptions } from '@mikejgray/ovos-skill-projen'
const oVOSSkillProjectOptions: OVOSSkillProjectOptions = { ... }
Name | Type | Description |
---|---|---|
name |
string |
This is the name of your project. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
gitIgnoreOptions |
projen.IgnoreFileOptions |
Configuration options for .gitignore file. |
gitOptions |
projen.GitOptions |
Configuration options for git. |
logging |
projen.LoggerOptions |
Configure logging options such as verbosity. |
outdir |
string |
The root directory of the project. |
parent |
projen.Project |
The parent project, if this project is part of a bigger project. |
projenCommand |
string |
The shell command to use in order to run the projen CLI. |
projenrcJson |
boolean |
Generate (once) .projenrc.json (in JSON). Set to false in order to disable .projenrc.json generation. |
projenrcJsonOptions |
projen.ProjenrcJsonOptions |
Options for .projenrc.json. |
renovatebot |
boolean |
Use renovatebot to handle dependency upgrades. |
renovatebotOptions |
projen.RenovatebotOptions |
Options for renovatebot. |
autoApproveOptions |
projen.github.AutoApproveOptions |
Enable and configure the 'auto approve' workflow. |
autoMerge |
boolean |
Enable automatic merging on GitHub. |
autoMergeOptions |
projen.github.AutoMergeOptions |
Configure options for automatic merging on GitHub. |
clobber |
boolean |
Add a clobber task which resets the repo to origin. |
devContainer |
boolean |
Add a VSCode development environment (used for GitHub Codespaces). |
github |
boolean |
Enable GitHub integration. |
githubOptions |
projen.github.GitHubOptions |
Options for GitHub integration. |
gitpod |
boolean |
Add a Gitpod development environment. |
mergify |
boolean |
Whether mergify should be enabled on this repository or not. |
mergifyOptions |
projen.github.MergifyOptions |
Options for mergify. |
projectType |
projen.ProjectType |
Which type of project this is (library/app). |
projenCredentials |
projen.github.GithubCredentials |
Choose a method of providing GitHub API access for projen workflows. |
projenTokenSecret |
string |
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows. |
readme |
projen.SampleReadmeProps |
The README setup. |
stale |
boolean |
Auto-close of stale issues and pull request. |
staleOptions |
projen.github.StaleOptions |
Auto-close stale issues and pull requests. |
vscode |
boolean |
Enable VSCode integration. |
author |
string |
The name of the skill's author. |
authorAddress |
string |
The email address of the skill's author. |
authorHandle |
string |
The GitHub handle of the skill's author. |
condenseLocaleFolders |
boolean |
Restructure locale folders to be more OVOS-like? |
githubWorkflows |
boolean |
Add Github Actions workflows? |
license |
string |
The license of the skill. |
packageDir |
string |
The name of the directory containing the skill's code. |
pypiName |
string |
The name of the skill's PyPi package. |
repositoryUrl |
string |
The URL of the skill's GitHub repository. |
retrofit |
boolean |
Retrofit an existing Mycroft skill to OVOS? |
sampleCode |
boolean |
Include sample code? |
skillClass |
string |
The name of the skill class. |
skillDescription |
string |
The description of the skill. |
skillKeywords |
string |
Keywords for your skill package. |
skillLicenseTest |
boolean |
Include a test to check that the skill's license is FOSS? |
public readonly name: string;
- Type: string
- Default: $BASEDIR
This is the name of your project.
public readonly commitGenerated: boolean;
- Type: boolean
- Default: true
Whether to commit the managed files by default.
public readonly gitIgnoreOptions: IgnoreFileOptions;
- Type: projen.IgnoreFileOptions
Configuration options for .gitignore file.
public readonly gitOptions: GitOptions;
- Type: projen.GitOptions
Configuration options for git.
public readonly logging: LoggerOptions;
- Type: projen.LoggerOptions
- Default: {}
Configure logging options such as verbosity.
public readonly outdir: string;
- Type: string
- Default: "."
The root directory of the project.
Relative to this directory, all files are synthesized.
If this project has a parent, this directory is relative to the parent directory and it cannot be the same as the parent or any of it's other sub-projects.
public readonly parent: Project;
- Type: projen.Project
The parent project, if this project is part of a bigger project.
public readonly projenCommand: string;
- Type: string
- Default: "npx projen"
The shell command to use in order to run the projen CLI.
Can be used to customize in special environments.
public readonly projenrcJson: boolean;
- Type: boolean
- Default: false
Generate (once) .projenrc.json (in JSON). Set to false
in order to disable .projenrc.json generation.
public readonly projenrcJsonOptions: ProjenrcJsonOptions;
- Type: projen.ProjenrcJsonOptions
- Default: default options
Options for .projenrc.json.
public readonly renovatebot: boolean;
- Type: boolean
- Default: false
Use renovatebot to handle dependency upgrades.
public readonly renovatebotOptions: RenovatebotOptions;
- Type: projen.RenovatebotOptions
- Default: default options
Options for renovatebot.
public readonly autoApproveOptions: AutoApproveOptions;
- Type: projen.github.AutoApproveOptions
- Default: auto approve is disabled
Enable and configure the 'auto approve' workflow.
public readonly autoMerge: boolean;
- Type: boolean
- Default: true
Enable automatic merging on GitHub.
Has no effect if github.mergify
is set to false.
public readonly autoMergeOptions: AutoMergeOptions;
- Type: projen.github.AutoMergeOptions
- Default: see defaults in
AutoMergeOptions
Configure options for automatic merging on GitHub.
Has no effect if
github.mergify
or autoMerge
is set to false.
public readonly clobber: boolean;
- Type: boolean
- Default: true, but false for subprojects
Add a clobber
task which resets the repo to origin.
public readonly devContainer: boolean;
- Type: boolean
- Default: false
Add a VSCode development environment (used for GitHub Codespaces).
public readonly github: boolean;
- Type: boolean
- Default: true
Enable GitHub integration.
Enabled by default for root projects. Disabled for non-root projects.
public readonly githubOptions: GitHubOptions;
- Type: projen.github.GitHubOptions
- Default: see GitHubOptions
Options for GitHub integration.
public readonly gitpod: boolean;
- Type: boolean
- Default: false
Add a Gitpod development environment.
- Deprecated: use
githubOptions.mergify
instead
public readonly mergify: boolean;
- Type: boolean
- Default: true
Whether mergify should be enabled on this repository or not.
- Deprecated: use
githubOptions.mergifyOptions
instead
public readonly mergifyOptions: MergifyOptions;
- Type: projen.github.MergifyOptions
- Default: default options
Options for mergify.
- Deprecated: no longer supported at the base project level
public readonly projectType: ProjectType;
- Type: projen.ProjectType
- Default: ProjectType.UNKNOWN
Which type of project this is (library/app).
public readonly projenCredentials: GithubCredentials;
- Type: projen.github.GithubCredentials
- Default: use a personal access token named PROJEN_GITHUB_TOKEN
Choose a method of providing GitHub API access for projen workflows.
- Deprecated: use
projenCredentials
public readonly projenTokenSecret: string;
- Type: string
- Default: "PROJEN_GITHUB_TOKEN"
The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
This token needs to have the repo
, workflows
and packages
scope.
public readonly readme: SampleReadmeProps;
- Type: projen.SampleReadmeProps
- Default: { filename: 'README.md', contents: '# replace this' }
The README setup.
Example
"{ filename: 'readme.md', contents: '# title' }"
public readonly stale: boolean;
- Type: boolean
- Default: false
Auto-close of stale issues and pull request.
See staleOptions
for options.
public readonly staleOptions: StaleOptions;
- Type: projen.github.StaleOptions
- Default: see defaults in
StaleOptions
Auto-close stale issues and pull requests.
To disable set stale
to false
.
public readonly vscode: boolean;
- Type: boolean
- Default: true
Enable VSCode integration.
Enabled by default for root projects. Disabled for non-root projects.
public readonly author: string;
- Type: string
- Default: "TODO: Your Name"
The name of the skill's author.
Example
"Mike Gray"
public readonly authorAddress: string;
- Type: string
- Default: "TODO: Your Email"
The email address of the skill's author.
Example
public readonly authorHandle: string;
- Type: string
- Default: ""
The GitHub handle of the skill's author.
Example
"mikejgray"
public readonly condenseLocaleFolders: boolean;
- Type: boolean
- Default: true
Restructure locale folders to be more OVOS-like?
public readonly githubWorkflows: boolean;
- Type: boolean
- Default: true
Add Github Actions workflows?
public readonly license: string;
- Type: string
- Default: Apache-2.0
The license of the skill.
Example
MIT
public readonly packageDir: string;
- Type: string
- Default: "" (root)
The name of the directory containing the skill's code.
Example
"hello_world_skill"
public readonly pypiName: string;
- Type: string
The name of the skill's PyPi package.
Example
ovos-hello-world-skill
public readonly repositoryUrl: string;
- Type: string
- Default: "TODO: PLACEHOLDER"
The URL of the skill's GitHub repository.
Example
"https://github.com/OpenVoiceOS/ovos-hello-world-skill"
public readonly retrofit: boolean;
- Type: boolean
- Default: false
Retrofit an existing Mycroft skill to OVOS?
public readonly sampleCode: boolean;
- Type: boolean
- Default: true
Include sample code?
public readonly skillClass: string;
- Type: string
The name of the skill class.
Example
HelloWorldSkill
public readonly skillDescription: string;
- Type: string
- Default: ""
The description of the skill.
Used in setup.py.
Example
"A simple skill that says hello world"
public readonly skillKeywords: string;
- Type: string
- Default: "ovos skill plugin"
Keywords for your skill package.
public readonly skillLicenseTest: boolean;
- Type: boolean
- Default: true
Include a test to check that the skill's license is FOSS?
import { OVOSPHALProject } from '@mikejgray/ovos-skill-projen'
new OVOSPHALProject(options: OVOSPHALProjectOptions)
Name | Type | Description |
---|---|---|
options |
OVOSPHALProjectOptions |
No description. |
- Type: OVOSPHALProjectOptions
Name | Description |
---|---|
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Marks the provided file(s) as being generated. |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addPythonGitIgnore |
No description. |
createDevBranch |
Create a dev branch if it doesn't already exist, and set it as the default branch. |
createGenericSkillCode |
Create a generic skill with sample code. |
public addExcludeFromCleanup(globs: string): void
Exclude the matching files from pre-synth cleanup.
Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.
- Type: string
The glob patterns to match.
public addGitIgnore(pattern: string): void
Adds a .gitignore pattern.
- Type: string
The glob pattern to ignore.
public addPackageIgnore(_pattern: string): void
Exclude these files from the bundled package.
Implemented by project types based on the
packaging mechanism. For example, NodeProject
delegates this to .npmignore
.
- Type: string
The glob pattern to exclude.
public addTask(name: string, props?: TaskOptions): Task
Adds a new task to this project.
This will fail if the project already has a task with this name.
- Type: string
The task name to add.
- Type: projen.TaskOptions
Task properties.
public addTip(message: string): void
Prints a "tip" message during synthesis.
- Type: string
The message.
public annotateGenerated(glob: string): void
Marks the provided file(s) as being generated.
This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.
https://github.com/github/linguist/blob/master/docs/overrides.md
- Type: string
the glob pattern to match (could be a file path).
public postSynthesize(): void
Called after all components are synthesized.
Order is not guaranteed.
public preSynthesize(): void
Called before all components are synthesized.
public removeTask(name: string): Task
Removes a task from a project.
- Type: string
The name of the task to remove.
public runTaskCommand(task: Task): string
Returns the shell command to execute in order to run a task.
By default, this is npx projen@<version> <task>
- Type: projen.Task
The task for which the command is required.
public synth(): void
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all sub-projects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- Call "this.postSynthesize()"
public tryFindFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and all its subprojects.
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
public tryFindJsonFile(filePath: string): JsonFile
Finds a json file by name.
- Type: string
The file path.
public tryFindObjectFile(filePath: string): ObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
- Type: string
The file path.
public tryRemoveFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and removes it.
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
public addPythonGitIgnore(): void
public createDevBranch(): void
Create a dev branch if it doesn't already exist, and set it as the default branch.
public createGenericSkillCode(dir: string): void
Create a generic skill with sample code.
Example
"neon_phal_plugin_audio_receiver"
- Type: string
The name of the directory to create sample code in.
Name | Type | Description |
---|---|---|
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
projectType |
projen.ProjectType |
No description. |
autoApprove |
projen.github.AutoApprove |
Auto approve set up for this project. |
devContainer |
projen.vscode.DevContainer |
Access for .devcontainer.json (used for GitHub Codespaces). |
github |
projen.github.GitHub |
Access all github components. |
gitpod |
projen.Gitpod |
Access for Gitpod. |
vscode |
projen.vscode.VsCode |
Access all VSCode components. |
public readonly buildTask: Task;
- Type: projen.Task
public readonly commitGenerated: boolean;
- Type: boolean
Whether to commit the managed files by default.
public readonly compileTask: Task;
- Type: projen.Task
public readonly components: Component[];
- Type: projen.Component[]
Returns all the components within this project.
public readonly deps: Dependencies;
- Type: projen.Dependencies
Project dependencies.
public readonly ejected: boolean;
- Type: boolean
Whether or not the project is being ejected.
public readonly files: FileBase[];
- Type: projen.FileBase[]
All files in this project.
public readonly gitattributes: GitAttributesFile;
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
public readonly gitignore: IgnoreFile;
- Type: projen.IgnoreFile
.gitignore.
public readonly logger: Logger;
- Type: projen.Logger
Logging utilities.
public readonly name: string;
- Type: string
Project name.
public readonly outdir: string;
- Type: string
Absolute output directory of this project.
public readonly packageTask: Task;
- Type: projen.Task
public readonly postCompileTask: Task;
- Type: projen.Task
public readonly preCompileTask: Task;
- Type: projen.Task
public readonly projectBuild: ProjectBuild;
- Type: projen.ProjectBuild
Manages the build process of the project.
public readonly projenCommand: string;
- Type: string
The command to use in order to run the projen CLI.
public readonly root: Project;
- Type: projen.Project
The root project.
public readonly subprojects: Project[];
- Type: projen.Project[]
Returns all the subprojects within this project.
public readonly tasks: Tasks;
- Type: projen.Tasks
Project tasks.
public readonly testTask: Task;
- Type: projen.Task
public readonly defaultTask: Task;
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
public readonly initProject: InitProject;
- Type: projen.InitProject
The options used when this project is bootstrapped via projen new
.
It includes the original set of options passed to the CLI and also the JSII FQN of the project type.
public readonly parent: Project;
- Type: projen.Project
A parent project.
If undefined, this is the root project.
public readonly projectType: ProjectType;
- Type: projen.ProjectType
public readonly autoApprove: AutoApprove;
- Type: projen.github.AutoApprove
Auto approve set up for this project.
public readonly devContainer: DevContainer;
- Type: projen.vscode.DevContainer
Access for .devcontainer.json (used for GitHub Codespaces).
This will be undefined
if devContainer boolean is false
public readonly github: GitHub;
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
public readonly gitpod: Gitpod;
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
public readonly vscode: VsCode;
- Type: projen.vscode.VsCode
Access all VSCode components.
This will be undefined
for subprojects.
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
string |
The name of the default task (the task executed when projen is run without arguments). |
public readonly DEFAULT_TASK: string;
- Type: string
The name of the default task (the task executed when projen
is run without arguments).
Normally this task should synthesize the project files.
import { OVOSSkillProject } from '@mikejgray/ovos-skill-projen'
new OVOSSkillProject(options: OVOSSkillProjectOptions)
Name | Type | Description |
---|---|---|
options |
OVOSSkillProjectOptions |
No description. |
- Type: OVOSSkillProjectOptions
Name | Description |
---|---|
addExcludeFromCleanup |
Exclude the matching files from pre-synth cleanup. |
addGitIgnore |
Adds a .gitignore pattern. |
addPackageIgnore |
Exclude these files from the bundled package. |
addTask |
Adds a new task to this project. |
addTip |
Prints a "tip" message during synthesis. |
annotateGenerated |
Marks the provided file(s) as being generated. |
postSynthesize |
Called after all components are synthesized. |
preSynthesize |
Called before all components are synthesized. |
removeTask |
Removes a task from a project. |
runTaskCommand |
Returns the shell command to execute in order to run a task. |
synth |
Synthesize all project files into outdir . |
tryFindFile |
Finds a file at the specified relative path within this project and all its subprojects. |
tryFindJsonFile |
Finds a json file by name. |
tryFindObjectFile |
Finds an object file (like JsonFile, YamlFile, etc.) by name. |
tryRemoveFile |
Finds a file at the specified relative path within this project and removes it. |
addPythonGitIgnore |
Add a Python .gitignore file. |
createDevBranch |
Create a dev branch if it doesn't already exist, and set it as the default branch. |
createGenericSkillCode |
Create a generic skill with sample code. |
createGithubWorkflows |
Create OVOS standard Github Actions workflows. |
restructureLocaleFolders |
Restructure locale folders to be more OVOS-like. |
public addExcludeFromCleanup(globs: string): void
Exclude the matching files from pre-synth cleanup.
Can be used when, for example, some source files include the projen marker and we don't want them to be erased during synth.
- Type: string
The glob patterns to match.
public addGitIgnore(pattern: string): void
Adds a .gitignore pattern.
- Type: string
The glob pattern to ignore.
public addPackageIgnore(_pattern: string): void
Exclude these files from the bundled package.
Implemented by project types based on the
packaging mechanism. For example, NodeProject
delegates this to .npmignore
.
- Type: string
The glob pattern to exclude.
public addTask(name: string, props?: TaskOptions): Task
Adds a new task to this project.
This will fail if the project already has a task with this name.
- Type: string
The task name to add.
- Type: projen.TaskOptions
Task properties.
public addTip(message: string): void
Prints a "tip" message during synthesis.
- Type: string
The message.
public annotateGenerated(glob: string): void
Marks the provided file(s) as being generated.
This is achieved using the github-linguist attributes. Generated files do not count against the repository statistics and language breakdown.
https://github.com/github/linguist/blob/master/docs/overrides.md
- Type: string
the glob pattern to match (could be a file path).
public postSynthesize(): void
Called after all components are synthesized.
Order is not guaranteed.
public preSynthesize(): void
Called before all components are synthesized.
public removeTask(name: string): Task
Removes a task from a project.
- Type: string
The name of the task to remove.
public runTaskCommand(task: Task): string
Returns the shell command to execute in order to run a task.
By default, this is npx projen@<version> <task>
- Type: projen.Task
The task for which the command is required.
public synth(): void
Synthesize all project files into outdir
.
- Call "this.preSynthesize()"
- Delete all generated files
- Synthesize all sub-projects
- Synthesize all components of this project
- Call "postSynthesize()" for all components of this project
- Call "this.postSynthesize()"
public tryFindFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and all its subprojects.
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
public tryFindJsonFile(filePath: string): JsonFile
Finds a json file by name.
- Type: string
The file path.
public tryFindObjectFile(filePath: string): ObjectFile
Finds an object file (like JsonFile, YamlFile, etc.) by name.
- Type: string
The file path.
public tryRemoveFile(filePath: string): FileBase
Finds a file at the specified relative path within this project and removes it.
- Type: string
The file path.
If this path is relative, it will be resolved from the root of this project.
public addPythonGitIgnore(): void
Add a Python .gitignore file.
public createDevBranch(): void
Create a dev branch if it doesn't already exist, and set it as the default branch.
public createGenericSkillCode(dir: string): void
Create a generic skill with sample code.
Example
"hello_world_skill"
- Type: string
The name of the directory to create sample code in.
public createGithubWorkflows(skillLicenseTest: boolean): void
Create OVOS standard Github Actions workflows.
- Type: boolean
public restructureLocaleFolders(sourceFolder: string): void
Restructure locale folders to be more OVOS-like.
- Type: string
The name of the directory containing the Mycroft skill's code.
Name | Description |
---|---|
modernizeSkillCode |
Load a Mycroft skill Python file and modernize it for OVOS. |
import { OVOSSkillProject } from '@mikejgray/ovos-skill-projen'
OVOSSkillProject.modernizeSkillCode(file: string)
Load a Mycroft skill Python file and modernize it for OVOS.
- Type: string
The file to modernize.
Name | Type | Description |
---|---|---|
buildTask |
projen.Task |
No description. |
commitGenerated |
boolean |
Whether to commit the managed files by default. |
compileTask |
projen.Task |
No description. |
components |
projen.Component[] |
Returns all the components within this project. |
deps |
projen.Dependencies |
Project dependencies. |
ejected |
boolean |
Whether or not the project is being ejected. |
files |
projen.FileBase[] |
All files in this project. |
gitattributes |
projen.GitAttributesFile |
The .gitattributes file for this repository. |
gitignore |
projen.IgnoreFile |
.gitignore. |
logger |
projen.Logger |
Logging utilities. |
name |
string |
Project name. |
outdir |
string |
Absolute output directory of this project. |
packageTask |
projen.Task |
No description. |
postCompileTask |
projen.Task |
No description. |
preCompileTask |
projen.Task |
No description. |
projectBuild |
projen.ProjectBuild |
Manages the build process of the project. |
projenCommand |
string |
The command to use in order to run the projen CLI. |
root |
projen.Project |
The root project. |
subprojects |
projen.Project[] |
Returns all the subprojects within this project. |
tasks |
projen.Tasks |
Project tasks. |
testTask |
projen.Task |
No description. |
defaultTask |
projen.Task |
This is the "default" task, the one that executes "projen". |
initProject |
projen.InitProject |
The options used when this project is bootstrapped via projen new . |
parent |
projen.Project |
A parent project. |
projectType |
projen.ProjectType |
No description. |
autoApprove |
projen.github.AutoApprove |
Auto approve set up for this project. |
devContainer |
projen.vscode.DevContainer |
Access for .devcontainer.json (used for GitHub Codespaces). |
github |
projen.github.GitHub |
Access all github components. |
gitpod |
projen.Gitpod |
Access for Gitpod. |
vscode |
projen.vscode.VsCode |
Access all VSCode components. |
public readonly buildTask: Task;
- Type: projen.Task
public readonly commitGenerated: boolean;
- Type: boolean
Whether to commit the managed files by default.
public readonly compileTask: Task;
- Type: projen.Task
public readonly components: Component[];
- Type: projen.Component[]
Returns all the components within this project.
public readonly deps: Dependencies;
- Type: projen.Dependencies
Project dependencies.
public readonly ejected: boolean;
- Type: boolean
Whether or not the project is being ejected.
public readonly files: FileBase[];
- Type: projen.FileBase[]
All files in this project.
public readonly gitattributes: GitAttributesFile;
- Type: projen.GitAttributesFile
The .gitattributes file for this repository.
public readonly gitignore: IgnoreFile;
- Type: projen.IgnoreFile
.gitignore.
public readonly logger: Logger;
- Type: projen.Logger
Logging utilities.
public readonly name: string;
- Type: string
Project name.
public readonly outdir: string;
- Type: string
Absolute output directory of this project.
public readonly packageTask: Task;
- Type: projen.Task
public readonly postCompileTask: Task;
- Type: projen.Task
public readonly preCompileTask: Task;
- Type: projen.Task
public readonly projectBuild: ProjectBuild;
- Type: projen.ProjectBuild
Manages the build process of the project.
public readonly projenCommand: string;
- Type: string
The command to use in order to run the projen CLI.
public readonly root: Project;
- Type: projen.Project
The root project.
public readonly subprojects: Project[];
- Type: projen.Project[]
Returns all the subprojects within this project.
public readonly tasks: Tasks;
- Type: projen.Tasks
Project tasks.
public readonly testTask: Task;
- Type: projen.Task
public readonly defaultTask: Task;
- Type: projen.Task
This is the "default" task, the one that executes "projen".
Undefined if the project is being ejected.
public readonly initProject: InitProject;
- Type: projen.InitProject
The options used when this project is bootstrapped via projen new
.
It includes the original set of options passed to the CLI and also the JSII FQN of the project type.
public readonly parent: Project;
- Type: projen.Project
A parent project.
If undefined, this is the root project.
public readonly projectType: ProjectType;
- Type: projen.ProjectType
public readonly autoApprove: AutoApprove;
- Type: projen.github.AutoApprove
Auto approve set up for this project.
public readonly devContainer: DevContainer;
- Type: projen.vscode.DevContainer
Access for .devcontainer.json (used for GitHub Codespaces).
This will be undefined
if devContainer boolean is false
public readonly github: GitHub;
- Type: projen.github.GitHub
Access all github components.
This will be undefined
for subprojects.
public readonly gitpod: Gitpod;
- Type: projen.Gitpod
Access for Gitpod.
This will be undefined
if gitpod boolean is false
public readonly vscode: VsCode;
- Type: projen.vscode.VsCode
Access all VSCode components.
This will be undefined
for subprojects.
Name | Type | Description |
---|---|---|
DEFAULT_TASK |
string |
The name of the default task (the task executed when projen is run without arguments). |
public readonly DEFAULT_TASK: string;
- Type: string
The name of the default task (the task executed when projen
is run without arguments).
Normally this task should synthesize the project files.