Skip to content

Commit

Permalink
refactor: move project to monorepo (#173)
Browse files Browse the repository at this point in the history
* refactor: move project to monorepo

* fix: missing ngsw config

* chore: rename sketch parser module

* chore: use tsconfig references for libraries

* chore: configure path resolution

* chore: move src to core package

* chore: add postinstall build libraries

* refactor: add absolute path

* fix: disable Ngxs developmentMode
  • Loading branch information
shikanime authored and manekinekko committed Feb 12, 2019
1 parent 37cd05e commit 172b346
Show file tree
Hide file tree
Showing 193 changed files with 487 additions and 143 deletions.
17 changes: 15 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
{
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#ff2c70"
}
}
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/bazel-out/**": true,
"**/dist/**": true,
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/bazel-out": true,
"**/dist": true,
},
}
134 changes: 134 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

69 changes: 52 additions & 17 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"newProjectRoot": "packages",
"projects": {
"xlayers": {
"root": "",
"sourceRoot": "src",
"root": "packages/core/",
"sourceRoot": "packages/core/src",
"projectType": "application",
"prefix": "sketch",
"schematics": {},
Expand All @@ -14,17 +14,17 @@
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/html",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"index": "packages/core/src/index.html",
"main": "packages/core/src/main.ts",
"polyfills": "packages/core/src/polyfills.ts",
"tsConfig": "packages/core/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json"
"packages/core/src/favicon.ico",
"packages/core/src/assets",
"packages/core/src/manifest.json"
],
"styles": [
"src/styles.css"
"packages/core/src/styles.css"
],
"scripts": [
"node_modules/jszip/dist/jszip.min.js",
Expand All @@ -36,8 +36,8 @@
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
"replace": "packages/core/src/environments/environment.ts",
"with": "packages/core/src/environments/environment.prod.ts"
}
],
"optimization": true,
Expand All @@ -62,8 +62,8 @@
"hmr": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
"replace": "packages/core/src/environments/environment.ts",
"with": "packages/core/src/environments/environment.hmr.ts"
}
]
}
Expand Down Expand Up @@ -94,8 +94,43 @@
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"packages/core/tsconfig.app.json",
"packages/core/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"sketchapp-parser": {
"root": "packages/sketchapp-parser",
"sourceRoot": "packages/sketchapp-parser/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "packages/sketchapp-parser/tsconfig.lib.json",
"project": "packages/sketchapp-parser/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "packages/sketchapp-parser/src/test.ts",
"tsConfig": "packages/sketchapp-parser/tsconfig.spec.json",
"karmaConfig": "packages/sketchapp-parser/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"packages/sketchapp-parser/tsconfig.lib.json",
"packages/sketchapp-parser/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
Expand Down
17 changes: 17 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
roots: [
"<rootDir>/packages"
],
globals: {
"ts-jest": {
tsConfig: "packages/core/src/tsconfig.spec.json"
},
__TRANSFORM_HTML__: true
},
preset: "jest-preset-angular",
setupTestFrameworkScriptFile: "./jest.ts",
moduleNameMapper: {
"~(.*)": "<rootDir>/packages/$1",
"^\@xlayers/(.*)": "<rootDir>/dist/$1"
}
}
File renamed without changes.
49 changes: 37 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "xlayers",
"version": "1.0.0",
"version": "1.0.1-beta.0",
"scripts": {
"postinstall": "ng build sketchapp-parser",
"release": "standard-version",
"ng": "ng",
"start": "ng serve --configuration hmr",
"build": "ng build --prod --stats-json",
Expand All @@ -13,10 +15,6 @@
"deploy": "npm run test:ci && npm run build && firebase deploy",
"analyse": "webpack-bundle-analyzer ./dist/html/stats.json"
},
"jest": {
"preset": "jest-preset-angular",
"setupTestFrameworkScriptFile": "./src/jest.ts"
},
"private": true,
"dependencies": {
"@angular/animations": "^7.1.0",
Expand Down Expand Up @@ -60,6 +58,7 @@
"@angularclass/hmr": "^2.1.3",
"@ngxs/devtools-plugin": "^3.3.0",
"@ngxs/logger-plugin": "^3.3.0",
"@types/highlight.js": "^9.12.3",
"@types/node": "~8.9.4",
"@types/sketchapp": "^1.0.0",
"codelyzer": "~4.5.0",
Expand Down
6 changes: 4 additions & 2 deletions src/browserslist → packages/core/browserslist
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For IE 9-11 support, please uncomment the last line of the file and adjust as needed
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed

> 0.5%
last 2 versions
Firefox ESR
not dead
# IE 9-11
not IE 9-11
2 changes: 1 addition & 1 deletion ngsw-config.json → packages/core/ngsw-config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"index": "/index.html",
"assetGroups": [{
"name": "app",
"name": "sketch",
"installMode": "prefetch",
"resources": {
"files": [
Expand Down
File renamed without changes.
Loading

0 comments on commit 172b346

Please sign in to comment.