Skip to content

Commit 9143129

Browse files
committed
chore: init project
1 parent f67617b commit 9143129

19 files changed

+312
-0
lines changed

packages/weapp-tw/package.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "weapp-tw",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"description": "tsdown bundler template",
6+
"author": "ice breaker <[email protected]>",
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/sonofmagic/weapp-tailwindcss.git",
11+
"directory": "packages/weapp-tw"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/sonofmagic/weapp-tailwindcss/issues"
15+
},
16+
"keywords": [],
17+
"sideEffects": false,
18+
"exports": {
19+
".": {
20+
"types": "./dist/index.d.mts",
21+
"import": {
22+
"types": "./dist/index.d.mts",
23+
"default": "./dist/index.mjs"
24+
},
25+
"require": {
26+
"types": "./dist/index.d.cts",
27+
"default": "./dist/index.cjs"
28+
}
29+
}
30+
},
31+
"main": "./dist/index.cjs",
32+
"module": "./dist/index.mjs",
33+
"types": "./dist/index.d.mts",
34+
"files": [
35+
"dist"
36+
],
37+
"scripts": {
38+
"dev": "tsdown -w",
39+
"build": "tsdown",
40+
"test": "vitest run",
41+
"test:dev": "vitest",
42+
"release": "pnpm publish",
43+
"lint": "eslint .",
44+
"lint:fix": "eslint . --fix"
45+
},
46+
"publishConfig": {}
47+
}

packages/weapp-tw/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export function greet(name: string) {
2+
return `hello ${name}`
3+
}
4+
5+
export const VERSION = '0.0.0'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { greet, VERSION } from '@/index'
2+
3+
describe('tsdown template', () => {
4+
it('greets with provided name', () => {
5+
expect(greet('world')).toBe('hello world')
6+
})
7+
8+
it('exposes version placeholder', () => {
9+
expect(VERSION).toBe('0.0.0')
10+
})
11+
})

packages/weapp-tw/tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"paths": {
6+
"@/*": [
7+
"src/*"
8+
]
9+
}
10+
},
11+
"include": [
12+
"src",
13+
"test"
14+
]
15+
}

packages/weapp-tw/tsdown.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'tsdown'
2+
3+
export default defineConfig({
4+
entry: ['./src/index.ts'],
5+
format: ['esm', 'cjs'],
6+
dts: true,
7+
clean: true,
8+
target: 'node18',
9+
})

packages/weapp-tw/vitest.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import path from 'node:path'
2+
import { defineProject } from 'vitest/config'
3+
4+
export default defineProject({
5+
test: {
6+
alias: [
7+
{
8+
find: '@',
9+
replacement: path.resolve(__dirname, './src'),
10+
},
11+
],
12+
globals: true,
13+
testTimeout: 60_000,
14+
},
15+
})

packages/weapptw/package.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "weapptw",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"description": "tsdown bundler template",
6+
"author": "ice breaker <[email protected]>",
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/sonofmagic/weapp-tailwindcss.git",
11+
"directory": "packages/weapptw"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/sonofmagic/weapp-tailwindcss/issues"
15+
},
16+
"keywords": [],
17+
"sideEffects": false,
18+
"exports": {
19+
".": {
20+
"types": "./dist/index.d.mts",
21+
"import": {
22+
"types": "./dist/index.d.mts",
23+
"default": "./dist/index.mjs"
24+
},
25+
"require": {
26+
"types": "./dist/index.d.cts",
27+
"default": "./dist/index.cjs"
28+
}
29+
}
30+
},
31+
"main": "./dist/index.cjs",
32+
"module": "./dist/index.mjs",
33+
"types": "./dist/index.d.mts",
34+
"files": [
35+
"dist"
36+
],
37+
"scripts": {
38+
"dev": "tsdown -w",
39+
"build": "tsdown",
40+
"test": "vitest run",
41+
"test:dev": "vitest",
42+
"release": "pnpm publish",
43+
"lint": "eslint .",
44+
"lint:fix": "eslint . --fix"
45+
},
46+
"publishConfig": {}
47+
}

packages/weapptw/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export function greet(name: string) {
2+
return `hello ${name}`
3+
}
4+
5+
export const VERSION = '0.0.0'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { greet, VERSION } from '@/index'
2+
3+
describe('tsdown template', () => {
4+
it('greets with provided name', () => {
5+
expect(greet('world')).toBe('hello world')
6+
})
7+
8+
it('exposes version placeholder', () => {
9+
expect(VERSION).toBe('0.0.0')
10+
})
11+
})

packages/weapptw/tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"paths": {
6+
"@/*": [
7+
"src/*"
8+
]
9+
}
10+
},
11+
"include": [
12+
"src",
13+
"test"
14+
]
15+
}

0 commit comments

Comments
 (0)