Skip to content

Commit 8c4f0b7

Browse files
committed
chore: move to community
1 parent f9ad776 commit 8c4f0b7

21 files changed

+760
-697
lines changed

.eslintrc.js

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
module.exports = {
2+
extends: ['plugin:prettier/recommended'],
3+
plugins: ['prettier', '@typescript-eslint'],
4+
parser: '@typescript-eslint/parser',
5+
parserOptions: {
6+
createDefaultProgram: true,
7+
project: './tsconfig.json',
8+
},
9+
rules: {
10+
'prettier/prettier': 'warn',
11+
'@typescript-eslint/adjacent-overload-signatures': 'error',
12+
'@typescript-eslint/array-type': 'error',
13+
'@typescript-eslint/await-thenable': 'error',
14+
'@typescript-eslint/ban-types': 'off',
15+
'@typescript-eslint/class-name-casing': 'off',
16+
'@typescript-eslint/consistent-type-assertions': 'error',
17+
'@typescript-eslint/consistent-type-definitions': 'error',
18+
'@typescript-eslint/explicit-member-accessibility': [
19+
'off',
20+
{
21+
accessibility: 'explicit',
22+
},
23+
],
24+
'@typescript-eslint/indent': [
25+
'error',
26+
4,
27+
{
28+
FunctionDeclaration: {
29+
parameters: 'first',
30+
},
31+
FunctionExpression: {
32+
parameters: 'first',
33+
},
34+
SwitchCase: 1,
35+
},
36+
],
37+
'@typescript-eslint/interface-name-prefix': 'off',
38+
'@typescript-eslint/member-delimiter-style': 'error',
39+
'@typescript-eslint/member-ordering': 'off',
40+
'@typescript-eslint/no-empty-function': 'off',
41+
'@typescript-eslint/no-empty-interface': 'off',
42+
'@typescript-eslint/no-explicit-any': 'off',
43+
'@typescript-eslint/no-floating-promises': 'off',
44+
'@typescript-eslint/no-inferrable-types': 'off',
45+
'@typescript-eslint/no-misused-new': 'off',
46+
'@typescript-eslint/no-namespace': 'off',
47+
'@typescript-eslint/no-parameter-properties': 'off',
48+
'@typescript-eslint/no-require-imports': 'off',
49+
'@typescript-eslint/no-unnecessary-qualifier': 'error',
50+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
51+
'@typescript-eslint/no-use-before-declare': 'off',
52+
'@typescript-eslint/no-var-requires': 'off',
53+
'@typescript-eslint/prefer-for-of': 'off',
54+
'@typescript-eslint/prefer-function-type': 'error',
55+
'@typescript-eslint/prefer-namespace-keyword': 'error',
56+
'@typescript-eslint/quotes': [
57+
'error',
58+
'single',
59+
{
60+
avoidEscape: true,
61+
},
62+
],
63+
'@typescript-eslint/semi': ['error'],
64+
'@typescript-eslint/space-within-parens': ['off', 'never'],
65+
'@typescript-eslint/triple-slash-reference': 'off',
66+
'@typescript-eslint/type-annotation-spacing': 'error',
67+
'@typescript-eslint/unified-signatures': 'error',
68+
'arrow-body-style': 'error',
69+
'arrow-parens': ['off', 'as-needed'],
70+
camelcase: 'off',
71+
'capitalized-comments': 'off',
72+
complexity: 'off',
73+
'constructor-super': 'error',
74+
curly: ['error', 'multi-line'],
75+
'dot-notation': 'off',
76+
'eol-last': 'error',
77+
eqeqeq: ['error', 'smart'],
78+
'guard-for-in': 'off',
79+
'id-blacklist': ['error', 'any', 'string', 'boolean', 'Undefined'],
80+
'id-match': 'error',
81+
'sort-imports': [
82+
'error',
83+
{
84+
ignoreCase: false,
85+
ignoreDeclarationSort: true,
86+
ignoreMemberSort: false,
87+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
88+
},
89+
],
90+
'linebreak-style': 'off',
91+
'max-classes-per-file': 'off',
92+
'max-len': [
93+
'off',
94+
{
95+
ignorePattern: '^import |^export {(.*?)}',
96+
code: 200,
97+
},
98+
],
99+
'new-parens': 'off',
100+
'newline-per-chained-call': 'off',
101+
'no-bitwise': 'off',
102+
'no-caller': 'error',
103+
'no-cond-assign': 'off',
104+
'no-console': [
105+
'off',
106+
{
107+
allow: [
108+
'log',
109+
'warn',
110+
'dir',
111+
'timeLog',
112+
'assert',
113+
'clear',
114+
'count',
115+
'countReset',
116+
'group',
117+
'groupEnd',
118+
'table',
119+
'debug',
120+
'dirxml',
121+
'error',
122+
'groupCollapsed',
123+
'Console',
124+
'profile',
125+
'profileEnd',
126+
'timeStamp',
127+
'context',
128+
],
129+
},
130+
],
131+
'no-constant-condition': 'error',
132+
'no-control-regex': 'off',
133+
'no-debugger': 'error',
134+
'no-duplicate-imports': 'error',
135+
'no-empty': 'off',
136+
'no-eval': 'off',
137+
'no-extra-semi': 'off',
138+
'no-fallthrough': 'error',
139+
'no-invalid-regexp': 'error',
140+
'no-invalid-this': 'off',
141+
'no-irregular-whitespace': 'off',
142+
'no-multiple-empty-lines': 'off',
143+
'no-new-wrappers': 'error',
144+
'no-redeclare': ['error', { builtinGlobals: false }],
145+
'no-regex-spaces': 'error',
146+
'no-return-await': 'error',
147+
'no-shadow': [
148+
'off',
149+
{
150+
hoist: 'all',
151+
},
152+
],
153+
'no-throw-literal': 'error',
154+
'no-trailing-spaces': 'error',
155+
'no-undef-init': 'error',
156+
'no-underscore-dangle': 'off',
157+
'no-unsafe-finally': 'error',
158+
'no-unused-expressions': [
159+
'error',
160+
{
161+
allowTaggedTemplates: true,
162+
allowShortCircuit: true,
163+
},
164+
],
165+
'no-unused-labels': 'error',
166+
'no-var': 'error',
167+
'object-shorthand': 'error',
168+
'one-var': ['off', 'never'],
169+
'prefer-arrow/prefer-arrow-functions': 'off',
170+
'prefer-const': 'error',
171+
'quote-props': 'off',
172+
radix: 'error',
173+
'space-before-function-paren': 'off',
174+
'use-isnan': 'error',
175+
'valid-typeof': 'off',
176+
},
177+
};

.gitignore

Lines changed: 75 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,81 @@
1-
.idea/
2-
.vscode/
3-
.tscache/
4-
/demo/node_modules/
5-
/demo/platforms/
6-
/demo/app/temp/
7-
/demo/app/assets/
8-
/demo-ng/node_modules/
9-
/demo-ng/platforms/
10-
/demo-ng/app/temp/
11-
/demo-ng/app/assets/
12-
node_modules/
13-
.settings/
1+
# Windows image file caches
2+
Thumbs.db
3+
ehthumbs.db
4+
5+
# Folder config file
6+
Desktop.ini
7+
8+
# Recycle Bin used on file shares
9+
$RECYCLE.BIN/
10+
11+
# Windows Installer files
12+
*.cab
13+
*.msi
14+
*.msm
15+
*.msp
16+
17+
# Windows shortcuts
18+
*.lnk
19+
20+
# =========================
21+
# Operating System Files
22+
# =========================
23+
24+
# OSX
25+
# =========================
1426

1527
.DS_Store
16-
*.js.map
17-
*.tar
18-
*.tgz
19-
*.gz
20-
*.zip
21-
*.js
28+
.AppleDouble
29+
.LSOverride
30+
.idea
31+
32+
# Thumbnails
33+
._*
34+
35+
# Files that might appear on external disk
36+
.Spotlight-V100
37+
.Trashes
38+
39+
# Directories potentially created on remote AFP share
40+
.AppleDB
41+
.AppleDesktop
42+
Network Trash Folder
43+
Temporary Items
44+
.apdisk
45+
46+
bin
47+
obj
48+
build/
49+
.vs
50+
.tscache
51+
*.user
52+
!demo-vue/app/app.js
53+
*.map
54+
!gruntfile.js
55+
node_modules
56+
*.tmp.*
57+
demo*/platforms
58+
lib
59+
!webpack.*.js
60+
!build.esm.js
61+
report
2262
*.log
23-
nativescript-lottie.*.d.ts
24-
!src/scripts/*.js
25-
!demo/webpack.config.js
26-
!demo-ng/webpack.config.js
27-
!demo-vue/webpack.config.js
2863

29-
!demo/karma.conf.js
30-
!demo-ng/karma.conf.js
64+
*.framework
65+
*.aar
3166

32-
!demo/app/tests/tests.js
33-
!demo-ng/app/tests/tests.js
67+
Pods
68+
*.lock
69+
*.xcworkspace
70+
plugin/**/*.d.ts
71+
/plugin/README.md
72+
package-lock.json
73+
/.vscode
74+
/pnpm-lock.yaml
3475

35-
## Vue demo
36-
!demo-vue/**/*.js
76+
.update_backup
77+
.migration_backup
78+
plugin/**/*js.map
79+
plugin/**/*js
80+
pnpm-lock.yaml
81+
hooks

.prettierrc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2-
"singleQuote": true,
3-
"semi": true
4-
}
2+
"printWidth": 200,
3+
"semi": true,
4+
"tabWidth": 4,
5+
"singleQuote": true
6+
}

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
![Build CI](https://github.com/bradmartin/nativescript-texttospeech/workflows/Build%20CI/badge.svg)
2-
[![npm](https://img.shields.io/npm/v/nativescript-texttospeech.svg)](https://www.npmjs.com/package/nativescript-texttospeech)
3-
[![npm](https://img.shields.io/npm/dt/nativescript-texttospeech.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-texttospeech)
1+
[![npm](https://img.shields.io/npm/v/nativescript-community/texttospeech.svg)](https://www.npmjs.com/package/nativescript-community/texttospeech)
2+
[![npm](https://img.shields.io/npm/dt/nativescript-community/texttospeech.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-community/texttospeech)
43

5-
# NativeScript-TextToSpeech :loudspeaker:
4+
# @nativescript-community/texttospeech :loudspeaker:
65

76
A Text to Speech NativeScript plugin for Android & iOS
87

@@ -15,19 +14,12 @@ A Text to Speech NativeScript plugin for Android & iOS
1514

1615
Run the following command from the root of your project:
1716

18-
NativeScript version 7+:
1917

2018
```
21-
tns plugin add nativescript-texttospeech
19+
tns plugin add @nativescript-community/texttospeech
2220
```
2321

24-
NativeScript Version below 7:
25-
26-
```
27-
tns plugin add nativescript-texttospeech@2.0.3
28-
```
29-
30-
This command automatically installs the necessary files, as well as stores nativescript-texttospeech as a dependency in your project's package.json file.
22+
This command automatically installs the necessary files, as well as stores @nativescript-community/texttospeech as a dependency in your project's package.json file.
3123

3224
## Video Tutorial
3325

@@ -37,10 +29,10 @@ This command automatically installs the necessary files, as well as stores nativ
3729

3830
```js
3931
/// javascript
40-
const TextToSpeech = require('nativescript-texttospeech');
32+
const TextToSpeech = require('@nativescript-community/texttospeech');
4133

4234
/// TypeScript
43-
import { TNSTextToSpeech, SpeakOptions } from 'nativescript-texttospeech';
35+
import { TNSTextToSpeech, SpeakOptions } from '@nativescript-community/texttospeech';
4436

4537
const TTS = new TNSTextToSpeech();
4638

@@ -105,7 +97,7 @@ const speakOptions: SpeakOptions = {
10597

10698
### Tip
10799

108-
- The speech synthesizer takes a moment to initialize on most devices. A simple way to get around this (tested in the demo app) is to create your new instance of the TNSTextToSpeech and then immediately call the `speak` method with the options objects `text` value = `""`. This will force the synthesizer to "warm up" and not speak anything. Now when you call the `speak` method for your app's functionality it will already have "warmed up" the synthesizer so the delay should be minimal.
100+
- The speech synthesizer takes a moment to initialize on most devices. A simple way to get around this (tested in the demo app) is to create your new instance of the TNSTextToSpeech and then immediately call the `init` method . This will force the synthesizer to "warm up" . Now when you call the `speak` method for your app's functionality it will already have "warmed up" the synthesizer so the delay should be minimal.
109101
It's possible this "Warm up" process could be put into the plugin source itself, I don't have time to do it right now but welcome any contribution that is well tested to make this the default behavior of the synthesizers.
110102

111103
### Android Only Methods

lerna.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"packages": [
3+
"plugin"
4+
],
5+
"version": "3.0.1",
6+
"command": {
7+
"publish": {
8+
"conventionalCommits": true
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)