Skip to content

Commit

Permalink
fix!: mv dist/ and testTmp/ to .scaffold/, cache test lib, drop…
Browse files Browse the repository at this point in the history
… config.test.port (#71)

* fix: move testPluginDir out build, use user's mocha.js, cache chai.js

* fix!: mv paths of `dist` and `test` to `.scaffold`, ensure gitignore

* chore: clean code
  • Loading branch information
northword authored Dec 18, 2024
1 parent b3a4036 commit 54ad99e
Show file tree
Hide file tree
Showing 5 changed files with 390 additions and 339 deletions.
7 changes: 6 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import process, { env, exit } from "node:process";
import { Command } from "@commander-js/extra-typings";
import pkg from "../package.json" with { type: "json" };
import { Build, Config, Release, Serve, Test } from "./index.js";
import { checkGitIgnore } from "./utils/gitignore.js";
import { logger } from "./utils/log.js";
import { updateNotifier } from "./utils/updater.js";

Expand Down Expand Up @@ -104,7 +105,11 @@ export default async function main() {
// globalOpts = cli.optsWithGlobals();
}

main().catch(onError);
main()
.then(() => {
checkGitIgnore();
})
.catch(onError);

process.on("uncaughtException", onError);

Expand Down
10 changes: 4 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,14 @@ function resolveConfig(config: Config): Context {

const defaultConfig = {
source: "src",
dist: "build",
dist: ".scaffold/build",

name: "",
id: "",
namespace: "",
xpiName: "",
xpiDownloadLink:
"https://github.com/{{owner}}/{{repo}}/releases/download/v{{version}}/{{xpiName}}.xpi",
updateURL:
"https://github.com/{{owner}}/{{repo}}/releases/download/release/{{updateJson}}",
xpiDownloadLink: "https://github.com/{{owner}}/{{repo}}/releases/download/v{{version}}/{{xpiName}}.xpi",
updateURL: "https://github.com/{{owner}}/{{repo}}/releases/download/release/{{updateJson}}",

build: {
assets: "addon/**/*.*",
Expand Down Expand Up @@ -181,12 +179,12 @@ const defaultConfig = {
mocha: {
timeout: 10000,
},
port: 9876,
abortOnFail: false,
exitOnFinish: false,
headless: false,
startupDelay: 1000,
waitForPlugin: "() => true",
watch: false,
hooks: {},
},
logLevel: "info",
Expand Down
Loading

0 comments on commit 54ad99e

Please sign in to comment.