-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #514 from Tencent/dev
v3.12.1
- Loading branch information
Showing
11 changed files
with
100 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const fs = require('fs'); | ||
const { execSync } = require('child_process'); | ||
const vendorConfig = require('./vendor.json'); | ||
|
||
const main = () => { | ||
console.group('\nEmitting type declarations...'); | ||
const distFile = './dist/vconsole.min.d.ts'; | ||
if (fs.existsSync(distFile)) { | ||
fs.unlinkSync(distFile); | ||
} | ||
execSync('tsc --build ./tsconfig.type.json'); | ||
let distContent = fs.readFileSync(distFile, 'utf8'); | ||
for (const name of vendorConfig.name) { | ||
distContent = distContent.replace(new RegExp(`['"]${name}['"]`, 'g'), `"vendor/${name}"`); | ||
} | ||
const vendorContent = '/// <reference path="../build/vendor.d.ts" />\n\n'; | ||
fs.writeFileSync(distFile, vendorContent + distContent, 'utf8'); | ||
console.groupEnd(); | ||
}; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
declare module 'vendor/core-js/stable/symbol' { | ||
} | ||
|
||
declare module 'vendor/mutation-observer' { | ||
export class MutationObserver { | ||
} | ||
} | ||
|
||
declare module 'vendor/svelte' { | ||
export class SvelteComponent { | ||
} | ||
} | ||
|
||
declare module 'vendor/svelte/store' { | ||
export interface Subscriber<T> { | ||
} | ||
export interface Unsubscriber { | ||
} | ||
export interface Updater<T> { | ||
} | ||
export interface Writable<T> { | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": [ | ||
"core-js/stable/symbol", | ||
"mutation-observer", | ||
"svelte/store", | ||
"svelte" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters