Skip to content

Commit 23393af

Browse files
committed
chore: plugin-tools 2.2.1
1 parent 9e14486 commit 23393af

File tree

6 files changed

+47
-48
lines changed

6 files changed

+47
-48
lines changed

apps/demo-angular/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@nativescript/core": "file:../../node_modules/@nativescript/core"
55
},
66
"devDependencies": {
7-
"@nativescript/android": "8.0.0",
8-
"@nativescript/ios": "8.0.0"
7+
"@nativescript/android": "~8.1.1",
8+
"@nativescript/ios": "~8.1.0"
99
}
10-
}
10+
}

apps/demo/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@nativescript/core": "file:../../node_modules/@nativescript/core"
88
},
99
"devDependencies": {
10-
"@nativescript/android": "8.0.0",
11-
"@nativescript/ios": "8.0.0"
10+
"@nativescript/android": "~8.1.1",
11+
"@nativescript/ios": "~8.1.0"
1212
}
13-
}
13+
}

jest.config.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
module.exports = {
2-
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
3-
transform: {
4-
'^.+\\.(ts|js|html)$': 'ts-jest',
5-
},
6-
resolver: '@nrwl/jest/plugins/resolver',
7-
moduleFileExtensions: ['ts', 'js', 'html'],
8-
coverageReporters: ['html'],
9-
};
1+
const { getJestProjects } = require('@nrwl/jest');
2+
3+
module.exports = { projects: [...getJestProjects()] };

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@
2727
"@angular/router": "^12.0.0",
2828
"@nativescript/angular": "^12.0.0",
2929
"@nativescript/core": "^8.0.0",
30-
"@nativescript/plugin-tools": "2.0.4",
30+
"@nativescript/plugin-tools": "2.2.1",
3131
"@nativescript/types": "^8.0.0",
32-
"@nativescript/webpack": "beta",
32+
"@nativescript/webpack": "~5.0.0",
3333
"@ngtools/webpack": "^12.0.0",
3434
"husky": "^5.1.3",
3535
"nativescript-vue": "~2.9.0",
3636
"nativescript-vue-template-compiler": "~2.9.0",
3737
"ng-packagr": "^12.0.0",
3838
"rxjs": "~6.6.0",
39-
"typescript": "~4.2.0",
39+
"typescript": "~4.3.5",
4040
"zone.js": "~0.11.1"
4141
},
4242
"lint-staged": {
4343
"**/*.{js,ts,scss,json,html}": [
4444
"npx prettier --write"
4545
]
4646
}
47-
}
47+
}

tools/scripts/build-finish.ts

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,47 @@ const cmdArgs = process.argv.slice(2);
1111
const packageName = cmdArgs[0];
1212
const publish = cmdArgs[1] === 'publish';
1313

14-
console.log(`Building ${npmScope}/${packageName}...${publish ? 'and publishing.' : ''}`);
14+
const packagePath = path.join('packages', packageName, 'package.json');
15+
const packageJson = JSON.parse(fs.readFileSync(packagePath));
16+
const npmPackageName = packageJson.name;
17+
console.log(`Building ${npmPackageName}...${publish ? 'and publishing.' : ''}`);
1518

1619
// build angular package
1720
function buildAngular() {
18-
ngPackage
19-
.ngPackagr()
20-
.forProject(path.join('packages', packageName, 'angular', 'package.json'))
21-
.withTsConfig(path.join('packages', packageName, 'angular', 'tsconfig.angular.json'))
22-
.build()
23-
.then(() => {
24-
copyAngularDist();
25-
})
26-
.catch((error) => {
27-
console.error(error);
28-
process.exit(1);
29-
});
21+
ngPackage
22+
.ngPackagr()
23+
.forProject(path.join('packages', packageName, 'angular', 'package.json'))
24+
.withTsConfig(path.join('packages', packageName, 'angular', 'tsconfig.angular.json'))
25+
.build()
26+
.then(() => {
27+
copyAngularDist();
28+
})
29+
.catch((error) => {
30+
console.error(error);
31+
process.exit(1);
32+
});
3033
}
3134

3235
// copy angular ng-packagr output to dist/packages/{name}
3336
function copyAngularDist() {
34-
fs.copy(path.join('packages', packageName, 'angular', 'dist'), path.join('dist', 'packages', packageName, 'angular'))
35-
.then(() => {
36-
console.log(`${packageName} angular built successfully.`);
37-
finishPreparation();
38-
})
39-
.catch((err) => console.error(err));
37+
fs.copy(path.join('packages', packageName, 'angular', 'dist'), path.join('dist', 'packages', packageName, 'angular'))
38+
.then(() => {
39+
console.log(`${npmPackageName} angular built successfully.`);
40+
// buildNativeSrc();
41+
finishPreparation();
42+
})
43+
.catch((err) => console.error(err));
4044
}
4145

4246
function finishPreparation() {
43-
fs.copy(path.join('tools', 'assets', 'publishing'), path.join('dist', 'packages', packageName))
44-
.then(() => console.log(`${npmScope}/${packageName} ready to publish.`))
45-
.catch((err) => console.error(err));
47+
fs.copy(path.join('tools', 'assets', 'publishing'), path.join('dist', 'packages', packageName))
48+
.then(() => console.log(`${npmPackageName} ready to publish.`))
49+
.catch((err) => console.error(err));
4650
}
4751

4852
if (fs.existsSync(path.join(rootDir, 'packages', packageName, 'angular'))) {
49-
// package has angular specific src, build it first
50-
buildAngular();
53+
// package has angular specific src, build it first
54+
buildAngular();
5155
} else {
52-
finishPreparation();
56+
finishPreparation();
5357
}

workspace.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
}
7575
},
7676
"all": {
77-
"root": "packages/",
78-
"projectType": "library",
77+
"root": "",
78+
"projectType": "application",
7979
"targets": {
8080
"build": {
8181
"outputs": [
@@ -99,10 +99,11 @@
9999
},
100100
"executor": "@nrwl/workspace:run-commands"
101101
}
102-
}
102+
},
103+
"sourceRoot": ""
103104
}
104105
},
105106
"cli": {
106107
"defaultCollection": "@nrwl/workspace"
107108
}
108-
}
109+
}

0 commit comments

Comments
 (0)