Skip to content

Commit 0343a0d

Browse files
authored
Use inlineSources to bundle source file contents inside map files (#7615)
* Enable inlineSources and stop packaging TS files * Make all license texts consistent and include README.md Fixes #7706
1 parent 0884197 commit 0343a0d

File tree

81 files changed

+546
-829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+546
-829
lines changed

common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-files-required.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,6 @@ export = {
8181
}
8282
});
8383
}
84-
85-
// looks for 'src' with optional leading './' and optional trailing '/ '
86-
if (
87-
elements.every(
88-
(element: Literal): boolean =>
89-
!/^(.\/)?((src\/)|(src$))/.test(element.value as string)
90-
)
91-
) {
92-
context.report({
93-
node: nodeValue,
94-
message: "src is not included in files",
95-
fix: (fixer: Rule.RuleFixer): Rule.Fix => {
96-
elementValues.push("src");
97-
return fixer.replaceText(nodeValue, arrayToString(elementValues));
98-
}
99-
});
100-
}
10184
}
10285
} as Rule.RuleListener)
10386
: {};

common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-files-required.ts

Lines changed: 8 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ const examplePackageGood = `{
120120
"typings/service-bus.d.ts",
121121
"tsconfig.json",
122122
"dist",
123-
"dist-esm/src",
124-
"src"
123+
"dist-esm/src"
125124
],
126125
"sideEffects": false
127126
}`;
@@ -252,25 +251,25 @@ ruleTester.run("ts-package-json-files-required", rule, {
252251
valid: [
253252
{
254253
// only the fields we care about
255-
code: '{"files": ["src", "dist", "dist-esm/src"]}',
254+
code: '{"files": ["dist", "dist-esm/src"]}',
256255
filename: "package.json"
257256
},
258257
// other valid formats
259258
{
260-
code: '{"files": ["src/", "dist/", "dist-esm/src/"]}',
259+
code: '{"files": ["dist/", "dist-esm/src/"]}',
261260
filename: "package.json"
262261
},
263262
{
264-
code: '{"files": ["./src", "./dist", "./dist-esm/src"]}',
263+
code: '{"files": ["./dist", "./dist-esm/src"]}',
265264
filename: "package.json"
266265
},
267266
{
268-
code: '{"files": ["./src/", "./dist/", "./dist-esm/src/"]}',
267+
code: '{"files": ["./dist/", "./dist-esm/src/"]}',
269268
filename: "package.json"
270269
},
271270
{
272271
// mixed
273-
code: '{"files": ["./src", "dist/", "./dist-esm/src/"]}',
272+
code: '{"files": ["dist/", "./dist-esm/src/"]}',
274273
filename: "package.json"
275274
},
276275
{
@@ -286,7 +285,7 @@ ruleTester.run("ts-package-json-files-required", rule, {
286285
],
287286
invalid: [
288287
{
289-
code: '{"notFiles": ["src", "dist", "dist-esm/src"]}',
288+
code: '{"notFiles": ["dist", "dist-esm/src"]}',
290289
filename: "package.json",
291290
errors: [
292291
{
@@ -296,7 +295,7 @@ ruleTester.run("ts-package-json-files-required", rule, {
296295
},
297296
{
298297
// name is in a nested object
299-
code: '{"outer": {"files": ["src", "dist", "dist-esm/src"]}}',
298+
code: '{"outer": {"files": ["dist", "dist-esm/src"]}}',
300299
filename: "package.json",
301300
errors: [
302301
{
@@ -305,16 +304,6 @@ ruleTester.run("ts-package-json-files-required", rule, {
305304
]
306305
},
307306
// missing values
308-
{
309-
code: '{"files": ["dist", "dist-esm/src"]}',
310-
filename: "package.json",
311-
errors: [
312-
{
313-
message: "src is not included in files"
314-
}
315-
],
316-
output: '{"files": ["dist", "dist-esm/src", "src"]}'
317-
},
318307
{
319308
code: '{"files": ["dist", "src"]}',
320309
filename: "package.json",
@@ -341,9 +330,6 @@ ruleTester.run("ts-package-json-files-required", rule, {
341330
errors: [
342331
{
343332
message: "dist-esm/src is not included in files"
344-
},
345-
{
346-
message: "src is not included in files"
347333
}
348334
],
349335
output: '{"files": ["dist", "dist-esm/src"]}'
@@ -354,26 +340,10 @@ ruleTester.run("ts-package-json-files-required", rule, {
354340
errors: [
355341
{
356342
message: "dist is not included in files"
357-
},
358-
{
359-
message: "src is not included in files"
360343
}
361344
],
362345
output: '{"files": ["dist-esm/src", "dist"]}'
363346
},
364-
{
365-
code: '{"files": ["src"]}',
366-
filename: "package.json",
367-
errors: [
368-
{
369-
message: "dist is not included in files"
370-
},
371-
{
372-
message: "dist-esm/src is not included in files"
373-
}
374-
],
375-
output: '{"files": ["src", "dist"]}'
376-
},
377347
{
378348
code: '{"files": []}',
379349
filename: "package.json",
@@ -383,64 +353,10 @@ ruleTester.run("ts-package-json-files-required", rule, {
383353
},
384354
{
385355
message: "dist-esm/src is not included in files"
386-
},
387-
{
388-
message: "src is not included in files"
389356
}
390357
],
391358
output: '{"files": ["dist"]}'
392359
},
393-
// test regex
394-
{
395-
code: '{"files": ["src1", "dist", "dist-esm/src"]}',
396-
filename: "package.json",
397-
errors: [
398-
{
399-
message: "src is not included in files"
400-
}
401-
],
402-
output: '{"files": ["src1", "dist", "dist-esm/src", "src"]}'
403-
},
404-
{
405-
code: '{"files": ["1src", "dist", "dist-esm/src"]}',
406-
filename: "package.json",
407-
errors: [
408-
{
409-
message: "src is not included in files"
410-
}
411-
],
412-
output: '{"files": ["1src", "dist", "dist-esm/src", "src"]}'
413-
},
414-
{
415-
code: '{"files": ["/src", "dist", "dist-esm/src"]}',
416-
filename: "package.json",
417-
errors: [
418-
{
419-
message: "src is not included in files"
420-
}
421-
],
422-
output: '{"files": ["/src", "dist", "dist-esm/src", "src"]}'
423-
},
424-
{
425-
code: '{"files": [".src", "dist", "dist-esm/src"]}',
426-
filename: "package.json",
427-
errors: [
428-
{
429-
message: "src is not included in files"
430-
}
431-
],
432-
output: '{"files": [".src", "dist", "dist-esm/src", "src"]}'
433-
},
434-
{
435-
code: '{"files": ["lib/src", "dist", "dist-esm/src"]}',
436-
filename: "package.json",
437-
errors: [
438-
{
439-
message: "src is not included in files"
440-
}
441-
],
442-
output: '{"files": ["lib/src", "dist", "dist-esm/src", "src"]}'
443-
},
444360
{
445361
// example file with src not in files
446362
code: examplePackageBad,
@@ -451,9 +367,6 @@ ruleTester.run("ts-package-json-files-required", rule, {
451367
},
452368
{
453369
message: "dist-esm/src is not included in files"
454-
},
455-
{
456-
message: "src is not included in files"
457370
}
458371
]
459372
}

sdk/appconfiguration/app-configuration/LICENSE.txt renamed to sdk/appconfiguration/app-configuration/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 Microsoft
3+
Copyright (c) 2020 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

sdk/appconfiguration/app-configuration/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@
3333
"dist-esm/**/*.d.ts",
3434
"dist-esm/**/*.d.ts.map",
3535
"types/app-configuration.d.ts",
36-
"src/**/*.ts",
3736
"README.md",
38-
"rollup.config.js",
39-
"tsconfig.json"
37+
"LICENSE"
4038
],
4139
"scripts": {
4240
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",

sdk/appconfiguration/app-configuration/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"moduleResolution": "node",
66
"strict": true,
77
"sourceMap": true,
8+
"inlineSources": true,
89
"declarationMap": true,
910
"declaration": true,
1011
"declarationDir": "./types",

sdk/core/abort-controller/LICENSE

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Copyright (c) 2020 Microsoft
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1414

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

sdk/core/abort-controller/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
"files": [
3939
"dist/",
4040
"dist-esm/src/",
41-
"src/",
4241
"types/src",
43-
"tsconfig.json"
42+
"README.md",
43+
"LICENSE"
4444
],
4545
"repository": {
4646
"type": "git",

sdk/core/core-amqp/LICENSE

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Copyright (c) 2020 Microsoft
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1414

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

sdk/core/core-amqp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"files": [
1818
"dist/",
1919
"dist-esm/src/",
20-
"src/",
2120
"typings/src/",
22-
"tsconfig.json",
23-
"ThirdPartyNotices.txt"
21+
"ThirdPartyNotices.txt",
22+
"README.md",
23+
"LICENSE"
2424
],
2525
"scripts": {
2626
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",

sdk/textanalytics/ai-text-analytics/LICENSE.txt renamed to sdk/core/core-arm/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 Microsoft
3+
Copyright (c) 2020 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)