-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild-api.js
90 lines (77 loc) · 2.29 KB
/
build-api.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
* Provides programatic access to files that are published by the
* `gravity-particles` NPM package.
*
* This is so that consumers of this package can access those files
* in their own build processes (e.g. to copy them to their build dir)
* without needing to know the internal directory structure of this
* package or having to hard-code file paths in their own build
* scripts.
*
* @public
*/
// Note, since this file is included in the published NPM package, it
// must not export paths or filenames that are excluded from the published
// package. Refer to the 'files' section in package.json to see exactly
// what gets published and what does not.
const path = require('path');
const pkgManifest = require('./package.json');
const bldConsts = require('./build-consts.js');
const pkgDir = __dirname;
// Resolves the given path segments relative to the UI lib dist dir
function distPath(...pathSegements) {
return path.resolve(pkgDir, bldConsts.distDirname, ...pathSegements);
}
module.exports = {
/**
* The Gravity UI SASS version.
*
* @public
*/
version: pkgManifest.version,
// ==== Pre-compiled output: ====
/**
* Takes a sequence of path segments relative to the
* distributables directory and returns the absolute path.
*
* @param {...string} pathSegements One or more path segments
* relative to the distributables directory.
*
* @return {string} Absolute file path to the specified
* distributable directory or file.
*
* @public
*/
distPath,
/**
* Takes a sequence of path segments relative to the Web avatar SVGs
* distributables directory and returns the absolute path.
*
* @param {...string} pathSegements One or more path segments
* relative to the Web avatar SVGs distributables directory.
*
* @return {string} Absolute file path to the specified
* distributable directory or file.
*
* @public
*/
distWebSvgPath: (...pathSegements) => distPath(bldConsts.distWebSvgDirname, ...pathSegements),
/**
* The avatar SVGs sub-directory name.
*
* @public
*/
svgAvatarDirname: 'avatar',
/**
* The logo SVGs sub-directory name.
*
* @public
*/
svgLogoDirname: 'logo',
/**
* The UI SVGs sub-directory name.
*
* @public
*/
svgUiDirname: 'ui',
};