Skip to content

Commit 7398626

Browse files
authored
Update prettier dev-dependency to v2.5.1 in Digital Twins (Azure#19528)
* Update version * format files
1 parent 65d02a8 commit 7398626

17 files changed

+425
-425
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/digitaltwins/digital-twins-core/karma.conf.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ const {
55
jsonRecordingFilterFunction,
66
isPlaybackMode,
77
isSoftRecordMode,
8-
isRecordMode
8+
isRecordMode,
99
} = require("@azure-tools/test-recorder");
1010

11-
module.exports = function(config) {
11+
module.exports = function (config) {
1212
config.set({
1313
// base path that will be used to resolve all patterns (eg. files, exclude)
1414
basePath: "./",
@@ -29,13 +29,13 @@ module.exports = function(config) {
2929
"karma-sourcemap-loader",
3030
"karma-junit-reporter",
3131
"karma-json-to-file-reporter",
32-
"karma-json-preprocessor"
32+
"karma-json-preprocessor",
3333
],
3434

3535
// list of files / patterns to load in the browser
3636
files: [
3737
"dist-test/index.browser.js",
38-
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }
38+
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true },
3939
].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []),
4040

4141
// list of files / patterns to exclude
@@ -48,7 +48,7 @@ module.exports = function(config) {
4848
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
4949
// Preprocess source file to calculate code coverage, however this will make source file unreadable
5050
// "dist-test/index.browser.js": ["coverage"]
51-
"recordings/browsers/**/*.json": ["json"]
51+
"recordings/browsers/**/*.json": ["json"],
5252
},
5353

5454
// inject following environment values into browser testing with window.__env__
@@ -59,7 +59,7 @@ module.exports = function(config) {
5959
"AZURE_CLIENT_ID",
6060
"AZURE_CLIENT_SECRET",
6161
"AZURE_TENANT_ID",
62-
"TEST_MODE"
62+
"TEST_MODE",
6363
],
6464

6565
// test results reporter to use
@@ -74,8 +74,8 @@ module.exports = function(config) {
7474
{ type: "json", subdir: ".", file: "coverage.json" },
7575
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
7676
{ type: "html", subdir: "html" },
77-
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }
78-
]
77+
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
78+
],
7979
},
8080

8181
junitReporter: {
@@ -85,13 +85,13 @@ module.exports = function(config) {
8585
useBrowserName: false, // add browser name to report and classes names
8686
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
8787
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
88-
properties: {} // key value pair of properties to add to the <properties> section of the report
88+
properties: {}, // key value pair of properties to add to the <properties> section of the report
8989
},
9090

9191
jsonToFileReporter: {
9292
// required - to save the recordings of browser tests
9393
filter: jsonRecordingFilterFunction,
94-
outputPath: "."
94+
outputPath: ".",
9595
},
9696

9797
// web server port
@@ -115,8 +115,8 @@ module.exports = function(config) {
115115
customLaunchers: {
116116
ChromeHeadlessNoSandbox: {
117117
base: "ChromeHeadless",
118-
flags: ["--no-sandbox", "--disable-web-security"]
119-
}
118+
flags: ["--no-sandbox", "--disable-web-security"],
119+
},
120120
},
121121

122122
// Continuous Integration mode
@@ -131,15 +131,15 @@ module.exports = function(config) {
131131
browserDisconnectTimeout: 10000,
132132
browserDisconnectTolerance: 3,
133133
browserConsoleLogOptions: {
134-
terminal: !isRecordMode()
134+
terminal: !isRecordMode(),
135135
},
136136

137137
client: {
138138
mocha: {
139139
// change Karma's debug.html to the mocha web reporter
140140
reporter: "html",
141-
timeout: "600000"
142-
}
143-
}
141+
timeout: "600000",
142+
},
143+
},
144144
});
145145
};

sdk/digitaltwins/digital-twins-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"mocha": "^7.1.1",
102102
"mocha-junit-reporter": "^2.0.0",
103103
"nyc": "^15.0.0",
104-
"prettier": "^1.16.4",
104+
"prettier": "^2.5.1",
105105
"rimraf": "^3.0.0",
106106
"rollup": "^1.16.3",
107107
"sinon": "^9.0.2",

sdk/digitaltwins/digital-twins-core/samples-dev/dt_component_lifecycle.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ import { inspect } from "util";
2323
// For the purpose of this example we will create temporary digital twin using random Ids.
2424
// We have to make sure these model Ids are unique within the DT instance so we use generated UUIDs.
2525
async function main() {
26-
const modelId = `dtmi:model_${v4()
27-
.split("-")
28-
.join("")};1`;
29-
const componentId = `dtmi:component_${v4()
30-
.split("-")
31-
.join("")};1`;
26+
const modelId = `dtmi:model_${v4().split("-").join("")};1`;
27+
const componentId = `dtmi:component_${v4().split("-").join("")};1`;
3228
const digitalTwinId = `digitalTwin-${v4()}`;
3329

3430
const temporaryComponent = {
@@ -40,9 +36,9 @@ async function main() {
4036
{
4137
"@type": "Property",
4238
name: "ComponentProp1",
43-
schema: "string"
44-
}
45-
]
39+
schema: "string",
40+
},
41+
],
4642
};
4743

4844
const temporaryModel = {
@@ -54,26 +50,26 @@ async function main() {
5450
{
5551
"@type": "Property",
5652
name: "Prop1",
57-
schema: "double"
53+
schema: "double",
5854
},
5955
{
6056
"@type": "Component",
6157
name: "Component1",
62-
schema: componentId
63-
}
64-
]
58+
schema: componentId,
59+
},
60+
],
6561
};
6662

6763
const temporaryTwin = {
6864
$dtId: digitalTwinId,
6965
$metadata: {
70-
$model: modelId
66+
$model: modelId,
7167
},
7268
Prop1: 42,
7369
Component1: {
7470
$metadata: {},
75-
ComponentProp1: "value1"
76-
}
71+
ComponentProp1: "value1",
72+
},
7773
};
7874

7975
// AZURE_DIGITALTWINS_URL: The URL to your Azure Digital Twins instance
@@ -110,7 +106,7 @@ async function main() {
110106
const patch = {
111107
op: "replace",
112108
path: "/ComponentProp1",
113-
value: "value2"
109+
value: "value2",
114110
};
115111
const updateComponentResponse = await serviceClient.updateComponent(
116112
digitalTwinId,

sdk/digitaltwins/digital-twins-core/samples-dev/dt_digitaltwins_lifecycle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async function main() {
5959
const twinPatch = {
6060
op: "replace",
6161
path: "/AverageTemperature",
62-
value: 42
62+
value: 42,
6363
};
6464
const updatedTwin = await serviceClient.updateDigitalTwin(digitalTwinId, [twinPatch]);
6565
console.log(`Updated Digital Twin:`);

sdk/digitaltwins/digital-twins-core/samples-dev/dt_models_lifecycle.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ import { v4 } from "uuid";
2121
// For the purpose of this example we will create temporary model and a temporary component model using random Ids.
2222
// We have to make sure these model Ids are unique within the DT instance so we use generated UUIDs.
2323
async function main() {
24-
const modelId = `dtmi:model_${v4()
25-
.split("-")
26-
.join("")};1`;
27-
const componentId = `dtmi:component_${v4()
28-
.split("-")
29-
.join("")};1`;
24+
const modelId = `dtmi:model_${v4().split("-").join("")};1`;
25+
const componentId = `dtmi:component_${v4().split("-").join("")};1`;
3026

3127
const temporaryComponent = {
3228
"@id": componentId,
@@ -37,14 +33,14 @@ async function main() {
3733
{
3834
"@type": "Property",
3935
name: "ComponentProp1",
40-
schema: "string"
36+
schema: "string",
4137
},
4238
{
4339
"@type": "Telemetry",
4440
name: "ComponentTelemetry1",
45-
schema: "integer"
46-
}
47-
]
41+
schema: "integer",
42+
},
43+
],
4844
};
4945

5046
const temporaryModel = {
@@ -56,19 +52,19 @@ async function main() {
5652
{
5753
"@type": "Property",
5854
name: "Prop1",
59-
schema: "string"
55+
schema: "string",
6056
},
6157
{
6258
"@type": "Component",
6359
name: "Component1",
64-
schema: componentId
60+
schema: componentId,
6561
},
6662
{
6763
"@type": "Telemetry",
6864
name: "Telemetry1",
69-
schema: "integer"
70-
}
71-
]
65+
schema: "integer",
66+
},
67+
],
7268
};
7369

7470
// AZURE_DIGITALTWINS_URL: The URL to your Azure Digital Twins instance

0 commit comments

Comments
 (0)