-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30e44e7
commit 7253da3
Showing
13 changed files
with
272 additions
and
15 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,115 @@ | ||
# Created by https://www.gitignore.io/api/node | ||
# Edit at https://www.gitignore.io/?templates=node | ||
|
||
esm | ||
cjs | ||
lib | ||
package-lock.json | ||
__snapshots__ | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# End of https://www.gitignore.io/api/node | ||
|
||
.DS_Store | ||
.cache | ||
.vscode | ||
.idea | ||
.env | ||
|
||
*.bak | ||
*.tem | ||
*.temp | ||
#.swp | ||
*.*~ | ||
~*.* | ||
|
||
# IDEA | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ |
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,15 @@ | ||
UMD Example | ||
--- | ||
|
||
## Quick Start | ||
|
||
```shell | ||
$ npx create-kkt my-app -e umd | ||
cd my-app | ||
$ npm install | ||
|
||
$ npm run watch # Listen compile .ts files. | ||
$ npm run build # compile .ts files. | ||
|
||
$ npm run start | ||
``` |
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,17 @@ | ||
{ | ||
"name": "@template/umd", | ||
"private": true, | ||
"version": "3.0.4", | ||
"description": "UMD Example.", | ||
"scripts": { | ||
"watch": "tsbb watch --no-esm --disable-babel", | ||
"build": "tsbb build --no-esm --disable-babel", | ||
"test": "tsbb test", | ||
"coverage": "tsbb test --coverage" | ||
}, | ||
"keywords": [], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"tsbb": "^3.0.4" | ||
} | ||
} |
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 @@ | ||
import index from './'; | ||
|
||
describe('sum', () => { | ||
it('works', async () => { | ||
const num = await index(); | ||
expect(num).toBe('22 Hello World'); | ||
}); | ||
}); |
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 @@ | ||
import { sum } from './utils/sum'; | ||
import { test } from './utils/Test'; | ||
|
||
class Test { | ||
constructor() {} | ||
public a: string = 'A'; | ||
count() { | ||
return 10; | ||
} | ||
} | ||
|
||
(() => { | ||
const { sum } = require('./utils/sum'); | ||
const data = { a: 1 }; | ||
const result = { ...data }; | ||
})(); | ||
|
||
export default async () => { | ||
const testHandle = new Test(); | ||
return `${sum(1, testHandle.count())} ${test('Hello World')}`; | ||
}; |
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,17 @@ | ||
export type Test = { | ||
a: string; | ||
b: number; | ||
}; | ||
|
||
export type TestGood = { | ||
a: string; | ||
g: string; | ||
b: number; | ||
c: number; | ||
e: number; | ||
e333: number; | ||
}; | ||
|
||
export function test(str: string) { | ||
return `${str}`; | ||
} |
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,15 @@ | ||
/** | ||
* 这里是注释 | ||
* @param a | ||
* @param b | ||
*/ | ||
export function abs(a: number, b: number, c?: string) { | ||
return a + b; | ||
} | ||
|
||
export type TestGood2333 = { | ||
aaaa: string; | ||
xxxx: number; | ||
wwww: number; | ||
good: number; | ||
}; |
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,5 @@ | ||
import { abs } from './a/a'; | ||
|
||
export function sum(a: number, b: number) { | ||
return a + b + abs(a, b); | ||
} |
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,7 @@ | ||
import { sum } from '../src/utils/sum'; | ||
|
||
describe('sum', () => { | ||
it('works', async () => { | ||
expect(sum(1, 1)).toEqual(4); | ||
}); | ||
}); |
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,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"noImplicitAny": true, | ||
"module": "UMD", | ||
"target": "es2015", | ||
"lib": ["es5", "es6", "dom"], | ||
"declaration": true, | ||
"preserveConstEnums": true, | ||
"isolatedModules": true, | ||
"allowUmdGlobalAccess": true, | ||
"noLib": false, | ||
"rootDir": "./src/" | ||
}, | ||
"files": ["src/index.ts", "src/utils/sum.ts", "src/utils/Test.ts", "src/utils/a/a.ts"], | ||
"include": ["src/**/*"] | ||
} |
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