Skip to content

Commit

Permalink
chore: Update files according to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinthen committed May 21, 2022
1 parent 9d0820a commit c49ff3a
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 1,079 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- dev
pull_request: {}

permissions:
actions: write
contents: read

jobs:
lint:
name: ⬣ ESLint
Expand All @@ -24,6 +28,8 @@ jobs:

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🔬 Lint
run: yarn lint
Expand All @@ -46,6 +52,8 @@ jobs:

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🔎 Type check
run: yarn typecheck
Expand All @@ -67,6 +75,8 @@ jobs:

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ⚡ Run vitest
run: yarn test --coverage
Expand All @@ -91,6 +101,8 @@ jobs:

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ⚙️ Build
run: yarn build
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# We don't want lockfiles in stacks, as people could use a different package manager
# This part will be removed by `remix.init`
package-lock.json
yarn.lock
pnpm-lock.yaml
pnpm-lock.yml

node_modules

/build
Expand Down
2 changes: 1 addition & 1 deletion app/routes/join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const action: ActionFunction = async ({ request }) => {
);
}

if (typeof password !== 'string') {
if (typeof password !== 'string' || password.length === 0) {
return json<ActionData>(
{ errors: { password: 'Password is required' } },
{ status: 400 },
Expand Down
2 changes: 1 addition & 1 deletion app/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const action: ActionFunction = async ({ request }) => {
);
}

if (typeof password !== 'string') {
if (typeof password !== 'string' || password.length === 0) {
return json<ActionData>(
{ errors: { password: 'Password is required' } },
{ status: 400 },
Expand Down
12 changes: 9 additions & 3 deletions mocks/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
require('tsconfig-paths/register');
require('ts-node').register({ transpileOnly: true });
require('./start');
const { setupServer } = require("msw/node");

const server = setupServer();

server.listen({ onUnhandledRequest: "bypass" });
console.info("🔶 Mock server running");

process.once("SIGINT", () => server.close());
process.once("SIGTERM", () => server.close());
11 changes: 0 additions & 11 deletions mocks/start.ts

This file was deleted.

12 changes: 12 additions & 0 deletions remix.init/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules

/build
/public/build
.env

/cypress/screenshots
/cypress/videos
/prisma/data.db
/prisma/data.db-journal

/app/styles/tailwind.css
14 changes: 9 additions & 5 deletions remix.init/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ async function main({ rootDirectory }) {
fs.readFile(README_PATH, "utf-8"),
fs.readFile(EXAMPLE_ENV_PATH, "utf-8"),
fs.readFile(PACKAGE_JSON_PATH, "utf-8"),
fs.rm(path.join(rootDirectory, ".github/ISSUE_TEMPLATE"), {
recursive: true,
}),
fs.rm(path.join(rootDirectory, ".github/PULL_REQUEST_TEMPLATE.md")),
fs.rm(path.join(rootDirectory, ".github/FUNDING.yml")),
]);

const newEnv = env.replace(
Expand Down Expand Up @@ -67,6 +62,15 @@ async function main({ rootDirectory }) {
fs.writeFile(README_PATH, newReadme),
fs.writeFile(ENV_PATH, newEnv),
fs.writeFile(PACKAGE_JSON_PATH, newPackageJson),
fs.copyFile(
path.join(rootDirectory, "remix.init", "gitignore"),
path.join(rootDirectory, ".gitignore")
),
fs.rm(path.join(rootDirectory, ".github/ISSUE_TEMPLATE"), {
recursive: true,
}),
fs.rm(path.join(rootDirectory, ".github/PULL_REQUEST_TEMPLATE.md")),
fs.rm(path.join(rootDirectory, ".github/FUNDING.yml")),
]);

console.log(
Expand Down
Loading

0 comments on commit c49ff3a

Please sign in to comment.