@ray-js/env 1.4.0-alpha.1 → 1.4.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/platform.d.ts +2 -2
- package/cjs/platform.js +5 -6
- package/esm/platform.d.ts +2 -2
- package/esm/platform.js +4 -5
- package/package.json +15 -15
- package/LICENSE.md +0 -9
package/cjs/platform.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
type Platform = 'thing' | 'web' | 'wechat' | 'ios' | 'android';
|
|
2
2
|
export declare const isWeb: boolean;
|
|
3
|
+
export declare const env: Platform;
|
|
3
4
|
export declare const isWechat: boolean;
|
|
4
5
|
export declare const isThing: boolean;
|
|
5
6
|
export declare const isMiniProgram: boolean;
|
|
6
7
|
export declare const isNative = false;
|
|
7
8
|
export declare const isAndroid = false;
|
|
8
9
|
export declare const isIOS = false;
|
|
9
|
-
export declare const env: Platform;
|
|
10
10
|
export {};
|
package/cjs/platform.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isIOS = exports.isAndroid = exports.isNative = exports.isMiniProgram = exports.isThing = exports.isWechat = exports.env = exports.isWeb = void 0;
|
|
4
4
|
exports.isWeb = typeof window !== 'undefined' && 'onload' in window;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.isThing =
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
exports.env = process.env.PLATFORM;
|
|
7
|
+
exports.isWechat = exports.env === 'wechat';
|
|
8
|
+
exports.isThing = exports.env === 'thing';
|
|
9
9
|
exports.isMiniProgram = exports.isWechat || exports.isThing;
|
|
10
10
|
exports.isNative = false;
|
|
11
11
|
exports.isAndroid = false;
|
|
12
12
|
exports.isIOS = false;
|
|
13
|
-
exports.env = process.env.PLATFORM;
|
package/esm/platform.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
type Platform = 'thing' | 'web' | 'wechat' | 'ios' | 'android';
|
|
2
2
|
export declare const isWeb: boolean;
|
|
3
|
+
export declare const env: Platform;
|
|
3
4
|
export declare const isWechat: boolean;
|
|
4
5
|
export declare const isThing: boolean;
|
|
5
6
|
export declare const isMiniProgram: boolean;
|
|
6
7
|
export declare const isNative = false;
|
|
7
8
|
export declare const isAndroid = false;
|
|
8
9
|
export declare const isIOS = false;
|
|
9
|
-
export declare const env: Platform;
|
|
10
10
|
export {};
|
package/esm/platform.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export const isWeb = typeof window !== 'undefined' && 'onload' in window;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const isThing =
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
export const env = process.env.PLATFORM;
|
|
4
|
+
export const isWechat = env === 'wechat';
|
|
5
|
+
export const isThing = env === 'thing';
|
|
6
6
|
export const isMiniProgram = isWechat || isThing;
|
|
7
7
|
export const isNative = false;
|
|
8
8
|
export const isAndroid = false;
|
|
9
9
|
export const isIOS = false;
|
|
10
|
-
export const env = process.env.PLATFORM;
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/env",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.10",
|
|
4
4
|
"description": "Ray runtime environment",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
7
7
|
],
|
|
8
|
+
"repository": {},
|
|
8
9
|
"license": "MIT",
|
|
10
|
+
"maintainers": [
|
|
11
|
+
{
|
|
12
|
+
"name": "tuyafe",
|
|
13
|
+
"email": "tuyafe@tuya.com"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
9
16
|
"main": "cjs/index.js",
|
|
10
17
|
"module": "esm/index.js",
|
|
11
18
|
"files": [
|
|
12
19
|
"cjs",
|
|
13
20
|
"esm"
|
|
14
21
|
],
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public",
|
|
17
|
-
"registry": "https://registry.npmjs.org"
|
|
18
|
-
},
|
|
19
22
|
"scripts": {
|
|
20
|
-
"clean": "rm -rf cjs esm",
|
|
21
23
|
"build": "yarn build:cjs && yarn build:esm",
|
|
22
24
|
"build:cjs": "tsc -p ./tsconfig.build.json --target es5 --module commonjs --outDir cjs",
|
|
23
25
|
"build:esm": "tsc -p ./tsconfig.build.json --target es6 --module esnext --outDir esm",
|
|
26
|
+
"clean": "rm -rf cjs esm",
|
|
24
27
|
"watch": "concurrently 'yarn build:cjs --watch' 'yarn build:esm --watch'"
|
|
25
28
|
},
|
|
26
|
-
"maintainers": [
|
|
27
|
-
{
|
|
28
|
-
"name": "tuyafe",
|
|
29
|
-
"email": "tuyafe@tuya.com"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
29
|
"devDependencies": {
|
|
33
|
-
"concurrently": "^7.
|
|
30
|
+
"concurrently": "^7.6.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public",
|
|
34
|
+
"registry": "https://registry.npmjs.org"
|
|
34
35
|
},
|
|
35
|
-
"gitHead": "
|
|
36
|
-
"repository": {}
|
|
36
|
+
"gitHead": "14cb935df10f020e714b44bb41d4899646db751c"
|
|
37
37
|
}
|
package/LICENSE.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Copyright © 2014-2022 Tuya.inc
|
|
2
|
-
|
|
3
|
-
MIT License
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|