Skip to content

Commit 2905dca

Browse files
committed
Initial commit
0 parents  commit 2905dca

26 files changed

+3693
-0
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[Makefile]
13+
indent_style = tab
14+
indent_size = 2
15+
end_of_line = lf
16+
charset = utf-8
17+
trim_trailing_whitespace = true
18+
insert_final_newline = true

.eslintrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends: standard

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
.nyc_output
3+
.eslintcache
4+
.tslintcache
5+
coverage
6+
dist/*.js
7+
dist/*.mjs
8+
dist/*.map
9+
node_modules
10+
npm-debug.log
11+
test/typings.js

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: node_js
2+
node_js:
3+
- node
4+
- lts/*
5+
- 10
6+
cache:
7+
npm: false
8+
directories:
9+
- "~/.pnpm-store"
10+
before_install:
11+
- curl -L https://unpkg.com/@pnpm/self-installer | node
12+
- pnpm config set store-dir ~/.pnpm-store
13+
install:
14+
- make prepare
15+
script:
16+
- make test
17+
after_success:
18+
- pnpm i -g codecov semantic-release
19+
- codecov
20+
- semantic-release
21+
branches:
22+
except:
23+
- /^v\d+\.\d+\.\d+$/
24+
notifications:
25+
email: false

.tslintrc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: standard-with-typescript
2+
plugins:
3+
- '@typescript-eslint'
4+
parser: '@typescript-eslint/parser'
5+
parserOptions:
6+
project: tsconfig.json
7+
rules:
8+
'@typescript-eslint/camelcase': off
9+
'@typescript-eslint/naming-convention': error

.vscode/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"files.exclude": {
3+
"**/.git": true,
4+
"**/.DS_Store": true,
5+
"**/.nyc_output": true,
6+
"**/.eslintcache": true,
7+
"**/.tslintcache": true,
8+
"**/coverage": true,
9+
"**/dist/*.min.js": true,
10+
"**/dist/*.map": true,
11+
"**/pnpm-lock.yaml": true
12+
},
13+
"search.exclude": {
14+
"**/node_modules": true,
15+
"**/dist/*.js": true,
16+
"**/dist/*.mjs": true,
17+
"**/test/typings.js": true
18+
}
19+
}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## 0.0.1 (2020-06-01)
2+
3+
Initial release.
4+
5+
Functions:
6+
7+
* createDetachedBrowser
8+
* detachWindowHistory
9+
* detachBackboneHistory
10+
11+
Objects:
12+
13+
* Browser (Window)
14+
* Location
15+
* History
16+
* Document

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Ferdinand Prantl
4+
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:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
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.

Makefile

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
npmbin=./node_modules/.bin
2+
esbuild=$(npmbin)/esbuild
3+
eslint=$(npmbin)/eslint
4+
tsc=$(npmbin)/tsc
5+
nyc=$(npmbin)/nyc
6+
7+
commonopts=--outfile=$@ --log-level=warning --bundle
8+
sourcemaps=--sourcemap --sourcemap=external
9+
nodeopts=--format=cjs --platform=node
10+
browseropts=--format=iife $(sourcemaps)
11+
moduleopts=--format=esm $(sourcemaps)
12+
13+
lintany=--cache
14+
lintjs=$(lintany) --ext=.js --ignore-pattern=test/typings.js lib test
15+
lintts=$(lintany) --ext=.ts --cache-location .tslintcache -c .tslintrc.yml dist test
16+
17+
prepare ::
18+
@echo "> $@"
19+
@pnpm i ‑‑frozen‑lockfile --no-verify-store-integrity
20+
21+
all: dist/index.mjs dist/index.min.mjs dist/index.cjs.js \
22+
dist/index.iife.js dist/index.iife.min.js \
23+
dist/detached-browser.mjs dist/detached-browser.min.mjs dist/detached-browser.cjs.js \
24+
dist/detached-browser.iife.js dist/detached-browser.iife.min.js \
25+
dist/detach-window.mjs dist/detach-window.min.mjs dist/detach-window.cjs.js \
26+
dist/detach-window.iife.js dist/detach-window.iife.min.js \
27+
dist/detach-backbone.mjs dist/detach-backbone.min.mjs dist/detach-backbone.cjs.js \
28+
dist/detach-backbone.iife.js dist/detach-backbone.iife.min.js
29+
30+
lint ::
31+
@echo "> $@"
32+
@$(eslint) $(lintjs)
33+
@$(eslint) $(lintts)
34+
35+
fix ::
36+
@echo "> $@"
37+
@$(eslint) --fix $(lintjs)
38+
@$(eslint) --fix $(lintts)
39+
40+
all-test :: all test/typings.js
41+
42+
test :: all-test
43+
@echo "> $@"
44+
@node -r esm test/detached-browser
45+
@node -r esm test/detach-window
46+
@node -r esm test/detach-backbone
47+
@node -r esm test/typings
48+
49+
coverage :: all-test
50+
@echo "> $@"
51+
@$(nyc) -c -s node -r esm test/detached-browser
52+
@$(nyc) -c -s --no-clean node -r esm test/detach-window
53+
@$(nyc) -c -s --no-clean node -r esm test/detach-backbone
54+
@$(nyc) report
55+
@$(nyc) check-coverage
56+
57+
clean ::
58+
@echo "> $@"
59+
@rm -f dist/*.js dist/*.mjs dist/*.map test/typings.js
60+
61+
new :: clean fix coverage
62+
63+
upgrade ::
64+
@echo "> $@"
65+
@cp package.json package.json.orig
66+
@ncu -u
67+
@diff -q package.json package.json.orig && rm package.json.orig \
68+
|| (rm package.json.orig && pnpm i && make new)
69+
70+
dist/index.mjs: lib/index.js lib/detached-browser.js lib/event-emitter.js \
71+
lib/detach-window.js lib/detach-backbone.js
72+
@echo "> $@"
73+
@$(esbuild) $(commonopts) $(moduleopts) $<
74+
75+
dist/index.min.mjs: lib/index.js lib/detached-browser.js lib/event-emitter.js \
76+
lib/detach-window.js lib/detach-backbone.js
77+
@echo "> $@"
78+
@$(esbuild) $(commonopts) $(moduleopts) --minify $<
79+
80+
dist/index.cjs.js: lib/index.js lib/detached-browser.js lib/event-emitter.js \
81+
lib/detach-window.js lib/detach-backbone.js
82+
@echo "> $@"
83+
@$(esbuild) $(commonopts) $(nodeopts) $<
84+
85+
dist/index.iife.js: lib/index.js lib/detached-browser.js lib/event-emitter.js \
86+
lib/detach-window.js lib/detach-backbone.js
87+
@echo "> $@"
88+
@$(esbuild) $(commonopts) $(browseropts) --name=detachedNavigation $<
89+
90+
dist/index.iife.min.js: lib/index.js lib/detached-browser.js lib/event-emitter.js \
91+
lib/detach-window.js lib/detach-backbone.js
92+
@echo "> $@"
93+
@$(esbuild) $(commonopts) $(browseropts) --minify --name=detachedNavigation $<
94+
95+
dist/detached-browser.mjs: lib/detached-browser.js lib/event-emitter.js
96+
@echo "> $@"
97+
@$(esbuild) $(commonopts) $(moduleopts) $<
98+
99+
dist/detached-browser.min.mjs: lib/detached-browser.js lib/event-emitter.js
100+
@echo "> $@"
101+
@$(esbuild) $(commonopts) $(moduleopts) --minify $<
102+
103+
dist/detached-browser.cjs.js: lib/detached-browser.js lib/event-emitter.js
104+
@echo "> $@"
105+
@$(esbuild) $(commonopts) $(nodeopts) $<
106+
107+
dist/detached-browser.iife.js: lib/detached-browser.js lib/event-emitter.js
108+
@echo "> $@"
109+
@$(esbuild) $(commonopts) $(browseropts) --name=createDetachedBrowser $<
110+
111+
dist/detached-browser.iife.min.js: lib/detached-browser.js lib/event-emitter.js
112+
@echo "> $@"
113+
@$(esbuild) $(commonopts) $(browseropts) --minify --name=createDetachedBrowser $<
114+
115+
dist/detach-window.mjs: lib/detach-window.js
116+
@echo "> $@"
117+
@$(esbuild) $(commonopts) $(moduleopts) $<
118+
119+
dist/detach-window.min.mjs: lib/detach-window.js
120+
@echo "> $@"
121+
@$(esbuild) $(commonopts) $(moduleopts) --minify $<
122+
123+
dist/detach-window.cjs.js: lib/detach-window.js
124+
@echo "> $@"
125+
@$(esbuild) $(commonopts) $(nodeopts) $<
126+
127+
dist/detach-window.iife.js: lib/detach-window.js
128+
@echo "> $@"
129+
@$(esbuild) $(commonopts) $(browseropts) --name=detachWindowHistory $<
130+
131+
dist/detach-window.iife.min.js: lib/detach-window.js
132+
@echo "> $@"
133+
@$(esbuild) $(commonopts) $(browseropts) --minify --name=detachWindowHistory $<
134+
135+
dist/detach-backbone.mjs: lib/detach-backbone.js
136+
@echo "> $@"
137+
@$(esbuild) $(commonopts) $(moduleopts) $<
138+
139+
dist/detach-backbone.min.mjs: lib/detach-backbone.js
140+
@echo "> $@"
141+
@$(esbuild) $(commonopts) $(moduleopts) --minify $<
142+
143+
dist/detach-backbone.cjs.js: lib/detach-backbone.js
144+
@echo "> $@"
145+
@$(esbuild) $(commonopts) $(nodeopts) $<
146+
147+
dist/detach-backbone.iife.js: lib/detach-backbone.js
148+
@echo "> $@"
149+
@$(esbuild) $(commonopts) $(browseropts) --name=detachBackboneHistory $<
150+
151+
dist/detach-backbone.iife.min.js: lib/detach-backbone.js
152+
@echo "> $@"
153+
@$(esbuild) $(commonopts) $(browseropts) --minify --name=detachBackboneHistory $<
154+
155+
test/typings.js: test/typings.ts
156+
@echo "> $@"
157+
@$(tsc) --target es2015 $<

0 commit comments

Comments
 (0)