Skip to content

Commit 5e7171b

Browse files
authored
Split into packages (#9)
* Make tetris-core out of existing source files * Move game-setup * Move game-init * Make cli a separate package * add options support cli * Move web to own folder * Add lerna for making monorepo features * Fix install * Sort out some dependencies * remove unused dependencies * Make packages and remove old dist files * Update workflow
1 parent 425d5d1 commit 5e7171b

File tree

103 files changed

+61975
-2785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+61975
-2785
lines changed

.github/workflows/node.js.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Node.js CI
4+
name: Deploy web version to gh-pages
55

66
on:
77
push:
@@ -35,5 +35,5 @@ jobs:
3535
with:
3636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3737
BRANCH: gh-pages # The branch the action should deploy to.
38-
FOLDER: . # The folder the action should deploy.
38+
FOLDER: packages/web/dist # The folder the action should deploy.
3939
CLEAN: true # Automatically remove deleted files from the deploy branch

.gitignore

+116-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,116 @@
1-
node_modules
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
.parcel-cache
78+
79+
# Next.js build output
80+
.next
81+
out
82+
83+
# Nuxt.js build / generate output
84+
.nuxt
85+
dist
86+
87+
# Gatsby files
88+
.cache/
89+
# Comment in the public line in if your project uses Gatsby and not Next.js
90+
# https://nextjs.org/blog/next-9-1#public-directory-support
91+
# public
92+
93+
# vuepress build output
94+
.vuepress/dist
95+
96+
# Serverless directories
97+
.serverless/
98+
99+
# FuseBox cache
100+
.fusebox/
101+
102+
# DynamoDB Local files
103+
.dynamodb/
104+
105+
# TernJS port file
106+
.tern-port
107+
108+
# Stores VSCode versions used for testing VSCode extensions
109+
.vscode-test
110+
111+
# yarn v2
112+
.yarn/cache
113+
.yarn/unplugged
114+
.yarn/build-state.yml
115+
.yarn/install-state.gz
116+
.pnp.*

.babelrc babel.config.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
{
1+
module.exports = {
22
"presets": [
33
[
44
"@babel/preset-env",
55
{
66
"targets": {
77
"chrome": "58",
88
"ie": "11",
9-
"safari": "9"
9+
"safari": "9"
1010
}
1111
}
1212
]
1313
],
1414
"plugins": [
1515
"@babel/plugin-proposal-object-rest-spread",
16-
"@babel/plugin-proposal-class-properties"
16+
"@babel/plugin-proposal-class-properties",
17+
"@babel/plugin-proposal-export-namespace-from",
18+
"@babel/plugin-proposal-export-default-from",
19+
"@babel/plugin-proposal-private-property-in-object"
1720
]
18-
}
21+
};

img/001a744c849158d5b86806841ecd5d2f.svg

-16
This file was deleted.

img/e27f40867ed340c0c4c40a25182347b8.svg

-16
This file was deleted.

js/33852cc8d92f25f4a7c6517b548b2eae.svg

-8
This file was deleted.

js/tetris-electron.js

-1
This file was deleted.

js/tetris-logserver.js

-1
This file was deleted.

js/tetris-node.js

-50
This file was deleted.

js/tetris-web.js

-8
This file was deleted.

js/tetris.js

-1
This file was deleted.

karma.conf.js

+2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ module.exports = (config) => {
88
// all files ending in "_test"
99
{ pattern: 'src/test/*-test.js', watched: false },
1010
{ pattern: 'src/test/**/*-test.js', watched: false },
11+
{ pattern: 'tetris-core/**/*-spec.js', watched: false },
1112
// each file acts as entry point for the webpack configuration
1213
],
1314

1415
preprocessors: {
1516
// add webpack as preprocessor
1617
'src/test/*-test.js': ['webpack'],
1718
'src/test/**/*-test.js': ['webpack'],
19+
"tetris-core/**/*-spec.js": ["webpack"]
1820
},
1921

2022
webpack: webpackConfig({mode: "development"}),

lerna.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"version": "0.0.0"
6+
}

0 commit comments

Comments
 (0)