File tree Expand file tree Collapse file tree 9 files changed +24
-122
lines changed Expand file tree Collapse file tree 9 files changed +24
-122
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import type { BuildOptions } from 'esbuild' ;
2
1
import type { BuildTypes } from "./@types/build.js" ;
3
2
3
+ import { readFile } from 'fs/promises' ;
4
4
import { build , context } from 'esbuild' ;
5
5
import { copy } from 'esbuild-plugin-copy' ;
6
6
import { buildTyping , getCurrentType } from "./@types/build.js" ;
7
- import { getMetaString } from "./meta.js" ;
8
7
9
8
const buildArgv = process . argv . slice ( 2 ) [ 0 ] as BuildTypes ;
10
9
const buildType = buildTyping ( buildArgv ) ;
@@ -17,7 +16,7 @@ await build({
17
16
charset : 'utf8' ,
18
17
19
18
platform : 'browser' ,
20
- format : 'iife ' ,
19
+ format : 'esm ' ,
21
20
22
21
bundle : true ,
23
22
minify : buildType . PUBLISH ,
@@ -26,13 +25,13 @@ await build({
26
25
treeShaking : true ,
27
26
28
27
banner : {
29
- js : getMetaString ( )
28
+ js : await readFile ( "./src/meta.ts" , 'utf-8' )
30
29
} ,
31
30
32
31
plugins : [
33
32
copy ( {
34
33
assets : {
35
- from : [ "./src/README.md" ] ,
34
+ from : [ "./src/.page/CNAME" , "./src/.page/ README.md"] ,
36
35
to : [ "./" ]
37
36
}
38
37
} )
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ ### [ 다운로드] ( https://github.com/JadeMin-UserScripts/CodeUp-Plus/raw/dist/index.user.js )
2
+ (` https://github.com/JadeMin-UserScripts/CodeUp-Plus/raw/dist/index.user.js ` )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // ==UserScript==
2
+ // @name CodeUp+
3
+ // @description CodeUp+
4
+ // @version 0.1.1
5
+ // @icon https://icons.duckduckgo.com/ip2/codeup.kr.ico
6
+ // @updateURL https://github.com/JadeMin-UserScripts/CodeUp-Plus/raw/dist/index.user.js
7
+ // @downloadURL https://github.com/JadeMin-UserScripts/CodeUp-Plus/raw/dist/index.user.js
8
+ // @match https://*.codeup.kr/*
9
+ // @run -at document-end
10
+ // ==/UserScript==
Original file line number Diff line number Diff line change @@ -8,27 +8,27 @@ const problemNumber = (document.querySelector("input#problem_id") as HTMLInputEl
8
8
const storageName = `editor_${ problemNumber } ` ;
9
9
export const _getSaved = ( ) : SavedWithExpires | null => JSON . parse ( localStorage . getItem ( storageName ) ! ) ;
10
10
export const _removeSaved = ( ) : void => localStorage . removeItem ( storageName ) ;
11
- export const cleanSaved = ( ) : true | null => {
11
+ export const _cleanSaved = ( ) : true | null => {
12
12
const saved = _getSaved ( ) ;
13
- if ( saved === null ) return null
13
+
14
+ if ( saved === null ) return null ;
14
15
if ( Date . now ( ) > saved . expires ) {
15
16
_removeSaved ( ) ;
16
17
return true ;
17
18
} else return null ;
18
19
} ;
19
-
20
- cleanSaved ( ) ;
21
20
export const getSaved = ( ) : Saved | null => {
22
21
const saved = _getSaved ( ) ;
23
22
if ( saved === null ) return null ;
24
23
25
24
return saved . value ;
26
25
} ;
27
- export const setSaved = ( obj : { [ key : string ] : any } , expireDate : number ) : void => {
28
- const saved = getSaved ( ) ;
29
-
26
+ export const setSaved = ( obj : { [ key : string ] : any } , expireDate : number = 5000 ) : void => {
30
27
return localStorage . setItem ( storageName , JSON . stringify ( {
31
28
value : obj ,
32
29
expires : Date . now ( ) + expireDate
33
30
} ) ) ;
34
- } ;
31
+ } ;
32
+
33
+ // 초기화
34
+ _cleanSaved ( ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments