update: scripts
This commit is contained in:
		
							parent
							
								
									05ad059c04
								
							
						
					
					
						commit
						d48a628693
					
				
							
								
								
									
										7
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							@ -10,6 +10,13 @@
 | 
			
		||||
            "name": "Restart",
 | 
			
		||||
            "runtimeExecutable": "npm",
 | 
			
		||||
            "runtimeArgs": ["run", "restart"],
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "node",
 | 
			
		||||
            "request": "launch",
 | 
			
		||||
            "name": "Restart in Prod Mode",
 | 
			
		||||
            "runtimeExecutable": "npm",
 | 
			
		||||
            "runtimeArgs": ["run", "restart-prod"],
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								package.json
									
									
									
									
									
								
							@ -12,11 +12,13 @@
 | 
			
		||||
  "main": "src/index.ts",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "build-dev": "cross-env NODE_ENV=development node scripts/build.js",
 | 
			
		||||
    "build": "cross-env NODE_ENV=production node scripts/build.js",
 | 
			
		||||
    "build-prod": "cross-env NODE_ENV=production node scripts/build.js",
 | 
			
		||||
    "build": "npm run build-prod",
 | 
			
		||||
    "start": "node scripts/start.js",
 | 
			
		||||
    "stop": "node scripts/stop.js",
 | 
			
		||||
    "prerestart": "npm run build-dev",
 | 
			
		||||
    "restart": "node scripts/restart.js",
 | 
			
		||||
    "restart-dev": "npm run build-dev && npm run stop && npm run start",
 | 
			
		||||
    "restart-prod": "npm run build-prod && npm run stop && npm run start",
 | 
			
		||||
    "restart": "npm run restart-dev",
 | 
			
		||||
    "release": "release-it",
 | 
			
		||||
    "test": "echo \"Error: no test specified\" && exit 1"
 | 
			
		||||
  },
 | 
			
		||||
@ -31,7 +33,7 @@
 | 
			
		||||
  },
 | 
			
		||||
  "homepage": "https://github.com/windingwind/zotero-addon-template#readme",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "zotero-plugin-toolkit": "^1.0.1"
 | 
			
		||||
    "zotero-plugin-toolkit": "^1.0.3"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/node": "^18.11.17",
 | 
			
		||||
 | 
			
		||||
@ -104,8 +104,8 @@ async function main() {
 | 
			
		||||
        __env__: `"${process.env.NODE_ENV}"`,
 | 
			
		||||
      },
 | 
			
		||||
      bundle: true,
 | 
			
		||||
      // Entry should be the same as addon/chrome/content/overlay.xul
 | 
			
		||||
      outfile: path.join(buildDir, "addon/chrome/content/scripts/index.js"),
 | 
			
		||||
      // Don't turn minify on
 | 
			
		||||
      // minify: true,
 | 
			
		||||
    })
 | 
			
		||||
    .catch(() => process.exit(1));
 | 
			
		||||
@ -161,17 +161,6 @@ async function main() {
 | 
			
		||||
    )
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  // _ = replace.sync({
 | 
			
		||||
  //   files: [path.join(buildDir, "addon/chrome/content/scripts/index.js")],
 | 
			
		||||
  //   from: [/__env__/g]
 | 
			
		||||
  // });
 | 
			
		||||
  // console.log(
 | 
			
		||||
  //   "[Build] Run replace in ",
 | 
			
		||||
  //   _.filter((f) => f.hasChanged).map(
 | 
			
		||||
  //     (f) => `${f.file} : ${f.numReplacements} / ${f.numMatches}`
 | 
			
		||||
  //   )
 | 
			
		||||
  // );
 | 
			
		||||
 | 
			
		||||
  console.log("[Build] Replace OK");
 | 
			
		||||
 | 
			
		||||
  console.log("[Build] Addon prepare OK");
 | 
			
		||||
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
const { execSync } = require("child_process");
 | 
			
		||||
const { killZotero, startZotero } = require("./zotero-cmd.json");
 | 
			
		||||
 | 
			
		||||
try {
 | 
			
		||||
  execSync(killZotero);
 | 
			
		||||
} catch (e) {}
 | 
			
		||||
 | 
			
		||||
execSync(startZotero);
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user