Skip to content

Commit

Permalink
chore: add ts-module example
Browse files Browse the repository at this point in the history
  • Loading branch information
adbayb committed Apr 3, 2021
1 parent 466a1bb commit 1b77ae9
Show file tree
Hide file tree
Showing 10 changed files with 3,768 additions and 61 deletions.
20 changes: 20 additions & 0 deletions examples/ts-module/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "ts-module",
"version": "0.0.0",
"private": true,
"source": "src/index.ts",
"main": "dist/index.cjs.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"clean": "rm -rf dist",
"start": "yarn build && open public/index.html",
"build": "quickbundle build"
},
"devDependencies": {
"@types/react": "17.0.3",
"@types/react-dom": "17.0.3",
"quickbundle": "0.0.1",
"typescript": "4.2.3"
}
}
8 changes: 8 additions & 0 deletions examples/ts-module/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const version = "0.0.0";

export const getCWD = () => {
return process.cwd();
};

// eslint-disable-next-line import/no-default-export
export default "ts-module";
7 changes: 7 additions & 0 deletions examples/ts-module/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"moduleResolution": "Node",
"target": "ES2015"
}
}
4 changes: 2 additions & 2 deletions examples/ts-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.0",
"private": true,
"source": "src/index.tsx",
"main": "dist/example.cjs.js",
"module": "dist/example.esm.js",
"main": "dist/index.cjs.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"clean": "rm -rf dist",
Expand Down
4 changes: 2 additions & 2 deletions examples/ts-preact/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2015",
"jsx": "react-jsx",
"moduleResolution": "Node"
"moduleResolution": "Node",
"target": "ES2015"
}
}
4 changes: 2 additions & 2 deletions examples/ts-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.0",
"private": true,
"source": "src/index.tsx",
"main": "dist/example.cjs.js",
"module": "dist/example.esm.js",
"main": "dist/index.cjs.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"clean": "rm -rf dist",
Expand Down
4 changes: 2 additions & 2 deletions examples/ts-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2015",
"jsx": "react-jsx"
"moduleResolution": "Node",
"target": "ES2015"
}
}
26 changes: 26 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.0.0",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*", "examples/*"],
"command": {
"init": {
"exact": true
},
"version": {
"allowBranch": "main",
"conventionalCommits": true,
"createRelease": "github",
"exact": true,
"message": "chore(release): publish %s",
"yes": false,
"ignoreChanges": [
"**/node_modules/**",
"**/*.md",
"**/__tests__/**",
"**/*.test.{ts?(x),js?(x)}",
"**/example?(s)/**"
]
}
}
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"private": true,
"workspaces": ["examples/*", "packages/*"],
"workspaces": [
"packages/*",
"examples/*"
],
"author": {
"name": "Ayoub Adib",
"email": "[email protected]",
Expand All @@ -15,7 +18,8 @@
"check:format": "prettier . --ignore-path .gitignore --ignore-path .prettierignore",
"check:lint": "eslint . --ignore-path .gitignore",
"format": "yarn check:format --write",
"lint": "yarn check:lint --fix"
"lint": "yarn check:lint --fix",
"release": "lerna publish"
},
"prettier": "@adbayb/prettier-config",
"eslintConfig": {
Expand All @@ -36,10 +40,7 @@
},
"devDependencies": {
"@adbayb/eslint-config": "0.5.0",
"@adbayb/prettier-config": "0.5.0"
},
"dependencies": {
"esbuild": "0.11.4",
"progress-estimator": "0.3.0"
"@adbayb/prettier-config": "0.5.0",
"lerna": "4.0.0"
}
}
Loading

0 comments on commit 1b77ae9

Please sign in to comment.