This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
generated from norskeld/serpent
-
Notifications
You must be signed in to change notification settings - Fork 0
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 30e2e79
Showing
25 changed files
with
19,527 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,8 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 2 |
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,3 @@ | ||
node_modules | ||
coverage | ||
dist |
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,27 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"env": { | ||
"node": true | ||
}, | ||
"rules": { | ||
"semi": ["error", "never"], | ||
"quotes": ["error", "single", { "allowTemplateLiterals": true }], | ||
"no-constant-condition": "off", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
"args": "after-used", | ||
"argsIgnorePattern": "_", | ||
"varsIgnorePattern": "_" | ||
} | ||
] | ||
} | ||
} |
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 @@ | ||
.husky/* linguist-detectable=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,29 @@ | ||
name: release | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['test'] | ||
branches: [master] | ||
types: [completed] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Use Node Active LTS | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
- name: Install Deps | ||
run: npm ci | ||
- name: Build & Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
npm run build | ||
npm run release |
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,24 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Use Node Active LTS | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
- name: Install Deps | ||
run: npm ci | ||
- name: Build & Test | ||
run: | | ||
npm run build | ||
npm run 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,25 @@ | ||
node_modules | ||
dist | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories & files | ||
.idea | ||
|
||
# Coverage reports | ||
coverage | ||
|
||
# NPM | ||
.npm | ||
|
||
# Dotenv files | ||
.env.local | ||
.env.*.local |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit "$1" |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install lint-staged |
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,2 @@ | ||
registry=https://registry.npmjs.org | ||
access=public |
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,3 @@ | ||
node_modules | ||
coverage | ||
dist |
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,16 @@ | ||
{ | ||
"semi": false, | ||
"printWidth": 100, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"], | ||
"options": { | ||
"parser": "typescript" | ||
} | ||
} | ||
] | ||
} |
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,22 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "angular", | ||
"releaseRules": [{ "scope": "no-release", "release": false }] | ||
} | ||
], | ||
"@semantic-release/release-notes-generator", | ||
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }], | ||
["@semantic-release/npm", { "pkgRoot": "dist" }], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"], | ||
"message": "chore(release): release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
"@semantic-release/github" | ||
] | ||
} |
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,102 @@ | ||
import { access, copyFile } from 'fs/promises' | ||
import { constants } from 'fs' | ||
import { resolve } from 'path' | ||
|
||
interface Success { | ||
kind: 'success' | ||
message: string | ||
} | ||
|
||
interface Failure { | ||
kind: 'failure' | ||
reason: string | ||
} | ||
|
||
type Result = Success | Failure | ||
type Actions = Record<string, () => Promise<Result>> | ||
|
||
async function actions(actions: Actions): Promise<Result> { | ||
const [passed] = process.argv.slice(2) | ||
const resolved = actions[passed] | ||
|
||
if (resolved) { | ||
return await resolved() | ||
} | ||
|
||
return { | ||
kind: 'failure', | ||
reason: `Action '${passed}' is not defined.` | ||
} | ||
} | ||
|
||
async function run(result: Result) { | ||
switch (result.kind) { | ||
case 'success': { | ||
console.log(result.message) | ||
return | ||
} | ||
|
||
case 'failure': { | ||
console.error(result.reason) | ||
process.exit(1) | ||
} | ||
} | ||
} | ||
|
||
async function main() { | ||
const cwd = process.cwd() | ||
|
||
await run( | ||
await actions({ | ||
/** This should be called in `prerelease`. */ | ||
async prepare() { | ||
try { | ||
// Just double-check for `dist` directory. | ||
await access(`${cwd}/package.json`, constants.F_OK) | ||
|
||
// Copy necessary files. | ||
await copyFile(`${cwd}/package.json`, `${cwd}/dist/package.json`) | ||
await copyFile(`${cwd}/package-lock.json`, `${cwd}/dist/package-lock.json`) | ||
await copyFile(`${cwd}/CHANGELOG.md`, `${cwd}/dist/CHANGELOG.md`) | ||
await copyFile(`${cwd}/README.md`, `${cwd}/dist/README.md`) | ||
await copyFile(`${cwd}/LICENSE`, `${cwd}/dist/LICENSE`) | ||
|
||
// This is kinda needed for local publishes to `verdaccio`, so I do not accidentally | ||
// publish my experiments to the actual `npm` registry. | ||
await copyFile(`${cwd}/.npmrc`, `${cwd}/dist/.npmrc`) | ||
|
||
return { | ||
kind: 'success', | ||
message: 'Successfully prepared files for a release.' | ||
} | ||
} catch (error) { | ||
return { | ||
kind: 'failure', | ||
reason: (error as Error).message | ||
} | ||
} | ||
}, | ||
|
||
/** This should be called in `postversion`. Here we actually are inside the `dist`. */ | ||
async restore() { | ||
try { | ||
// Copy back. | ||
await copyFile(`${cwd}/package.json`, resolve(cwd, '..', 'package.json')) | ||
await copyFile(`${cwd}/package-lock.json`, resolve(cwd, '..', 'package-lock.json')) | ||
|
||
return { | ||
kind: 'success', | ||
message: 'Successfully restored `package.json`.' | ||
} | ||
} catch (error) { | ||
return { | ||
kind: 'failure', | ||
reason: (error as Error).message | ||
} | ||
} | ||
} | ||
}) | ||
) | ||
} | ||
|
||
main() |
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,7 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"EditorConfig.EditorConfig" | ||
] | ||
} |
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,15 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"editor.rulers": [100], | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": ["/.prettierrc", "/.prettierrc.json"], | ||
"url": "http://json.schemastore.org/prettierrc" | ||
} | ||
] | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Vladislav Mamon | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 @@ | ||
# astrowind | ||
|
||
[![Build/Test](https://img.shields.io/github/actions/workflow/status/norskeld/astrowind/test.yml?style=flat-square&colorA=22272d&colorB=22272d)](https://github.com/norskeld/astrowind/actions 'Build and test workflows') | ||
[![NPM](https://img.shields.io/npm/v/@nrsk/astrowind?style=flat-square&colorA=22272d&colorB=22272d)](https://npm.im/@nrsk/astrowind 'This package on NPM') | ||
[![Supported Node Versions](https://img.shields.io/static/v1?label=node&message=14+|+16+|+18&style=flat-square&colorA=22272d&colorB=22272d)](https://github.com/norskeld/astrowind/blob/master/package.json#L35 'Supported Node versions') | ||
[![Semantic Release](https://img.shields.io/static/v1?label=semantic+release&message=✔&style=flat-square&colorA=22272d&colorB=22272d)](https://github.com/semantic-release/semantic-release 'This package uses semantic release to handle releasing, versioning, changelog generation and tagging') | ||
|
||
Tailwind integration for Astro with support for TS configs. | ||
|
||
## License | ||
|
||
[MIT](LICENSE). |
Oops, something went wrong.