Skip to content

Commit 8f12489

Browse files
committed
feat: initial commit
0 parents  commit 8f12489

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+43069
-0
lines changed

.config/beemo.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { ScaffoldConfig } from '@niieani/scaffold'
2+
3+
const config: ScaffoldConfig = {
4+
module: '@niieani/scaffold',
5+
drivers: ['babel', 'eslint', 'jest', 'prettier', 'typescript', 'webpack'],
6+
settings: {
7+
node: true,
8+
name: 'Sqids',
9+
engineTarget: 'web',
10+
codeTarget: 'es6',
11+
umd: {
12+
filename: 'sqids.js',
13+
export: 'default',
14+
},
15+
},
16+
}
17+
18+
export default config

.config/beemo/eslint.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
ignorePatterns: ['*.mjs', '*.cjs'],
3+
rules: {
4+
'import/no-default-export': 'off',
5+
'@typescript-eslint/no-parameter-properties': 'off',
6+
'@typescript-eslint/no-use-before-define': 'off',
7+
'no-underscore-dangle': 'off',
8+
'node/no-unsupported-features/es-builtins': 'off',
9+
'unicorn/prefer-spread': 'off',
10+
},
11+
}

.config/husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn rrun commitlint --config "node_modules/@niieani/scaffold/src/configs/shared/commitlint.config.js" --edit "$1"

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/blocklist.* binary
2+
.yarn/**/* binary
3+
cjs/**/* binary
4+
dist/**/* binary
5+
esm/**/* binary
6+
package-lock.json binary
7+
yarn.lock binary

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: 'github-actions'
5+
directory: '/'
6+
schedule:
7+
interval: 'weekly'

.github/renovate.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": [
3+
"config:base",
4+
":ignoreUnstable",
5+
":combinePatchMinorReleases",
6+
":renovatePrefix",
7+
":semanticCommits",
8+
":rebaseStalePrs",
9+
":prNotPending",
10+
":semanticPrefixFixDepsChoreOthers",
11+
":updateNotScheduled",
12+
":automergeDigest",
13+
":automergePatch",
14+
":automergeMinor",
15+
":automergeRequireAllStatusChecks",
16+
":maintainLockFilesWeekly",
17+
":respectLatest",
18+
":updateNotScheduled",
19+
"schedule:earlyMondays"
20+
],
21+
"prConcurrentLimit": 5,
22+
"pin": false,
23+
"rangeStrategy": "bump",
24+
"ignoreDeps": []
25+
}

.github/workflows/ci-cd.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
- next
9+
pull_request:
10+
branches:
11+
- '**'
12+
13+
jobs:
14+
test:
15+
name: Test on node ${{ matrix.node }}
16+
if: github.actor != 'github-actions[bot]'
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
node: [16]
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node }}
26+
cache: 'yarn'
27+
- name: Install dependencies and test
28+
run: |
29+
yarn install --immutable
30+
yarn build
31+
yarn test
32+
33+
publish:
34+
name: Publish package to NPM
35+
needs: test
36+
runs-on: ubuntu-latest
37+
if: github.actor != 'github-actions[bot]' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next')
38+
steps:
39+
- uses: actions/checkout@v3
40+
- uses: actions/setup-node@v3
41+
with:
42+
node-version: 16
43+
cache: 'yarn'
44+
- name: Build and release
45+
run: |
46+
yarn install --immutable
47+
yarn build
48+
yarn release
49+
env:
50+
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
51+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/codeql-analysis.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Code Scanning'
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 6 * * 0'
8+
9+
jobs:
10+
CodeQL-Build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
with:
17+
# We must fetch at least the immediate parents so that if this is
18+
# a pull request then we can checkout the head.
19+
fetch-depth: 2
20+
21+
# Initializes the CodeQL tools for scanning.
22+
- name: Initialize CodeQL
23+
uses: github/codeql-action/init@v2
24+
# Override language selection by uncommenting this and choosing your languages
25+
# with:
26+
# languages: go, javascript, csharp, python, cpp, java
27+
28+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
29+
# If this step fails, then you should remove it and run the build manually (see below)
30+
- name: Autobuild
31+
uses: github/codeql-action/autobuild@v2
32+
33+
# ℹ️ Command-line programs to run using the OS shell.
34+
# 📚 https://git.io/JvXDl
35+
36+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
37+
# and modify them (or add more) to build your code if your project
38+
# uses a compiled language
39+
40+
#- run: |
41+
# make bootstrap
42+
# make release
43+
44+
- name: Perform CodeQL Analysis
45+
uses: github/codeql-action/analyze@v2
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow was added by CodeSee. Learn more at https://codesee.io/
2+
# This is v2.0 of this workflow file
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request_target:
8+
types: [opened, synchronize, reopened]
9+
10+
name: CodeSee
11+
12+
permissions: read-all
13+
14+
jobs:
15+
codesee:
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
name: Analyze the repo with CodeSee
19+
steps:
20+
- uses: Codesee-io/codesee-action@v2
21+
with:
22+
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}

.gitignore

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.vscode
2+
.eslintignore
3+
.eslintrc.js
4+
.prettierignore
5+
.editorconfig
6+
tsconfig.json
7+
babel.config.js
8+
jest.config.js
9+
prettier.config.js
10+
vite.config.ts
11+
webpack.config.js
12+
*.tsbuildinfo
13+
14+
/.yarn/*
15+
16+
!/.yarn/patches
17+
!/.yarn/plugins
18+
!/.yarn/releases
19+
!/.yarn/sdks
20+
21+
# Swap the comments on the following lines if you wish to use zero-installs
22+
# Documentation here: https://yarnpkg.com/features/zero-installs
23+
# !/.yarn/cache
24+
/.pnp.*
25+
26+
# Logs
27+
logs/
28+
*.log
29+
30+
# Cache
31+
.eslintcache
32+
.idea
33+
.npm
34+
.vscode
35+
.yarnclean
36+
37+
# Directories
38+
coverage/
39+
dts/
40+
mjs/
41+
node_modules/
42+
43+
# Custom
44+
*.min.js
45+
*.map
46+
47+
.DS_Store

.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/tests
2+
**/tests-mjs
3+
.vscode
4+
.github
5+
.config
6+
.yarn

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

+363
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* eslint-disable */
2+
module.exports = {
3+
name: "@yarnpkg/plugin-postinstall-dev",
4+
factory: function (require) {
5+
var plugin;(()=>{var t={846:(t,r,e)=>{"use strict";const n=e(81),o=e(782),s=e(682);function c(t,r,e){const c=o(t,r,e),i=n.spawn(c.command,c.args,c.options);return s.hookChildProcess(i,c),i}t.exports=c,t.exports.spawn=c,t.exports.sync=function(t,r,e){const c=o(t,r,e),i=n.spawnSync(c.command,c.args,c.options);return i.error=i.error||s.verifyENOENTSync(i.status,c),i},t.exports._parse=o,t.exports._enoent=s},682:t=>{"use strict";const r="win32"===process.platform;function e(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function n(t,n){return r&&1===t&&!n.file?e(n.original,"spawn"):null}t.exports={hookChildProcess:function(t,e){if(!r)return;const o=t.emit;t.emit=function(r,s){if("exit"===r){const r=n(s,e);if(r)return o.call(t,"error",r)}return o.apply(t,arguments)}},verifyENOENT:n,verifyENOENTSync:function(t,n){return r&&1===t&&!n.file?e(n.original,"spawnSync"):null},notFoundError:e}},782:(t,r,e)=>{"use strict";const n=e(17),o=e(326),s=e(541),c=e(449),i="win32"===process.platform,a=/\.(?:com|exe)$/i,p=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(t){if(!i)return t;const r=function(t){t.file=o(t);const r=t.file&&c(t.file);return r?(t.args.unshift(t.file),t.command=r,o(t)):t.file}(t),e=!a.test(r);if(t.options.forceShell||e){const e=p.test(r);t.command=n.normalize(t.command),t.command=s.command(t.command),t.args=t.args.map(t=>s.argument(t,e));const o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,r,e){r&&!Array.isArray(r)&&(e=r,r=null);const n={command:t,args:r=r?r.slice(0):[],options:e=Object.assign({},e),file:void 0,original:{command:t,args:r}};return e.shell?n:u(n)}},541:t=>{"use strict";const r=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(r,"^$1")},t.exports.argument=function(t,e){return t=(t=`"${t=(t=(t=""+t).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(r,"^$1"),e&&(t=t.replace(r,"^$1")),t}},449:(t,r,e)=>{"use strict";const n=e(147),o=e(104);t.exports=function(t){const r=Buffer.alloc(150);let e;try{e=n.openSync(t,"r"),n.readSync(e,r,0,150,0),n.closeSync(e)}catch(t){}return o(r.toString())}},326:(t,r,e)=>{"use strict";const n=e(17),o=e(658),s=e(687);function c(t,r){const e=t.options.env||process.env,c=process.cwd(),i=null!=t.options.cwd,a=i&&void 0!==process.chdir&&!process.chdir.disabled;if(a)try{process.chdir(t.options.cwd)}catch(t){}let p;try{p=o.sync(t.command,{path:e[s({env:e})],pathExt:r?n.delimiter:void 0})}catch(t){}finally{a&&process.chdir(c)}return p&&(p=n.resolve(i?t.options.cwd:"",p)),p}t.exports=function(t){return c(t)||c(t,!0)}},768:(t,r,e)=>{var n;e(147);function o(t,r,e){if("function"==typeof r&&(e=r,r={}),!e){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(e,n){o(t,r||{},(function(t,r){t?n(t):e(r)}))}))}n(t,r||{},(function(t,n){t&&("EACCES"===t.code||r&&r.ignoreErrors)&&(t=null,n=!1),e(t,n)}))}n="win32"===process.platform||global.TESTING_WINDOWS?e(73):e(721),t.exports=o,o.sync=function(t,r){try{return n.sync(t,r||{})}catch(t){if(r&&r.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},721:(t,r,e)=>{t.exports=o,o.sync=function(t,r){return s(n.statSync(t),r)};var n=e(147);function o(t,r,e){n.stat(t,(function(t,n){e(t,!t&&s(n,r))}))}function s(t,r){return t.isFile()&&function(t,r){var e=t.mode,n=t.uid,o=t.gid,s=void 0!==r.uid?r.uid:process.getuid&&process.getuid(),c=void 0!==r.gid?r.gid:process.getgid&&process.getgid(),i=parseInt("100",8),a=parseInt("010",8),p=parseInt("001",8),u=i|a;return e&p||e&a&&o===c||e&i&&n===s||e&u&&0===s}(t,r)}},73:(t,r,e)=>{t.exports=s,s.sync=function(t,r){return o(n.statSync(t),t,r)};var n=e(147);function o(t,r,e){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,r){var e=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!e)return!0;if(-1!==(e=e.split(";")).indexOf(""))return!0;for(var n=0;n<e.length;n++){var o=e[n].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}(r,e)}function s(t,r,e){n.stat(t,(function(n,s){e(n,!n&&o(s,t,r))}))}},687:t=>{"use strict";const r=(t={})=>{const r=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(r).reverse().find(t=>"PATH"===t.toUpperCase())||"Path"};t.exports=r,t.exports.default=r},104:(t,r,e)=>{"use strict";const n=e(367);t.exports=(t="")=>{const r=t.match(n);if(!r)return null;const[e,o]=r[0].replace(/#! ?/,"").split(" "),s=e.split("/").pop();return"env"===s?o:o?`${s} ${o}`:s}},367:t=>{"use strict";t.exports=/^#!(.*)/},658:(t,r,e)=>{const n="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,o=e(17),s=n?";":":",c=e(768),i=t=>Object.assign(new Error("not found: "+t),{code:"ENOENT"}),a=(t,r)=>{const e=r.colon||s,o=t.match(/\//)||n&&t.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(e)],c=n?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=n?c.split(e):[""];return n&&-1!==t.indexOf(".")&&""!==i[0]&&i.unshift(""),{pathEnv:o,pathExt:i,pathExtExe:c}},p=(t,r,e)=>{"function"==typeof r&&(e=r,r={}),r||(r={});const{pathEnv:n,pathExt:s,pathExtExe:p}=a(t,r),u=[],l=e=>new Promise((s,c)=>{if(e===n.length)return r.all&&u.length?s(u):c(i(t));const a=n[e],p=/^".*"$/.test(a)?a.slice(1,-1):a,l=o.join(p,t),d=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;s(f(d,e,0))}),f=(t,e,n)=>new Promise((o,i)=>{if(n===s.length)return o(l(e+1));const a=s[n];c(t+a,{pathExt:p},(s,c)=>{if(!s&&c){if(!r.all)return o(t+a);u.push(t+a)}return o(f(t,e,n+1))})});return e?l(0).then(t=>e(null,t),e):l(0)};t.exports=p,p.sync=(t,r)=>{r=r||{};const{pathEnv:e,pathExt:n,pathExtExe:s}=a(t,r),p=[];for(let i=0;i<e.length;i++){const a=e[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,l=o.join(u,t),f=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let t=0;t<n.length;t++){const e=f+n[t];try{if(c.sync(e,{pathExt:s})){if(!r.all)return e;p.push(e)}}catch(t){}}}if(r.all&&p.length)return p;if(r.nothrow)return null;throw i(t)}},81:t=>{"use strict";t.exports=require("child_process")},147:t=>{"use strict";t.exports=require("fs")},17:t=>{"use strict";t.exports=require("path")}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var s=r[n]={exports:{}};return t[n](s,s.exports,e),s.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{default:()=>r});var t=e(846);const r={hooks:{async afterAllInstalled(r){await new Promise(e=>{const n=(0,t.spawn)("yarn",["run","postinstallDev"],{cwd:r.cwd});n.stdout.pipe(process.stdout),n.stderr.pipe(process.stderr),n.addListener("exit",()=>e())})}}}})(),plugin=n})();
6+
return plugin;
7+
}
8+
};

.yarn/plugins/@yarnpkg/plugin-typescript.cjs

+9
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)