Skip to content

Commit

Permalink
🐛 fix(devkit): adjust tsconfig for build (#1361)
Browse files Browse the repository at this point in the history
* adjust tsconfig for build

* revert to old setup for schematics

* format files

* fix lint issue

* fix styles migration for windows

* update docs

* fix lint issue

* update changesets
  • Loading branch information
hirsch88 authored Mar 19, 2024
1 parent 726282f commit c4ecf31
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 224 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-peaches-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**css**: support new grid class names like `grid` and `col`
5 changes: 5 additions & 0 deletions .changeset/heavy-penguins-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**styles**: fix paths in the migration script for windows
5 changes: 5 additions & 0 deletions .changeset/quick-months-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**devkit**: fix build issue of ng-add schematics
2 changes: 1 addition & 1 deletion .changeset/unlucky-cameras-jam.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@baloise/ds-core': patch
---

**styles**: add migration for compact theme and grid
**styles**: add migration for compact theme
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ packages/favicons/CHANGELOG.md
packages/fonts/CHANGELOG.md
packages/icons/CHANGELOG.md

packages/devkit/src/**/*.js
packages/devkit/src/**/*.js.map
packages/devkit/src/**/*.d.ts


libs/output-targets-angular/CHANGELOG.md
libs/output-targets-react/CHANGELOG.md
libs/output-targets-vue/CHANGELOG.md
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ packages/maps/src/markers.json
packages/core/icons
packages/core/src/utils/constants/icons.constant.ts
packages/core/src/components.d.ts
packages/devkit/src/**/*.js
packages/devkit/src/**/*.d.ts

resources/data/tags.json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If the projects requires translations, then install [\{TRANSLOCO\}](https://ngne
Configure project:

```bash
ng add @ngneat/transloco
npx ng add @ngneat/transloco
# On an nx workspace
nx g @ngneat/transloco:ng-add
```
Expand All @@ -64,7 +64,7 @@ Lets install the schematics to configure and add the design system to an Angular
Install the library using Angular CLI:

```bash
ng add @baloise/ds-devkit
npx ng add @baloise/ds-devkit
# On an nx workspace
nx g @baloise/ds-devkit:ng-add
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ npm add -D -E @baloise/ds-devkit
2. **Angular Schematics Script:** Rename the packages by simply run the following command in your project's root directory:

```bash
ng generate @baloise/ds-devkit:up16
npx ng generate @baloise/ds-devkit:up16
```

3. **Verify the Changes:** Once the script has run, review the changes to ensure everything has been updated correctly. It's a good practice to check the git diff if your project is version-controlled.
Expand Down
161 changes: 17 additions & 144 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions packages/devkit/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
dist
files
src/**/*.js
src/**/*.d.ts
10 changes: 9 additions & 1 deletion packages/devkit/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
"@nx/dependency-checks": [
"error",
{
"ignoredDependencies": ["@angular/common", "@angular/core", "tslib"]
"ignoredDependencies": [
"@angular/common",
"@angular/core",
"@angular-devkit/core",
"@angular-devkit/schematics",
"@schematics/angular",
"typescript",
"tslib"
]
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions packages/devkit/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Ignores TypeScript files, but keeps definitions.
*.ts
!*.d.ts
18 changes: 6 additions & 12 deletions packages/devkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@
},
"homepage": "https://design.baloise.dev",
"license": "Apache-2.0",
"dependencies": {
"@angular-devkit/core": "~15.0.5",
"@angular-devkit/schematics": "~15.0.5",
"@schematics/angular": "~15.0.5",
"glob": "~10.3.10"
},
"peerDependencies": {
"@angular/common": ">=15.0.0",
"@angular/core": ">=15.0.0"
},
"schematics": "./src/collection.json",
"ng-add": {
"save": "devDependencies"
},
"devDependencies": {
"copyfiles": "~2.4.1"
"dependencies": {
"@angular-devkit/core": "^17.0.10",
"@angular-devkit/schematics": "^17.0.10",
"@schematics/angular": "^17.0.10",
"typescript": "~5.2.2",
"glob": "~10.3.10"
}
}
17 changes: 3 additions & 14 deletions packages/devkit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,20 @@
"nx-release-publish": {
"executor": "@nx/js:release-publish",
"options": {
"packageRoot": "{projectRoot}/dist"
}
},
"prepare": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist",
"main": "{projectRoot}/src/index.ts",
"tsConfig": "{projectRoot}/tsconfig.lib.json",
"assets": ["{projectRoot}/**/files/**", "{projectRoot}/src/**/*.json"]
"packageRoot": "{projectRoot}"
}
},
"build": {
"executor": "nx:run-commands",
"dependsOn": ["^build", "prepare"],
"options": {
"cwd": "{projectRoot}",
"command": "copyfiles src/*/schema.json src/*/files/** src/collection.json dist"
"command": "tsc -p tsconfig.json"
}
},
"link": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}/dist",
"cwd": "{projectRoot}",
"command": "npm link"
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/devkit/src/ng-upgrade-16/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ function updateSassImports(): Rule {
recorder.remove(0, content.length)
recorder.insertLeft(0, newContent)
tree.commitUpdate(recorder)
_context.logger.info(`Updated import in ${path}`)
}
}
})
Expand Down
31 changes: 22 additions & 9 deletions packages/devkit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
"compilerOptions": {
"baseUrl": "tsconfig",
"lib": ["es2018", "dom"],
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"rootDir": "src/",
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"target": "es6",
"types": ["node"]
},
"include": ["src/**/*"],
"exclude": ["src/*/files/**/*"]
}
Loading

0 comments on commit c4ecf31

Please sign in to comment.