Skip to content

Commit b97b90f

Browse files
committed
Merge pull request #1 from davidchin/move_src
CHECKOUT-2739: Move `ScriptLoader` source files into separate repository
2 parents 2a01ac3 + 06620da commit b97b90f

15 files changed

+4993
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## What?
2+
...
3+
4+
## Why?
5+
...
6+
7+
## Testing / Proof
8+
...
9+
10+
@bigcommerce/frontend

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.log
2+
/coverage
3+
/node_modules

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: node_js
2+
3+
node_js: 6
4+
5+
cache: yarn
6+
7+
dist: trusty
8+
9+
sudo: false
10+
11+
script:
12+
- yarn lint
13+
- yarn test:series -- --coverage

commit-validation.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"scopes": [
3+
"common",
4+
"core"
5+
]
6+
}

jest-config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
browser: true,
3+
transform: {
4+
'\\.(ts|js)$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
5+
},
6+
moduleFileExtensions: [
7+
'ts',
8+
'tsx',
9+
'js',
10+
'jsx',
11+
'json',
12+
],
13+
testRegex: 'src/.*\\.spec.(js|ts)$',
14+
setupTestFrameworkScriptFile: '<rootDir>/jest-setup.js',
15+
collectCoverageFrom: [
16+
'src/**/*.{js,ts}',
17+
],
18+
coveragePathIgnorePatterns: [
19+
'\\.mock\\.(js|ts)$',
20+
'\\.typedef\\.(js|ts)$',
21+
'\\.d\\.ts$',
22+
],
23+
};

jest-setup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
beforeAll(() => {
2+
expect.hasAssertions();
3+
});

package.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "@bigcommerce/script-loader",
3+
"version": "0.0.0",
4+
"description": "A library for loading JavaScript files asynchronously",
5+
"main": "lib/index.js",
6+
"types": "lib/index.d.ts",
7+
"files": [
8+
"lib/"
9+
],
10+
"engines": {
11+
"node": "^6.10.0"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git://github.com/bigcommerce/script-loader-js.git"
16+
},
17+
"author": "BigCommerce",
18+
"bugs": {
19+
"url": "https://github.com/bigcommerce/script-loader-js/issues"
20+
},
21+
"homepage": "https://github.com/bigcommerce/script-loader-js",
22+
"scripts": {
23+
"prebuild": "yarn lint && yarn test",
24+
"build": "yarn compile",
25+
"precompile": "rm -rf lib",
26+
"compile": "tsc --outDir lib",
27+
"lint": "tslint src/**/*.ts --config tslint.json && tsc --noEmit",
28+
"prerelease": "git fetch --tags && yarn validate-dependencies && yarn validate-commits && yarn build",
29+
"release": "git add lib && standard-version -a",
30+
"test": "jest --config jest-config.js",
31+
"test:coverage": "yarn test -- --coverage",
32+
"test:series": "yarn test -- --runInBand",
33+
"test:watch": "yarn test -- --watch",
34+
"travis": "yarn lint && yarn test:series -- --coverage",
35+
"validate-commits": "validate-commits",
36+
"validate-dependencies": "yarn install --check-files --frozen-lockfile"
37+
},
38+
"dependencies": {
39+
"tslib": "^1.8.0"
40+
},
41+
"devDependencies": {
42+
"@types/jest": "^21.1.10",
43+
"jest": "^21.2.1",
44+
"standard-version": "^4.2.0",
45+
"ts-jest": "^21.2.3",
46+
"tslint": "^5.9.1",
47+
"typescript": "^2.7.1",
48+
"validate-commits": "git+ssh://[email protected]/bigcommerce-labs/validate-commits.git#1.1.0"
49+
}
50+
}

src/create-script-loader.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import ScriptLoader from './script-loader';
2+
3+
export default function createScriptLoader(): ScriptLoader {
4+
return new ScriptLoader(document);
5+
}

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as ScriptLoader } from './script-loader';
2+
export { default as createScriptLoader } from './create-script-loader';

0 commit comments

Comments
 (0)