Skip to content

Commit

Permalink
Merge pull request #65 from shgysk8zer0/feature/node
Browse files Browse the repository at this point in the history
Create node bundle of polyfills
  • Loading branch information
shgysk8zer0 authored Aug 18, 2024
2 parents a59a30b + fa8d527 commit 9828437
Show file tree
Hide file tree
Showing 18 changed files with 1,135 additions and 233 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/webpack.config.js
/polyfills/
*.min.js
assets/dedent.js
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"Sanitizer": "readonly",
"Record": "readonly",
"Tuple": "readonly",
"ToggleEvent": "readonly"
"ToggleEvent": "readonly",
"scheduler": "readonly",
"Iterator": "readonly",
"AggregateError": "readonly"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --no-fund
run: npm ci --no-audit --no-fund
- name: Run npm test
run: npm test --if-present
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: npm
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --fund-no
run: npm ci --no-audit --fund-no
- name: Run tests
run: npm test
- name: Build Package
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Logs
logs
*.log
*.bak
*.min.js
*.min.js.map
*.cjs
*.mjs
!assets/dedent.cjs
assets/dedent.js
.bak
.DS_STORE
npm-debug.log*
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
test/
.github/
assets/dedent.cjs
.editorconfig
.eslintignore
.eslintrc.json
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.4.0] - 2024-08-19

### Added
- Add node version of polyfills (`node.js` and `node.min.js`)
- Add some automated tests (`test/node.js`)

### Changed
- Create local module from `string-dedent` instead of having as a dependency
- Update `rollup.config.js` to create all needed bundles

## [v0.3.14] - 2024-07-16

### Fixed
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can use a CDN to access the library. Add the following script tag to your
HTML file to load the latest version:

```html
<script src="https://unpkg.com/@shgysk8zer0/polyfills/all.min.js"></script>
<script src="https://unpkg.com/@shgysk8zer0/polyfills[@version]/all.min.js"></script>
```

#### With version and SRI
Expand All @@ -57,6 +57,10 @@ the following command to install the library:
```bash
npm install @shgysk8zer0/polyfills
```
> [!Note]
> If using this polyfills package in a node environment, you want to use `node.js` instead
> of `all.js`. The node version omits polyfills that do not make sense in NodeJS, such as DOM.
> Simply using `import '@shgysk8zer0/polyfills'` or `require('@shgysk8zer0/polyfills')` should work.
### Git Submodule

Expand Down
Loading

0 comments on commit 9828437

Please sign in to comment.