Skip to content

Commit d352267

Browse files
committed
feat: v1
1 parent 909196c commit d352267

145 files changed

Lines changed: 14608 additions & 6026 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ Thumbs.db
4343
packages/**/angular/dist
4444

4545
.nx/cache
46-
.nx/workspace-data
46+
.nx/workspace-data
47+
/packages/font-manager/src-native/ios/.build
48+
/packages/font-manager/src-native/ios/FontManager/.build

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
1-
**=== IMPORTANT**
2-
3-
# :rotating_light: Important - read first!
4-
5-
**Use this template on GitHub:**
6-
1. Hit the "Use this template" button
7-
2. Follow GitHub instructions (set repo name, visibility, description) & clone your new repo
8-
3. Setup workspace: `npm run setup`
9-
4. Configure your npm scope: `npm run config`
10-
11-
**Use this template outside of GitHub:**
12-
13-
1. Download a zip of this repo
14-
2. Unzip and name the folder appropriately (perhaps the name of the npm scope you intend to manage here)
15-
3. Setup workspace: `npm run setup`
16-
4. Configure your npm scope: `npm run config`
17-
18-
---
19-
201
# @nativescript/\* plugins
212

223
```
234
npm run setup
245
npm start
256
```
267

27-
- @nativescript
8+
- [@nativescript/font-manager](packages/font-manager/README.md)
289

2910
# How to use?
3011

apps/demo/nativescript.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@ export default {
1111
cli: {
1212
packageManager: 'npm',
1313
},
14+
ios: {
15+
SPMPackages: [
16+
{
17+
name: 'FontManager',
18+
libs: ['FontManager'],
19+
path: '../../packages/font-manager/src-native/ios/FontManager',
20+
},
21+
],
22+
},
1423
} as NativeScriptConfig;

apps/demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"license": "SEE LICENSE IN <your-license-filename>",
55
"repository": "<fill-your-repository-here>",
66
"dependencies": {
7-
"@nativescript/core": "*"
7+
"@nativescript/core": "*",
8+
"@nativescript/font-manager": "file:../../packages/font-manager"
89
},
910
"devDependencies": {
1011
"@nativescript/android": "~8.9.0",

apps/demo/src/main-page.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<ScrollView class="h-full">
77
<StackLayout>
88
<Button text="add a package first" tap="{{ viewDemo }}" class="btn btn-primary rounded view-demo"/>
9+
<Button text="font-manager" tap="{{ viewDemo }}" class="btn btn-primary rounded view-demo"/>
910
</StackLayout>
1011
</ScrollView>
1112
</StackLayout>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
import { DemoSharedFontManager } from '@demo/shared';
3+
import {} from '@nativescript/font-manager';
4+
5+
export function navigatingTo(args: EventData) {
6+
const page = <Page>args.object;
7+
page.bindingContext = new DemoModel();
8+
}
9+
10+
export class DemoModel extends DemoSharedFontManager {}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
2+
<Page.actionBar>
3+
<ActionBar title="font-manager" icon="" class="action-bar" />
4+
</Page.actionBar>
5+
<StackLayout class="p-20">
6+
<Button text="Run Tests" tap="{{ testIt }}" class="btn btn-primary" />
7+
<ScrollView class="h-full" marginTop="12">
8+
<StackLayout>
9+
<Repeater items="{{ results }}">
10+
<Repeater.itemTemplate>
11+
<Label
12+
text="{{ passed ? '✓ ' + name : '✗ ' + name + (error ? ': ' + error : '') }}"
13+
color="{{ passed ? '#2e7d32' : '#c62828' }}"
14+
textWrap="true"
15+
class="p-5"
16+
/>
17+
</Repeater.itemTemplate>
18+
</Repeater>
19+
</StackLayout>
20+
</ScrollView>
21+
</StackLayout>
22+
</Page>

apps/demo/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"baseUrl": ".",
66
"paths": {
77
"~/*": ["src/*"],
8-
"@demo/shared": ["../../tools/demo/index.ts"]
8+
"@demo/shared": ["../../tools/demo/index.ts"],
9+
"@nativescript/*": ["../../packages/*"],
10+
"@nativescript/font-manager": ["../../packages/font-manager/index.d.ts"]
911
}
1012
}
1113
}

0 commit comments

Comments
 (0)