-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1f5dceb
Showing
27 changed files
with
4,269 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": ["../scripts/changelog-github-custom.js", { "repo": "svitejs/svelte-preprocess-svg" }], | ||
"commit": false, | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = tab | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
|
||
[package.json] | ||
indent_style = space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:node/recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'prettier' | ||
], | ||
globals: { | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly' | ||
}, | ||
plugins: ['@typescript-eslint', 'svelte3', 'html', 'markdown'], | ||
settings: { | ||
'svelte3/typescript': require('typescript'), | ||
'svelte3/ignore-styles': (attrs) => | ||
(attrs.type && attrs.type !== 'text/css') || (attrs.lang && attrs.lang !== 'css') | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2020 | ||
}, | ||
rules: { | ||
'no-console': 'off', | ||
'no-debugger': 'error', | ||
'node/no-deprecated-api': 'off', | ||
'node/no-unpublished-import': 'off', | ||
'node/no-unpublished-require': 'off', | ||
'node/no-unsupported-features/es-syntax': 'off', | ||
'no-process-exit': 'off', | ||
'node/no-missing-import': [ | ||
'error', | ||
{ | ||
tryExtensions: ['.js', '.ts', '.json', '.node'] | ||
} | ||
] | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.svelte'], | ||
env: { | ||
es6: true, | ||
browser: true, | ||
node: false | ||
}, | ||
processor: 'svelte3/svelte3', | ||
rules: { | ||
'import/first': 'off', | ||
'import/no-duplicates': 'off', | ||
'import/no-mutable-exports': 'off', | ||
'import/no-unresolved': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['**/*.svx', '**/*.md'], | ||
processor: 'markdown/markdown', | ||
rules: { | ||
'no-undef': 'off', | ||
'no-unused-vars': 'off', | ||
'no-unused-labels': 'off', | ||
'no-console': 'off', | ||
'padded-blocks': 'off', | ||
'node/no-missing-import': 'off', | ||
'node/no-extraneous-require': 'off', | ||
'import/no-unresolved': 'off', | ||
'node/no-missing-require': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['**/*.svx/*.**', '**/*.md/*.**'], | ||
rules: { | ||
'no-undef': 'off', | ||
'no-unused-vars': 'off', | ||
'no-unused-labels': 'off', | ||
'no-console': 'off', | ||
'padded-blocks': 'off', | ||
'node/no-missing-import': 'off', | ||
'node/no-extraneous-require': 'off', | ||
'import/no-unresolved': 'off', | ||
'node/no-missing-require': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['scripts/**'], | ||
env: { | ||
node: true, | ||
browser: false | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# open_collective: <name of collective> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "\U0001F41E Bug report" | ||
description: Report an issue with svelte-preprocess-svg | ||
labels: ["bug", "triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thank you for participating in svelte-preprocess-svg! Please check for existing reports before creating a new one. | ||
- type: textarea | ||
id: bug-description | ||
attributes: | ||
label: Describe the bug | ||
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks! | ||
placeholder: Bug description | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduction | ||
attributes: | ||
label: Reproduction | ||
description: Please provide a link to a repo and step by step instructions to reproduce the problem you ran into. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be closed when no reproduction is provided within a reasonable time-frame. | ||
placeholder: Reproduction | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Logs | ||
description: "Please include relevant logs for the issue, eg browser console or terminal output. No screenshots." | ||
render: shell | ||
- type: textarea | ||
id: system-info | ||
attributes: | ||
label: System Info | ||
description: Output of `npx envinfo --system --binaries --browsers --npmPackages "{@svitejs/svelte-preprocess-svg}"` | ||
render: shell | ||
placeholder: System, Binaries, Browsers | ||
validations: | ||
required: true | ||
- type: dropdown | ||
id: severity | ||
attributes: | ||
label: Severity | ||
description: Select the severity of this issue | ||
options: | ||
- annoyance | ||
- blocking an upgrade | ||
- blocking all usage of svelte-preprocess-svg | ||
validations: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: GitHub Community | ||
url: https://github.com/svitejs/svelte-preprocess-svg/discussions | ||
about: Please ask and answer questions here. | ||
# - name: Discord | ||
# url: https://discord.gg/nzgMZJD | ||
# about: If you want to chat, join our discord. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "\U0001F680 Feature Request" | ||
description: Request a new svelte-preprocess-svg feature | ||
labels: [enhancement, triage] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to request this feature! Please check if a similar request already exists before opening a new one. | ||
- type: textarea | ||
id: problem | ||
attributes: | ||
label: Describe the problem | ||
description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better. | ||
placeholder: "I'm always frustrated when..." | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: solution | ||
attributes: | ||
label: Describe the proposed solution | ||
description: Please provide a clear and concise description of what you would like to happen. | ||
placeholder: I would like to see... | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: alternatives | ||
attributes: | ||
label: Alternatives considered | ||
description: "Please provide a clear and concise description of any alternative solutions or features you've considered." | ||
validations: | ||
required: true | ||
- type: dropdown | ||
id: importance | ||
attributes: | ||
label: Importance | ||
description: How important is this feature to you? | ||
options: | ||
- nice to have | ||
- would make my life easier | ||
- i cannot use svelte-preprocess-svg without it | ||
validations: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# build and test on linux, windows, mac with node 12, 14, 16 | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# "checks" job runs on linux + node14 only and checks that install, build, lint and audit work | ||
# it also primes the pnpm store cache for linux, important for downstream tests | ||
checks: | ||
timeout-minutes: 5 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# pseudo-matrix for convenience, NEVER use more than a single combination | ||
node: [14] | ||
os: [ubuntu-latest] | ||
outputs: | ||
build_successful: ${{ steps.build.outcome == 'success' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm i -g pnpm@6 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
cache-dependency-path: '**/pnpm-lock.yaml' | ||
- name: install | ||
run: | | ||
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts | ||
- name: build | ||
id: build | ||
run: pnpm run build | ||
- name: lint | ||
if: (${{ success() }} || ${{ failure() }}) | ||
run: pnpm run lint | ||
- name: audit | ||
if: (${{ success() }} || ${{ failure() }}) | ||
run: pnpm audit | ||
|
||
# this is the test matrix, it runs with node14 on linux,windows,macos + node12,16 on linux | ||
# it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail) | ||
test: | ||
needs: checks | ||
if: (${{ success() }} || ${{ failure() }}) && (${{ needs.checks.output.build_successful }}) | ||
timeout-minutes: 10 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [14] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
include: | ||
- node: 12 | ||
os: ubuntu-latest | ||
- node: 16 | ||
os: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm i -g pnpm@6 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
cache-dependency-path: '**/pnpm-lock.yaml' | ||
- name: install | ||
run: | | ||
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts | ||
- name: build | ||
run: pnpm run build | ||
- name: run tests | ||
run: pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
# prevents this action from running on forks | ||
if: github.repository == 'svitejs/svelte-preprocess-svg' | ||
name: Release | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# pseudo-matrix for convenience, NEVER use more than a single combination | ||
node: [14] | ||
os: [ubuntu-latest] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm i -g pnpm@6 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
cache-dependency-path: '**/pnpm-lock.yaml' | ||
- name: install | ||
run: | | ||
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts | ||
- name: Creating .npmrc | ||
run: | | ||
cat << EOF > "$HOME/.npmrc" | ||
//registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
EOF | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@master | ||
with: | ||
# This expects you to have a script called release which does a build for your packages and calls changeset publish | ||
publish: pnpm release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# TODO alert discord | ||
# - name: Send a Slack notification if a publish happens | ||
# if: steps.changesets.outputs.published == 'true' | ||
# # You can do something when a publish happens. | ||
# run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# logs and temp | ||
*.log | ||
*.cpuprofile | ||
temp | ||
*.tmp | ||
|
||
# build and dist | ||
build | ||
dist | ||
.svelte | ||
.svelte-kit | ||
|
||
# env and local | ||
*.local | ||
.env | ||
|
||
# node_modules and pnpm | ||
node_modules | ||
pnpm-lock.yaml | ||
!/pnpm-lock.yaml | ||
.pnpm-store | ||
|
||
# ide | ||
.idea | ||
.vscode | ||
|
||
# macos | ||
.DS_Store | ||
._.DS_Store |
Oops, something went wrong.