Skip to content

Commit 523c941

Browse files
authored
chore: Added license header script (#11590)
1 parent ec57e85 commit 523c941

File tree

9 files changed

+54
-24
lines changed

9 files changed

+54
-24
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ packages/**/dist/
99
packages/**/es/
1010
packages/**/esm/
1111
packages/**/cjs/
12-
.DS_Store
12+
**/.DS_Store
1313
.vscode
1414
.idea
1515
*.log

license_config.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"ignore": [
3+
"NOTICE",
4+
".circleci",
5+
".github",
6+
"**/*.config.dev.js",
7+
"**/*.config.js",
8+
"**/*.d.ts",
9+
"**/*.html",
10+
"**/*.jar",
11+
"**/*.json",
12+
"**/*.md",
13+
"**/*.plist",
14+
"**/*.podspec",
15+
"**/*.properties",
16+
"**/*.sh",
17+
"**/*.snap",
18+
"**/*.tsx",
19+
"**/*.xml",
20+
"**/*.yml",
21+
"**/.*",
22+
"**/amazon-cognito-identity-js",
23+
"**/android",
24+
"**/aws-amplify-react-native",
25+
"**/coverage",
26+
"**/coverage-ts",
27+
"**/dist",
28+
"**/docs",
29+
"**/ios",
30+
"**/lib",
31+
"**/lib-esm",
32+
"**/node_modules",
33+
"**/pushnotification",
34+
"**/vendor",
35+
"**/__tests__",
36+
"**/__mocks__"
37+
],
38+
"ignoreFile": ".gitignore",
39+
"license": "license_header.txt",
40+
"licenseFormats": {
41+
"js|ts|kt|java": {
42+
"eachLine": {
43+
"prepend": "// "
44+
}
45+
}
46+
},
47+
"trailingWhitespace": "TRIM"
48+
}

license_header.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
SPDX-License-Identifier: Apache-2.0

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"test": "lerna run test --stream",
1111
"test:size": "lerna run test:size --no-bail",
1212
"test:duplicates": "./scripts/duplicates-yarn.sh",
13+
"test:license": "license-check-and-add check -f license_config.json",
1314
"cypress": "lerna run cypress",
1415
"cypress:open": "lerna run cypress:open",
1516
"coverage": "codecov || exit 0",
@@ -23,6 +24,7 @@
2324
"clean:size": "lerna run clean:size --parallel",
2425
"format": "lerna run format",
2526
"lint": "lerna run lint",
27+
"lint:license": "license-check-and-add add -f license_config.json",
2628
"link-all": "yarn unlink-all && lerna exec --no-bail --parallel yarn link",
2729
"unlink-all": "lerna exec --no-bail --parallel -- yarn unlink; exit 0",
2830
"publish:main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=unstable --preid=unstable${PREID_HASH_SUFFIX} --exact --no-verify-access",
@@ -80,6 +82,7 @@
8082
"jest-config": "24.8.0",
8183
"json-loader": "^0.5.7",
8284
"lerna": "^6.6.1",
85+
"license-check-and-add": "^4.0.5",
8386
"prettier": "^2.4.1",
8487
"pretty-quick": "^1.11.1",
8588
"rimraf": "^2.6.2",

packages/aws-amplify/prepend-license.js

-19
This file was deleted.

packages/core/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@react-native-async-storage/async-storage": "1.15.17",
5353
"find": "^0.2.7",
5454
"genversion": "^2.2.0",
55-
"prepend-file": "^1.3.1",
5655
"react-native": "^0.64.1",
5756
"typescript": "5.0.2"
5857
},

packages/datastore-storage-adapter/.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ node_modules/**
66
.vscode/**
77
.DS_Store
88
*.log
9-
prepend-license.js
109
prettier.config.json
1110
tsconfig.json
1211
tsfmt.json

packages/datastore/.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ node_modules/**
66
.vscode/**
77
.DS_Store
88
*.log
9-
prepend-license.js
109
prettier.config.json
1110
tsconfig.json
1211
tsfmt.json

packages/pushnotification/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"compression-webpack-plugin": "^1.1.3",
4141
"find": "^0.2.7",
4242
"json-loader": "^0.5.7",
43-
"prepend-file": "^1.3.1",
4443
"rimraf": "^2.6.2",
4544
"source-map-loader": "^0.2.1",
4645
"uglifyjs-webpack-plugin": "^0.4.6",

0 commit comments

Comments
 (0)