Skip to content

Commit 02d559a

Browse files
committed
feat: first setup commit
0 parents  commit 02d559a

File tree

8 files changed

+7997
-0
lines changed

8 files changed

+7997
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@babel/env", "@babel/typescript"],
3+
"plugins": ["@babel/proposal-class-properties", "@babel/proposal-object-rest-spread"]
4+
}

.circleci/config.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Javascript Node CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
- image: circleci/node:10
10+
working_directory: ~/repo
11+
steps:
12+
- checkout
13+
# Download and cache dependencies
14+
- restore_cache:
15+
keys:
16+
- v1-dependencies-{{ checksum "yarn.lock" }}
17+
- run: yarn install
18+
- save_cache:
19+
paths:
20+
- node_modules
21+
key: v1-dependencies-{{ checksum "yarn.lock" }}
22+
- run:
23+
name: Build
24+
command: yarn run build
25+
- save_cache:
26+
paths:
27+
- dist
28+
key: v1-dist-{{ .Environment.CIRCLE_SHA1 }}
29+
30+
publish:
31+
docker:
32+
- image: circleci/node:10
33+
working_directory: ~/repo
34+
steps:
35+
- checkout
36+
- restore_cache:
37+
keys:
38+
- v1-dist-{{ .Environment.CIRCLE_SHA1" }}
39+
- run:
40+
name: Publish Package
41+
command: cd dist && yarn run semantic-release
42+
43+
workflows:
44+
version: 2
45+
build:
46+
jobs:
47+
- test
48+
- publish:
49+
requires:
50+
- test
51+
filters:
52+
branches:
53+
only:
54+
- next
55+
- master
56+
- beta

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules
2+
/dist

package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "typescript-datastructures",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "tsnd --respawn --transpileOnly ./src/examples/index.ts",
8+
"build": "TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack --mode=production",
9+
"semantic-release": "semantic-release",
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"release": {
13+
"branches": [
14+
"master",
15+
"next",
16+
{
17+
"name": "beta",
18+
"prerelease": true
19+
}
20+
]
21+
},
22+
"keywords": [],
23+
"author": "",
24+
"license": "ISC",
25+
"devDependencies": {
26+
"@babel/core": "^7.8.4",
27+
"@babel/plugin-proposal-class-properties": "^7.8.3",
28+
"@babel/preset-env": "^7.8.4",
29+
"@babel/preset-typescript": "^7.8.3",
30+
"@types/node": "^13.7.0",
31+
"@types/webpack": "^4.41.4",
32+
"babel-loader": "^8.0.6",
33+
"semantic-release": "^17.0.2",
34+
"source-map-loader": "^0.2.4",
35+
"ts-node-dev": "^1.0.0-pre.44",
36+
"typescript": "^3.7.5",
37+
"webpack": "^4.41.5",
38+
"webpack-cli": "^3.3.10"
39+
}
40+
}

tsconfig.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"esModuleInterop": true,
8+
"allowSyntheticDefaultImports": true,
9+
"strict": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"module": "commonjs",
12+
"moduleResolution": "node",
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"noEmit": true
16+
},
17+
"include": ["src"]
18+
}

tsconfig.webpack.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// https://webpack.js.org/configuration/configuration-languages/#typescript
2+
3+
{
4+
"compilerOptions": {
5+
"module": "commonjs",
6+
"target": "es5",
7+
"esModuleInterop": true
8+
}
9+
}

webpack.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import webpack from 'webpack';
2+
import path from 'path';
3+
4+
const nodeEnv = process.env.NODE_ENV || 'development';
5+
const isProd = nodeEnv === 'production';
6+
7+
const webpackconfiguration: webpack.Configuration = {
8+
entry: path.resolve(__dirname, 'src', 'index.ts'),
9+
devtool: isProd ? 'hidden-source-map' : 'source-map',
10+
output: {
11+
filename: 'typescript-datastructures.js',
12+
path: path.resolve(__dirname, 'dist'),
13+
libraryTarget: 'umd',
14+
globalObject: 'this',
15+
sourceMapFilename: 'typescript-datastructures.map',
16+
library: 'typescript-datastructures'
17+
},
18+
resolve: {
19+
extensions: ['.ts', '.js', '.json']
20+
},
21+
module: {
22+
rules: [{ test: /\.(ts|js)x?$/, use: ['babel-loader', 'source-map-loader'], exclude: /node_modules/ }]
23+
}
24+
};
25+
26+
export default webpackconfiguration;

0 commit comments

Comments
 (0)