Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: updates project name and references. #25

Merged
merged 5 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# GitHub Code Owners
# More info about this file can be found in the GitHub documentation:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax

# Default reviewers for all files
* @linc-technologies/frontend

# Request a review from the devops team members for CI/CD related changes
.github/ @linc-technologies/devops
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: main
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
target-branch: "main"
allow:
- dependency-type: direct
groups:
default:
exclude-patterns:
- "@ember*"
- "ember*"
- "eslint*"
patterns:
- "*"
14 changes: 14 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "PR"

on:
pull_request:
branches:
- main

jobs:
lint:
uses: linc-technologies/.github/.github/workflows/ember_lint.yml@main
secrets: inherit
with:
node_version: '14.21'
continue-on-error: false
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Release"

on:
workflow_dispatch:
push:
branches:
- main

jobs:
release:
name: "Release"
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
permissions:
checks: write
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@v4
id: release-please
with:
token: ${{ secrets.GITHUB_TOKEN }}

publish:
name: "Publish"
needs: [release]
if: ${{ needs.release.outputs.releases_created == 'true' }}
uses: linc-technologies/.github/.github/workflows/ember_publish.yml@main
secrets:
npm_token: ${{ secrets.NPM_TOKEN }}
with:
node_version: '14.21'
public: true
50 changes: 22 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,20 @@
ember-spreadsheet-export
==============================================================================
# @linc-technologies/ember-spreadsheet-export

Addon that encapsulates ability to render a data set as either excel or csv.

Forked from [roofstock/ember-cli-data-export](https://github.com/roofstock/ember-cli-data-export).
hero-david marked this conversation as resolved.
Show resolved Hide resolved


Differences from `ember-cli-data-export` include:
------------------------------------------------------------------------------

- Dependencies have been updated to address various deprecations
- The undocumented `export-selector` and `export-selector-onselect` components have been removed, in order to remove
the dependency on `ember-select-list`, which hasn't been updated in a long time
- The `csv` and `excel` services are not automatically injected
- The dummy app now has content (a couple of buttons to generate demo files)
- Multiple sheets can be added to a single XLSX file
- [v0.3.0] The `excel` service supports merging cells via an additional `merges` option
- [v0.4.0] The `csv` service supports a new `raw` option, which disables quoting and escaping of cell contents
- [v0.5.0] The `csv` service supports a new `autoQuote` option, which only quotes/escapes cells which need it
(those containing quotes, commas or newlines).
- [v0.6.0] The `excel` service accepts either a nested array or an `HTMLTableElement` as data for any sheet
- [v0.6.0] Both services can optionally return the generated blob instead of (or as well as) downloading it


Compatibility
------------------------------------------------------------------------------
## Compatibility

* Ember.js v3.20 or above
* Ember CLI v3.20 or above
* Node.js v12 or above


Installation
------------------------------------------------------------------------------
## Installation

```
ember install ember-spreadsheet-export
ember install @linc-technologies/ember-spreadsheet-export
```


## Usage

- Inject the service(s) for Excel and/or CSV formats, depending on your needs.
Expand Down Expand Up @@ -68,6 +44,7 @@ Within each, `r` is the row index and `c` is the column index.
The example above would therefore merge the first two cells in the first column.

## Examples

```javascript
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
Expand Down Expand Up @@ -113,3 +90,20 @@ export default class MyComponent extends Component {
}
}
```

## Differences from `ember-cli-data-export`

This was initially forked from [roofstock/ember-cli-data-export](https://github.com/roofstock/ember-cli-data-export).

- Dependencies have been updated to address various deprecations
- The undocumented `export-selector` and `export-selector-onselect` components have been removed, in order to remove
the dependency on `ember-select-list`, which hasn't been updated in a long time
- The `csv` and `excel` services are not automatically injected
- The dummy app now has content (a couple of buttons to generate demo files)
- Multiple sheets can be added to a single XLSX file
- [v0.3.0] The `excel` service supports merging cells via an additional `merges` option
- [v0.4.0] The `csv` service supports a new `raw` option, which disables quoting and escaping of cell contents
- [v0.5.0] The `csv` service supports a new `autoQuote` option, which only quotes/escapes cells which need it
(those containing quotes, commas or newlines).
- [v0.6.0] The `excel` service accepts either a nested array or an `HTMLTableElement` as data for any sheet
- [v0.6.0] Both services can optionally return the generated blob instead of (or as well as) downloading it
2 changes: 1 addition & 1 deletion addon/services/excel.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class ExcelService extends Service {
});

let output = new Blob([s2ab(wbout)], { type: 'application/octet-stream' });

if (options.download) {
saveAs(output, options.fileName);
}
Expand Down
5 changes: 4 additions & 1 deletion app/services/csv.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export { default, initialize } from 'ember-spreadsheet-export/services/csv';
export {
default,
initialize,
} from '@linc-technologies/ember-spreadsheet-export/services/csv';
5 changes: 4 additions & 1 deletion app/services/excel.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export { default, initialize } from 'ember-spreadsheet-export/services/excel';
export {
default,
initialize,
} from '@linc-technologies/ember-spreadsheet-export/services/excel';
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ember-spreadsheet-export",
"name": "@linc-technologies/ember-spreadsheet-export",
"version": "0.6.0",
"description": "Provides ability to export a set of json data as excel or csv file.",
"keywords": [
Expand All @@ -10,18 +10,16 @@
"csv",
"spreadsheet"
],
"repository": "https://github.com/pauln/ember-spreadsheet-export",
"repository": "https://github.com/linc-technologies/ember-spreadsheet-export",
"license": "MIT",
"author": "Matt Armstrong",
"contributors": [
"Paul Nicholls"
],
"author": "Paul Nicholls <[email protected]>",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build --environment=production",
"ci": "yarn install --ignore-engines --frozen-lockfile",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ignore engines still needed on node 14? And do we want to adjust the engines below?

Copy link
Member Author

@matthewhartstonge matthewhartstonge Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Q - For now I'm keeping it all similar across all projects, but will remove in future.
From memory there is something that causes an issue (requires newer node) ...

ember-cli-update/ember declare the engine preference, so I'm keeping it where ember believes the engines should be :)

Cheers man!

"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
Expand Down
20 changes: 13 additions & 7 deletions tests/dummy/app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export default class ApplicationController extends Controller {
}

@action downloadTableAsXLSX() {
this.excel.export(
document.querySelector('#demoTable1'),
{ sheetName: 'Table 1', fileName: 'demo-table.xlsx' }
);
this.excel.export(document.querySelector('#demoTable1'), {
sheetName: 'Table 1',
fileName: 'demo-table.xlsx',
});
}

@action downloadTablesAsXLSX() {
Expand All @@ -50,11 +50,17 @@ export default class ApplicationController extends Controller {
name: 'Table 2',
data: document.querySelector('#demoTable2'),
},
]
this.excel.export(tables, { multiSheet: true, fileName: 'demo-tables.xlsx' });
];
this.excel.export(tables, {
multiSheet: true,
fileName: 'demo-tables.xlsx',
});
}

@action downloadMultiSheetXLSX() {
this.excel.export(sheets, { multiSheet: true, fileName: 'demo-multisheet.xlsx' });
this.excel.export(sheets, {
multiSheet: true,
fileName: 'demo-multisheet.xlsx',
});
}
}
Loading