add webextension externs to firefox template

This commit is contained in:
2023-04-19 14:43:59 -06:00
parent 2927bd303e
commit 6ac8e73f1c

View File

@@ -213,11 +213,13 @@ class Main {
makeFolderForNewProject(["src", "template"]); makeFolderForNewProject(["src", "template"]);
makeFileForNewProject([".gitignore"]); makeFileForNewProject([".gitignore"]);
makeFileForNewProject(["build.hxml"]); makeFileForNewProject(["build.hxml"]);
makeFileForNewProject(["package.json"]); {
var packageFile = Path.join([projectDir, "package.json"]); makeFileForNewProject(["package.json"]);
var packageJson = Json.parse(File.getContent(packageFile)); var packageFile = Path.join([projectDir, "package.json"]);
packageJson.name = title; var packageJson = Json.parse(File.getContent(packageFile));
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t")); packageJson.name = title;
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t"));
}
makeFileForNewProject(["test.sh"]); makeFileForNewProject(["test.sh"]);
} }
@@ -237,11 +239,13 @@ class Main {
makeFileForNewProject([".vscodeignore"]); makeFileForNewProject([".vscodeignore"]);
makeFileForNewProject(["README.md"]); makeFileForNewProject(["README.md"]);
makeFileForNewProject(["build.hxml"]); makeFileForNewProject(["build.hxml"]);
makeFileForNewProject(["package.json"]); {
var packageFile = Path.join([projectDir, "package.json"]); makeFileForNewProject(["package.json"]);
var packageJson = Json.parse(File.getContent(packageFile)); var packageFile = Path.join([projectDir, "package.json"]);
packageJson.name = title; var packageJson = Json.parse(File.getContent(packageFile));
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t")); packageJson.name = title;
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t"));
}
makeFileForNewProject(["test.sh"]); makeFileForNewProject(["test.sh"]);
} }
@@ -267,13 +271,24 @@ class Main {
makeFolderForNewProject(["icons"]); makeFolderForNewProject(["icons"]);
makeFileForNewProject([".gitignore"]); makeFileForNewProject([".gitignore"]);
makeFileForNewProject(["build.hxml"]); makeFileForNewProject(["build.hxml"]);
makeFileForNewProject(["manifest.json"]); {
var manifestFile = Path.join([projectDir, "manifest.json"]); makeFileForNewProject(["manifest.json"]);
var manifestJson = Json.parse(File.getContent(manifestFile)); var manifestFile = Path.join([projectDir, "manifest.json"]);
manifestJson.name = title; var manifestJson = Json.parse(File.getContent(manifestFile));
manifestJson.description = description; manifestJson.name = title;
manifestJson.content_scripts[0].matches = urlPatterns; manifestJson.description = description;
File.saveContent(manifestFile, Json.stringify(manifestJson, null, "\t")); manifestJson.content_scripts[0].matches = urlPatterns;
File.saveContent(manifestFile, Json.stringify(manifestJson, null, "\t"));
}
{
makeFileForNewProject(["package.json"]);
var packageFile = Path.join([projectDir, "package.json"]);
var packageJson = Json.parse(File.getContent(packageFile));
packageJson.name = title;
packageJson.description = description;
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t"));
}
makeFileForNewProject(["test.sh"])
} }
static function convert(args:Array<String>) { static function convert(args:Array<String>) {