Skip to content

Commit d7660a5

Browse files
committed
setup initial project
1 parent d2beb50 commit d7660a5

File tree

7 files changed

+50
-0
lines changed

7 files changed

+50
-0
lines changed

.env.development

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODE=development
2+
NODE_ENV=development
3+
INCLUDE_KEY=true

.env.production

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODE=production
2+
NODE_ENV=production
3+
INCLUDE_KEY=false

.env.zipinstaller

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODE=production
2+
NODE_ENV=production
3+
INCLUDE_KEY=true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ github.graphql
3333

3434
# generated graphql ts types
3535
**/__gen_gql/**/*
36+
37+
.env
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
declare module 'chrome-webstore-upload' {
2+
import {ReadStream} from "fs";
3+
4+
interface Options {
5+
extensionId: string;
6+
clientId: string;
7+
clientSecret: string;
8+
refreshToken: string;
9+
}
10+
11+
class APIClient {
12+
constructor(options: Options);
13+
uploadExisting(readStream: ReadStream, token?: string): Promise<unknown>;
14+
}
15+
16+
function create(options: Options): APIClient;
17+
export = create;
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import createClient from 'chrome-webstore-upload';
2+
import {createReadStream} from 'fs';
3+
4+
const upload = async () => {
5+
const webstore = createClient({
6+
extensionId: "plpmkifleemfflmlnogdncmhlljcpdab",
7+
clientId: process.env.webstoreClientIdSecret ?? '',
8+
clientSecret: process.env.webstoreClientSecret ?? '',
9+
refreshToken: process.env.webstoreRefreshTokenSecret ?? ''
10+
});
11+
await webstore.uploadExisting(createReadStream('../gist-userscript-manager.zip'));
12+
};
13+
14+
void upload().catch((e) => {
15+
console.error(e);
16+
process.exit(1);
17+
});

vue.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ module.exports = {
1313
transform(content) {
1414
const manifest = JSON.parse(content);
1515

16+
if (process.env.INCLUDE_KEY === 'true') {
17+
manifest.key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApuOA55Y/VfUyydcI2cWcezmCtvDjZ0ANF7eyq5SCvWiVvCca+qInh91GipobJQb3iFw5GXN0as4pJKbZg6pNRKn285Fo0uyegsdGMnXy//2tZ/yOgX7QiI0LM5XBc+NUPVER+QBsE/gbflKb0g3Z5aUcSJWreHxPqs8+PD/o2v6Z8YEmnEwDhn8w/YXmOiqnDrW4+4wEo49oOQYuVvehfFpE4dm8h9W/47tQNI2lmPrN7U8FTqdZnksmaUBUXaUUzIxhCDA3krYK/h+PrQq4i1F9hGt3YPDRhvkmNrZQsclfS+BdYE3yuWoNIQTJYO2xIhsrub4vBhvyl9W9SmPdyQIDAQAB";
18+
}
19+
1620
manifest.version = `${version}.0`;
1721

1822
return JSON.stringify(manifest, null, 2);

0 commit comments

Comments
 (0)