Skip to content

Commit 61ea29d

Browse files
committed
Initial commit.
0 parents  commit 61ea29d

40 files changed

+13409
-0
lines changed

.babelrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"ignore": ["/node_modules/"],
3+
"presets": [
4+
[
5+
"@babel/preset-env", {
6+
"targets": {
7+
"browsers": "defaults"
8+
},
9+
"useBuiltIns": "usage",
10+
"corejs": {
11+
"version": 3,
12+
"proposals": true
13+
}
14+
}
15+
],
16+
"@babel/preset-typescript"
17+
],
18+
"plugins": [
19+
"@babel/plugin-transform-runtime",
20+
"@babel/plugin-proposal-class-properties",
21+
"@babel/plugin-proposal-logical-assignment-operators",
22+
"@babel/plugin-proposal-private-methods"
23+
]
24+
}

.circleci/config.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
version: 2.1
2+
3+
orbs:
4+
node: circleci/node@4.5.0
5+
6+
commands:
7+
update-git:
8+
steps:
9+
- run: |
10+
if [ "`cat /etc/redhat-release | sed -e 's/.*\s\([0-9]\)\..*/\1/'`" = 6 ]; then
11+
yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm -y
12+
yum install git -y
13+
fi
14+
15+
jobs:
16+
test-perl:
17+
parameters:
18+
docker-image:
19+
type: string
20+
default: movabletype/test:buster
21+
docker:
22+
- image: << parameters.docker-image >>
23+
steps:
24+
- update-git
25+
- checkout
26+
- run:
27+
name: Test
28+
command: |
29+
git clone -b develop --depth 1 https://github.com/movabletype/movabletype.git mt
30+
cp -r mt/* .
31+
cp mt/.proverc .
32+
prove -j4 -PMySQLPool=MT::Test::Env -It/lib plugins/Passkey/t
33+
34+
build:
35+
docker:
36+
- image: cimg/node:18.9.1
37+
steps:
38+
- checkout
39+
- run:
40+
name: Install build dependency
41+
command: |
42+
sudo apt update
43+
sudo apt --no-install-recommends -y install libjson-perl libyaml-perl
44+
- run:
45+
name: Build
46+
command: |
47+
perl Makefile.PL --version $(git describe --tags | sed -e 's/^v//')
48+
make manifest
49+
make zipdist
50+
make dist
51+
mkdir -p packages
52+
mv Passkey-* packages
53+
- store_artifacts:
54+
path: packages
55+
56+
workflows:
57+
version: 2
58+
test-and-build:
59+
jobs:
60+
- test-perl:
61+
name: test-perl with jessie
62+
docker-image: movabletype/test:jessie
63+
- test-perl:
64+
name: test-perl with buster
65+
docker-image: movabletype/test:buster
66+
- test-perl:
67+
name: test-perl with fedora
68+
docker-image: movabletype/test:fedora
69+
- test-perl:
70+
name: test-perl with bullseye
71+
docker-image: movabletype/test:bullseye
72+
- test-perl:
73+
name: test-perl with cloud7
74+
docker-image: movabletype/test:cloud7
75+
- build
76+
tagged-build:
77+
jobs:
78+
- build:
79+
filters:
80+
branches:
81+
ignore: /.*/
82+
tags:
83+
only: /^v.*/

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
},
6+
parser: "@typescript-eslint/parser",
7+
extends: [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:prettier/recommended",
12+
"plugin:react/recommended",
13+
"prettier/@typescript-eslint",
14+
],
15+
rules: {
16+
"@typescript-eslint/explicit-function-return-type": [
17+
"warn",
18+
{
19+
allowExpressions: true,
20+
allowTypedFunctionExpressions: true,
21+
},
22+
],
23+
},
24+
settings: {
25+
react: {
26+
version: "detect",
27+
},
28+
},
29+
};

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*~
2+
*.swp
3+
*.tar.gz
4+
*.zip
5+
Makefile
6+
Makefile.old
7+
MANIFEST
8+
MANIFEST.bak
9+
MYMETA.*
10+
blib
11+
pm_to_blib
12+
node_modules/
13+
14+
mt-static/plugins/Passkey/dist/

.perlcriticrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
only = 1
2+
include = Variables::ProhibitUnusedVariables
3+
include = ValuesAndExpressions::ProhibitDuplicateHashKeys

.perltidyrc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
-b
2+
-bbt=0
3+
-bext=/
4+
-blbs=0
5+
-boa
6+
-boc
7+
-bok
8+
-bol
9+
-bot
10+
-bt=1
11+
-cab=3
12+
-ce
13+
-ci=4
14+
-cti=0
15+
-i=4
16+
-kis
17+
-l=0
18+
-nbbc
19+
-nicb
20+
-nicp
21+
-nsfs
22+
-nsts
23+
-ohbr
24+
-opr
25+
-osbr
26+
-otr
27+
-pt=2
28+
-sbt=2
29+
-sct
30+
-sot
31+
-wn

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG NODE
2+
FROM node:$NODE
3+
4+
RUN apt-get update \
5+
&& apt-get install --no-install-recommends -y \
6+
libjson-perl libyaml-perl \
7+
zip \
8+
&& apt-get clean \
9+
&& rm -rf /var/lib/apt/lists/*

MANIFEST.SKIP

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# version control
2+
\bCVS
3+
(^|/)\.
4+
5+
# CPAN chain files
6+
^MANIFEST
7+
^Makefile
8+
^META.yml$
9+
^MYMETA.yml$
10+
^MYMETA.json$
11+
^blib/
12+
13+
# Artwork data for description
14+
^artwork/
15+
16+
# Raw source file
17+
^src/
18+
19+
# Build tools
20+
Gruntfile
21+
package.json
22+
docker-compose.yml
23+
Dockerfile
24+
package-lock.json
25+
tsconfig.json
26+
webpack.config.js
27+
28+
# npm working directory
29+
^node_modules/
30+
31+
# packages
32+
\.zip$
33+
\.tar\.gz$
34+
35+
# test
36+
plugins/Passkey/t/
37+
plugins/Passkey/xt/
38+
^t/
39+
^cypress.json
40+
^cypress/
41+
42+
# source files
43+
mt-static/plugins/Passkey/src/

Makefile.PL

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
use ExtUtils::MakeMaker;
2+
use YAML;
3+
4+
my $config = YAML::LoadFile((glob('./plugins/*/config.yaml'))[0]);
5+
my $version = $config->{version};
6+
7+
use Getopt::Long 'GetOptions';
8+
GetOptions('version=s' => \$version);
9+
10+
WriteMakefile(
11+
NAME => $config->{name},
12+
VERSION => $version,
13+
SKIP => [qw(distdir)],
14+
DISTNAME => $config->{name},
15+
);
16+
17+
sub MY::top_targets {
18+
<< 'Makefile';
19+
npm-install:
20+
npm ci
21+
22+
npm-build:
23+
npm run build
24+
25+
build-js: npm-install npm-build
26+
build: build-js
27+
manifest : build
28+
29+
create_distdir :
30+
$(RM_RF) $(DISTVNAME)
31+
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
32+
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
33+
34+
distdir : create_distdir
35+
$(NOECHO) $(NOOP)
36+
37+
Makefile
38+
}

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Passkey
2+
3+
This is a plugin for the Movable Type.
4+
This plugin provides the Passkey authentication for the Movable Type.
5+
6+
## Installation
7+
8+
1. Download an archive file from [releases](https://github.com/movabletype/mt-plugin-Passkey/releases).
9+
1. Unpack an archive file.
10+
1. Upload unpacked files to the MT `plugins` directory.
11+
12+
Should look like this when installed:
13+
14+
$MT_HOME/
15+
plugins/
16+
Passkey/
17+
mt-static/
18+
plugins/
19+
Passkey/
20+
tools/
21+
Passkey/
22+
23+
## Requirements
24+
25+
* Movable Type 7
26+
* Movable Type 8
27+
28+
## LICENSE
29+
30+
31+
Copyright (c) 2023 Taku AMANO
32+
33+
Permission is hereby granted, free of charge, to any person obtaining
34+
a copy of this software and associated documentation files (the
35+
'Software'), to deal in the Software without restriction, including
36+
without limitation the rights to use, copy, modify, merge, publish,
37+
distribute, sublicense, and/or sell copies of the Software, and to
38+
permit persons to whom the Software is furnished to do so, subject to
39+
the following conditions:
40+
41+
The above copyright notice and this permission notice shall be
42+
included in all copies or substantial portions of the Software.
43+
44+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
45+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
46+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
48+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
49+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
50+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)