nanosplash 4.0.3 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.github/workflows/ci.all.yml +32 -0
  2. package/.github/workflows/ci.prod.pull_request.yml +54 -0
  3. package/.github/workflows/ci.prod.push.yml +68 -0
  4. package/.github/workflows/ci.test.yml +51 -43
  5. package/.github/workflows/reusable.build.yml +42 -0
  6. package/.github/workflows/reusable.format.yml +55 -0
  7. package/.github/workflows/reusable.lint.yml +30 -0
  8. package/.github/workflows/reusable.npm-publish.yml +55 -0
  9. package/.github/workflows/reusable.test.yml +50 -0
  10. package/.prettierrc +9 -10
  11. package/README.md +118 -52
  12. package/bun.lock +635 -0
  13. package/coverage/lcov-report/base.css +224 -0
  14. package/coverage/lcov-report/block-navigation.js +87 -0
  15. package/coverage/lcov-report/favicon.png +0 -0
  16. package/coverage/lcov-report/index.html +176 -0
  17. package/coverage/lcov-report/prettify.css +1 -0
  18. package/coverage/lcov-report/prettify.js +2 -0
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +196 -0
  21. package/coverage/lcov-report/src/composables/index.html +116 -0
  22. package/coverage/lcov-report/src/composables/ns.ts.html +547 -0
  23. package/coverage/lcov-report/src/constants/index.html +116 -0
  24. package/coverage/lcov-report/src/constants/ns.ts.html +124 -0
  25. package/coverage/lcov-report/src/iife.ts.html +100 -0
  26. package/coverage/lcov-report/src/index.html +116 -0
  27. package/coverage/lcov-report/src/interfaces/INSElement.ts.html +100 -0
  28. package/coverage/lcov-report/src/interfaces/INanosplash.ts.html +304 -0
  29. package/coverage/lcov-report/src/interfaces/index.html +131 -0
  30. package/coverage/lcov-report/src/utils/dom-utils.ts.html +289 -0
  31. package/coverage/lcov-report/src/utils/index.html +116 -0
  32. package/coverage/lcov.info +271 -0
  33. package/dist/cjs/ns.cjs.js +135 -0
  34. package/dist/es/ns.es.js +197 -0
  35. package/dist/iife/ns.iife.js +135 -0
  36. package/eslint.config.js +7 -2
  37. package/package.json +72 -90
  38. package/src/composables/ns.ts +154 -0
  39. package/src/constants/ns.ts +13 -0
  40. package/src/iife.ts +5 -0
  41. package/src/interfaces/INSElement.ts +5 -0
  42. package/src/interfaces/INanosplash.ts +73 -0
  43. package/src/style/ns.css +134 -0
  44. package/src/types/dom.d.ts +3 -0
  45. package/src/types/generic/function.d.ts +1 -0
  46. package/src/types/global.d.ts +26 -0
  47. package/src/types/semantic/number.d.ts +1 -0
  48. package/src/types/semantic/string.d.ts +2 -0
  49. package/src/utils/dom-utils.ts +68 -0
  50. package/tests/ns.spec.ts +123 -0
  51. package/tsconfig.json +29 -21
  52. package/vite.config.ts +16 -25
  53. package/vitest.config.ts +20 -0
  54. package/.env +0 -1
  55. package/.github/workflows/ci.prod.yml +0 -59
  56. package/.github/workflows/vitepress.prod.yml +0 -69
  57. package/LICENSE +0 -21
  58. package/docs/.vitepress/config.ts +0 -78
  59. package/docs/.vitepress/theme/css/style.css +0 -258
  60. package/docs/.vitepress/theme/index.ts +0 -16
  61. package/docs/.vitepress/theme/vue/Card.vue +0 -31
  62. package/docs/.vitepress/theme/vue/CardGrid.vue +0 -17
  63. package/docs/.vitepress/theme/vue/PlayGround.vue +0 -36
  64. package/docs/api/doc/hide.md +0 -48
  65. package/docs/api/doc/show.md +0 -46
  66. package/docs/api/start/customize.md +0 -30
  67. package/docs/api/start/features.md +0 -17
  68. package/docs/api/start/install.md +0 -61
  69. package/docs/api/start/playground.md +0 -16
  70. package/docs/api/start/usage.md +0 -22
  71. package/docs/index.md +0 -33
  72. package/docs/public/macos.jpg +0 -0
  73. package/src/style/ns.sass +0 -120
  74. package/src/ts/Nanosplash.ts +0 -176
  75. package/src/ts/main.ts +0 -5
  76. package/src/ts/types/NanosplashInterface.ts +0 -29
  77. package/src/ts/types/Types.ts +0 -16
  78. package/src/ts/types/global.d.ts +0 -14
  79. package/tests/Nanosplash.spec.ts +0 -207
@@ -0,0 +1,32 @@
1
+ name: CI General (non-persistent)
2
+
3
+ on:
4
+ push:
5
+ branches-ignore:
6
+ - production
7
+ - test
8
+ pull_request:
9
+ branches-ignore:
10
+ - production
11
+ - test
12
+
13
+ jobs:
14
+ call-test-non-persistent:
15
+ name: Running Test (non-persistent)
16
+ uses: './.github/workflows/reusable.test.yml'
17
+ with:
18
+ persistent: false
19
+
20
+ call-lint-non-persistent:
21
+ needs: call-test-non-persistent
22
+ name: Running Linting (non-persistent)
23
+ uses: './.github/workflows/reusable.lint.yml'
24
+ with:
25
+ run-linting: true
26
+
27
+ call-build-non-persistent:
28
+ needs: call-lint-non-persistent
29
+ name: Running build (non-persistent)
30
+ uses: './.github/workflows/reusable.build.yml'
31
+ with:
32
+ persistent: false
@@ -0,0 +1,54 @@
1
+ name: CI Prepare for Production
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ production ]
6
+
7
+ jobs:
8
+ call-lint-non-persistent:
9
+ name: Lint (non-persistent)
10
+ uses: './.github/workflows/reusable.lint.yml'
11
+ with:
12
+ run-linting: true
13
+
14
+ call-format-non-persistent:
15
+ needs: call-lint-non-persistent
16
+ name: Format (non-persistent)
17
+ uses: './.github/workflows/reusable.format.yml'
18
+ with:
19
+ persistent: false
20
+
21
+ call-test-non-persistent:
22
+ needs: call-format-non-persistent
23
+ name: Test (non-persistent)
24
+ uses: './.github/workflows/reusable.test.yml'
25
+ with:
26
+ persistent: false
27
+
28
+ call-build-non-persistent:
29
+ needs: call-test-non-persistent
30
+ name: Build (non-persistent)
31
+ uses: './.github/workflows/reusable.build.yml'
32
+ with:
33
+ persistent: false
34
+
35
+ call-npm-publish-non-persistent:
36
+ needs: call-build-non-persistent
37
+ name: NPM Publish Dry-Run (non-persistent)
38
+ uses: './.github/workflows/reusable.npm-publish.yml'
39
+ with:
40
+ persistent: false
41
+
42
+ call-format:
43
+ needs: call-npm-publish-non-persistent
44
+ name: Format
45
+ uses: './.github/workflows/reusable.format.yml'
46
+ with:
47
+ persistent: true
48
+
49
+ call-build:
50
+ needs: call-format
51
+ name: Build
52
+ uses: './.github/workflows/reusable.build.yml'
53
+ with:
54
+ persistent: true
@@ -0,0 +1,68 @@
1
+ name: CI Production & Publish
2
+
3
+ on:
4
+ push:
5
+ branches: [ production ]
6
+
7
+ jobs:
8
+ call-lint-non-persistent:
9
+ name: Lint (non-persistent)
10
+ uses: './.github/workflows/reusable.lint.yml'
11
+ with:
12
+ run-linting: true
13
+
14
+ call-format-non-persistent:
15
+ needs: call-lint-non-persistent
16
+ name: Format (non-persistent)
17
+ uses: './.github/workflows/reusable.format.yml'
18
+ with:
19
+ persistent: false
20
+
21
+ call-test-non-persistent:
22
+ needs: call-format-non-persistent
23
+ name: Test (non-persistent)
24
+ uses: './.github/workflows/reusable.test.yml'
25
+ with:
26
+ persistent: false
27
+
28
+ call-build-non-persistent:
29
+ needs: call-test-non-persistent
30
+ name: Build (non-persistent)
31
+ uses: './.github/workflows/reusable.build.yml'
32
+ with:
33
+ persistent: false
34
+
35
+ call-npm-publish-dryrun:
36
+ needs: call-build-non-persistent
37
+ name: NPM Publish Dry-Run (non-persistent)
38
+ uses: './.github/workflows/reusable.npm-publish.yml'
39
+ with:
40
+ persistent: false
41
+
42
+ call-format:
43
+ needs: call-npm-publish-dryrun
44
+ name: Format
45
+ uses: './.github/workflows/reusable.format.yml'
46
+ with:
47
+ persistent: true
48
+
49
+ call-test-and-coverage:
50
+ needs: call-format
51
+ name: Test & Coverage
52
+ uses: './.github/workflows/reusable.test.yml'
53
+ with:
54
+ persistent: true
55
+
56
+ call-build:
57
+ needs: call-test-and-coverage
58
+ name: Build
59
+ uses: './.github/workflows/reusable.build.yml'
60
+ with:
61
+ persistent: true
62
+
63
+ call-npm-publish:
64
+ needs: call-build
65
+ name: NPM Publish
66
+ uses: './.github/workflows/reusable.npm-publish.yml'
67
+ with:
68
+ persistent: true
@@ -1,48 +1,56 @@
1
- name: CI Test - Build, Test
1
+ name: CI Test
2
2
 
3
3
  on:
4
+ push:
5
+ branches: [ test ]
4
6
  pull_request:
5
- branches:
6
- - test
7
+ branches: [ test ]
7
8
 
8
9
  jobs:
9
- build-and-test:
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - name: Install Node.js
14
- uses: actions/setup-node@v3
15
- with:
16
- node-version: 20
17
- registry-url: 'https://registry.npmjs.org'
18
-
19
- - name: Install PNPM
20
- uses: pnpm/action-setup@v3
21
- with:
22
- version: 8
23
-
24
- - name: Checkout
25
- uses: actions/checkout@v3
26
-
27
- - name: Set up Git and update production branch
28
- run: |
29
- git config --global user.name "GitHub Actions"
30
- git config --global user.email "actions@github.com"
31
- git fetch
32
- git checkout test
33
- git pull --no-rebase
34
-
35
- - name: Setup GitHub Pages
36
- uses: actions/configure-pages@v3
37
-
38
- - name: Install dependencies
39
- run: pnpm install --no-frozen-lockfile
40
-
41
- - name: Build
42
- run: pnpm build
43
-
44
- - name: Test
45
- run: pnpm test
46
-
47
- - name: Generate Code Coverage
48
- run: pnpm coverage
10
+ call-lint-non-persistent:
11
+ name: Lint (non-persistent)
12
+ uses: './.github/workflows/reusable.lint.yml'
13
+ with:
14
+ run-linting: true
15
+
16
+ call-format-non-persistent:
17
+ needs: call-lint-non-persistent
18
+ name: Format (non-persistent)
19
+ uses: './.github/workflows/reusable.format.yml'
20
+ with:
21
+ persistent: false
22
+
23
+ call-test-non-persistent:
24
+ needs: call-format-non-persistent
25
+ name: Test (non-persistent)
26
+ uses: './.github/workflows/reusable.test.yml'
27
+ with:
28
+ persistent: false
29
+
30
+ call-build-non-persistent:
31
+ needs: call-test-non-persistent
32
+ name: Build (non-persistent)
33
+ uses: './.github/workflows/reusable.build.yml'
34
+ with:
35
+ persistent: false
36
+
37
+ call-npm-publish-non-persistent:
38
+ needs: call-build-non-persistent
39
+ name: NPM Publish Dry-Run (non-persistent)
40
+ uses: './.github/workflows/reusable.npm-publish.yml'
41
+ with:
42
+ persistent: false
43
+
44
+ call-format:
45
+ needs: call-npm-publish-non-persistent
46
+ name: Format
47
+ uses: './.github/workflows/reusable.format.yml'
48
+ with:
49
+ persistent: true
50
+
51
+ call-build:
52
+ needs: call-format
53
+ name: Build
54
+ uses: './.github/workflows/reusable.build.yml'
55
+ with:
56
+ persistent: true
@@ -0,0 +1,42 @@
1
+ name: Reusable - Build
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ persistent:
7
+ required: true
8
+ type: boolean
9
+
10
+ jobs:
11
+ run-vite-build:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ # Checking out the repository with the latest version
16
+ - uses: actions/checkout@v4
17
+
18
+ # Setting up the latest Bun.js version
19
+ - name: Set up Bun.js
20
+ uses: oven-sh/setup-bun@v2
21
+ with:
22
+ bun-version: 'latest'
23
+
24
+ # Installing dependencies using Bun
25
+ - name: Install Dependencies
26
+ run: bun install
27
+
28
+ # Running Vite Build
29
+ - name: Run Vite Build
30
+ run: bun run build
31
+
32
+ # Committing built files to the current branch
33
+ - name: Commit Built Files
34
+ if: ${{ inputs.persist }}
35
+ run: |
36
+ git config --global user.name "GitHub Actions"
37
+ git config --global user.email "actions@github.com"
38
+ git add .
39
+ git commit -m "GitHub Actions: Build" --allow-empty
40
+ git push
41
+ env:
42
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,55 @@
1
+ name: Reusable - Prettier Formatting
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ persistent:
7
+ required: true
8
+ type: boolean
9
+
10
+ jobs:
11
+ run-prettier:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ # Checking out the repository with the latest version
16
+ - uses: actions/checkout@v4
17
+
18
+ # Setting up the latest Bun.js version
19
+ - name: Set up Bun.js
20
+ uses: oven-sh/setup-bun@v2
21
+ with:
22
+ bun-version: 'latest'
23
+
24
+ # Installing dependencies using Bun
25
+ - name: Install Dependencies
26
+ run: bun install
27
+
28
+ # Running Prettier using Bun
29
+ - name: Run Prettier Format
30
+ run: bun run format
31
+
32
+ # Committing formatted files to the current branch
33
+ - name: Commit Formatted Files
34
+ if: ${{ inputs.persistent }}
35
+ run: |
36
+ git config --global user.name "GitHub Actions"
37
+ git config --global user.email "actions@github.com"
38
+
39
+ # Stage all changes
40
+ git add .
41
+
42
+ # Check if there are any staged changes
43
+ if ! git diff --cached --quiet; then
44
+ echo "There are changes to commit and push."
45
+
46
+ # Commit the changes
47
+ git commit -m "GitHub Actions: Format using Prettier"
48
+
49
+ # Push to the current branch
50
+ git push
51
+ else
52
+ echo "No changes to commit."
53
+ fi
54
+ env:
55
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,30 @@
1
+ name: Reusable - ESLint (non-persistent)
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ run-linting:
7
+ required: true
8
+ type: boolean
9
+
10
+ jobs:
11
+ run-eslint:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ # Checking out the repository with the latest version
16
+ - uses: actions/checkout@v4
17
+
18
+ # Setting up the latest Bun.js version
19
+ - name: Set up Bun.js
20
+ uses: oven-sh/setup-bun@v2
21
+ with:
22
+ bun-version: 'latest'
23
+
24
+ # Installing dependencies using Bun
25
+ - name: Install Dependencies
26
+ run: bun install
27
+
28
+ # Running Vitest with coverage using Bun
29
+ - name: Run ESLint
30
+ run: bun run lint
@@ -0,0 +1,55 @@
1
+ name: Reusable - NPM Publish
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ persistent:
7
+ required: true
8
+ type: boolean
9
+
10
+ jobs:
11
+ npm-publish:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ # Checking out the repository with the latest version
16
+ - uses: actions/checkout@v4
17
+
18
+ # Setting up the latest Node.js version
19
+ - name: Set up Node.js
20
+ uses: actions/setup-node@v4
21
+ with:
22
+ node-version: 'latest'
23
+ registry-url: 'https://registry.npmjs.org' # Specify NPM registry
24
+
25
+ # Get the version inside package.json
26
+ - name: Get version from package.json
27
+ id: get-version
28
+ run: |
29
+ VERSION=$(node -p "require('./package.json').version")
30
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
31
+
32
+ # Publishing to NPM (dry-run for testing purposes)
33
+ - name: Publish to NPM (dry-run)
34
+ run: npm publish --dry-run
35
+ env:
36
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
37
+
38
+ # Commit the version tag made by NPM
39
+ - name: Commit version tag
40
+ if: ${{ inputs.persist }}
41
+ run: |
42
+ git config --global user.name "GitHub Actions"
43
+ git config --global user.email "actions@github.com"
44
+ git add .
45
+ git commit -m "GitHub Actions: NPM build ${{ env.VERSION }}" --allow-empty
46
+ git push origin HEAD:$GITHUB_REF_NAME
47
+ env:
48
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
+
50
+ - name: Configure npm for authentication
51
+ run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISH_TOKEN }}" > ~/.npmrc
52
+
53
+ - name: Publish to NPM
54
+ if: ${{ inputs.persistent }}
55
+ run: npm publish
@@ -0,0 +1,50 @@
1
+ name: Reusable - Run Tests
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ persistent:
7
+ required: true
8
+ type: boolean
9
+
10
+ jobs:
11
+ run-vitest:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ # Checking out the repository with the latest version
16
+ - uses: actions/checkout@v4
17
+
18
+ # Setting up the latest Bun.js version
19
+ - name: Set up Bun.js
20
+ uses: oven-sh/setup-bun@v2
21
+ with:
22
+ bun-version: 'latest'
23
+
24
+ # Installing dependencies using Bun
25
+ - name: Install Dependencies
26
+ run: bun install
27
+
28
+ # Running Vitest with coverage using Bun
29
+ - name: Run Vitest
30
+ run: bunx vitest
31
+
32
+ # Committing coverage artifacts to the current branch
33
+ - name: Commit Build
34
+ if: ${{ inputs.persistent }}
35
+ run: |
36
+ git config --global user.name "GitHub Actions"
37
+ git config --global user.email "actions@github.com"
38
+ git add .
39
+ git commit -m "GitHub Actions: Create Test Coverage" --allow-empty
40
+ git push
41
+ env:
42
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43
+
44
+ # Uploading coverage to Coveralls
45
+ - name: Upload Coverage to Coveralls
46
+ if: ${{ inputs.persistent }}
47
+ uses: coverallsapp/github-action@v2
48
+ with:
49
+ github-token: ${{ secrets.GITHUB_TOKEN }}
50
+ path-to-lcov: ./coverage/lcov.info
package/.prettierrc CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
- "tabWidth": 2,
3
- "useTabs": true,
4
- "singleQuote": true,
5
- "bracketSpacing": true,
6
- "jsxSingleQuote": true,
7
- "endOfLine": "lf",
8
- "trailingComma": "es5",
9
- "arrowParens": "avoid",
10
- "semi": false,
11
- "printWidth": 80
2
+ "tabWidth": 2,
3
+ "singleQuote": true,
4
+ "bracketSpacing": true,
5
+ "jsxSingleQuote": true,
6
+ "endOfLine": "lf",
7
+ "trailingComma": "es5",
8
+ "arrowParens": "avoid",
9
+ "semi": false,
10
+ "printWidth": 80
12
11
  }