add webextension externs to firefox template
This commit is contained in:
@@ -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"]);
|
makeFileForNewProject(["package.json"]);
|
||||||
var packageFile = Path.join([projectDir, "package.json"]);
|
var packageFile = Path.join([projectDir, "package.json"]);
|
||||||
var packageJson = Json.parse(File.getContent(packageFile));
|
var packageJson = Json.parse(File.getContent(packageFile));
|
||||||
packageJson.name = title;
|
packageJson.name = title;
|
||||||
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t"));
|
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"]);
|
makeFileForNewProject(["package.json"]);
|
||||||
var packageFile = Path.join([projectDir, "package.json"]);
|
var packageFile = Path.join([projectDir, "package.json"]);
|
||||||
var packageJson = Json.parse(File.getContent(packageFile));
|
var packageJson = Json.parse(File.getContent(packageFile));
|
||||||
packageJson.name = title;
|
packageJson.name = title;
|
||||||
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t"));
|
File.saveContent(packageFile, Json.stringify(packageJson, null, "\t"));
|
||||||
|
}
|
||||||
makeFileForNewProject(["test.sh"]);
|
makeFileForNewProject(["test.sh"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,6 +271,7 @@ class Main {
|
|||||||
makeFolderForNewProject(["icons"]);
|
makeFolderForNewProject(["icons"]);
|
||||||
makeFileForNewProject([".gitignore"]);
|
makeFileForNewProject([".gitignore"]);
|
||||||
makeFileForNewProject(["build.hxml"]);
|
makeFileForNewProject(["build.hxml"]);
|
||||||
|
{
|
||||||
makeFileForNewProject(["manifest.json"]);
|
makeFileForNewProject(["manifest.json"]);
|
||||||
var manifestFile = Path.join([projectDir, "manifest.json"]);
|
var manifestFile = Path.join([projectDir, "manifest.json"]);
|
||||||
var manifestJson = Json.parse(File.getContent(manifestFile));
|
var manifestJson = Json.parse(File.getContent(manifestFile));
|
||||||
@@ -275,6 +280,16 @@ class Main {
|
|||||||
manifestJson.content_scripts[0].matches = urlPatterns;
|
manifestJson.content_scripts[0].matches = urlPatterns;
|
||||||
File.saveContent(manifestFile, Json.stringify(manifestJson, null, "\t"));
|
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>) {
|
||||||
// `kiss convert` converts its stdin input to Haxe expressions.
|
// `kiss convert` converts its stdin input to Haxe expressions.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
-lib kiss
|
-lib kiss
|
||||||
|
-lib webextension-polyfill
|
||||||
-cp src
|
-cp src
|
||||||
-dce full
|
-dce full
|
||||||
--main template.Main
|
--main template.Main
|
||||||
--js bin/main.js
|
--js bin/main.js
|
||||||
-cmd zip -r template.zip . -x *.git* -x *.hxml -x *.zip -x src/\*
|
-cmd zip -r template.zip . -x *.git* -x *.hxml -x *.zip -x src/\* -x node_modules/\*
|
||||||
15
projects/kiss-firefox/template/package.json
Normal file
15
projects/kiss-firefox/template/package.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "template",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "A Firefox extension made with Kisslang",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "dts2hx --all"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/webextension-polyfill": "^0.10.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"dts2hx": "^0.19.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
7
projects/kiss-firefox/template/test.sh
Normal file
7
projects/kiss-firefox/template/test.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
if [ ! -d node_modules ]; then
|
||||||
|
$(haxelib libpath kiss)/build-scripts/dts2hx-externs/regenerate.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
haxe -D test build.hxml
|
||||||
Reference in New Issue
Block a user