FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
angular-plotly.js/scripts/verify-consumer.mjs at master · plotly/angular-plotly.js · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
plotly
/
angular-plotly.js
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
81
Star
243
Code
Issues
35
Pull requests
3
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
angular-plotly.js
/
scripts
/
verify-consumer.mjs
Copy path
More file actions
More file actions
Latest commit
History
History
History
88 lines (80 loc) · 2.71 KB
Breadcrumbs
angular-plotly.js
/
scripts
/
verify-consumer.mjs
Copy path
File metadata and controls
88 lines (80 loc) · 2.71 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
{
execFileSync
}
from
'node:child_process'
;
import
{
mkdtemp
,
readFile
,
rm
,
writeFile
}
from
'node:fs/promises'
;
import
{
tmpdir
}
from
'node:os'
;
import
{
join
,
resolve
}
from
'node:path'
;
const
root
=
resolve
(
import
.
meta
.
dirname
,
'..'
)
;
const
rootPackage
=
JSON
.
parse
(
await
readFile
(
resolve
(
root
,
'package.json'
)
,
'utf8'
)
)
;
const
workspace
=
await
mkdtemp
(
join
(
tmpdir
(
)
,
`angular-plotly-consumer-
${
rootPackage
.
version
}
-`
)
)
;
const
npmCache
=
join
(
tmpdir
(
)
,
'angular-plotly-npm-cache'
)
;
const
commandOptions
=
{
cwd
:
workspace
,
stdio
:
'inherit'
,
env
:
{
...
process
.
env
,
npm_config_cache
:
npmCache
}
,
}
;
try
{
const
packOutput
=
execFileSync
(
'npm'
,
[
'pack'
,
'--json'
,
'--pack-destination'
,
workspace
,
resolve
(
root
,
'dist/plotly'
)
,
]
,
{
...
commandOptions
,
encoding
:
'utf8'
,
stdio
:
[
'ignore'
,
'pipe'
,
'inherit'
]
}
)
;
const
tarball
=
resolve
(
workspace
,
JSON
.
parse
(
packOutput
)
[
0
]
.
filename
)
;
await
writeFile
(
join
(
workspace
,
'package.json'
)
,
JSON
.
stringify
(
{
private
:
true
,
type
:
'module'
,
dependencies
:
{
'@angular/common'
:
rootPackage
.
dependencies
[
'@angular/common'
]
,
'@angular/core'
:
rootPackage
.
dependencies
[
'@angular/core'
]
,
'angular-plotly.js'
:
`file:
${
tarball
}
`
,
rxjs
:
rootPackage
.
dependencies
.
rxjs
,
tslib
:
rootPackage
.
dependencies
.
tslib
,
}
,
devDependencies
:
{
typescript
:
rootPackage
.
devDependencies
.
typescript
,
}
,
}
,
null
,
2
)
)
;
await
writeFile
(
join
(
workspace
,
'tsconfig.json'
)
,
JSON
.
stringify
(
{
compilerOptions
:
{
lib
:
[
'ES2022'
,
'DOM'
]
,
module
:
'NodeNext'
,
moduleResolution
:
'NodeNext'
,
noEmit
:
true
,
strict
:
true
,
target
:
'ES2022'
,
}
,
files
:
[
'consumer.ts'
]
,
}
,
null
,
2
)
)
;
await
writeFile
(
join
(
workspace
,
'consumer.ts'
)
,
`
import {
PlotlyComponent,
PlotlyModule,
PlotlyService,
PlotlyViaCDNModule,
PlotlyViaWindowModule,
type PlotlyBundleName,
type PlotlyCDNProvider,
type PlotlyModuleConfig,
type Plotly,
} from 'angular-plotly.js';
const config: PlotlyModuleConfig = {
bundleName: 'basic' satisfies PlotlyBundleName,
cdnProvider: 'plotly' satisfies PlotlyCDNProvider,
version: '2.35.3',
};
const figure: Plotly.Figure = { data: [], layout: {}, frames: {} };
void [
PlotlyComponent,
PlotlyModule,
PlotlyService,
PlotlyViaCDNModule,
PlotlyViaWindowModule,
config,
figure,
];
`
)
;
execFileSync
(
'npm'
,
[
'install'
,
'--ignore-scripts'
,
'--no-audit'
,
'--no-fund'
]
,
commandOptions
)
;
execFileSync
(
resolve
(
workspace
,
'node_modules/.bin/tsc'
)
,
[
'--project'
,
'tsconfig.json'
]
,
commandOptions
)
;
console
.
log
(
`Verified packed-package consumer compilation for Angular
${
rootPackage
.
version
.
split
(
'.'
)
[
0
]
}
.`
)
;
}
finally
{
await
rm
(
workspace
,
{
recursive
:
true
,
force
:
true
}
)
;
}
Back
|
FazBrowse Home
|
New Git URL