mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-09 00:42:47 +00:00
switch from yarn to npm - other minor updates
This commit is contained in:
@@ -24,8 +24,8 @@ Made with:
|
|||||||
|
|
||||||
## Build the client
|
## Build the client
|
||||||
- `cd client`
|
- `cd client`
|
||||||
- `yarn install`
|
- `npm install`
|
||||||
- `yarn run dev`
|
- `npm run dev`
|
||||||
|
|
||||||
# Ecto
|
# Ecto
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
# Starter project for React
|
|
||||||
- [Typescript](https://www.typescriptlang.org/)
|
|
||||||
- [React 16](https://reactjs.org/)
|
|
||||||
- [React Router 4](https://reacttraining.com/react-router/)
|
|
||||||
- [Webpack 3](https://webpack.js.org/)
|
|
||||||
- [Yarn](https://yarnpkg.com/lang/en/docs/install/)
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
- yarn install
|
|
||||||
- yarn start
|
|
||||||
|
|
||||||
http://localhost:8080
|
|
||||||
|
|
||||||
## Note
|
|
||||||
There is currently a bug with yarn not updating package.json when upgrading packages.
|
|
||||||
[See more here](https://github.com/yarnpkg/yarn/issues/2042#issuecomment-269601927).
|
|
||||||
I added the `update-latest` script in package.json for a temporary fix.
|
|
||||||
@@ -130,7 +130,7 @@ export class Forum extends React.Component<Props, State> {
|
|||||||
|
|
||||||
private onSearch(event: any) {
|
private onSearch(event: any) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const threads = filter(cloneDeep(this.state.initialThreads), (t) => {
|
const threads: any = filter(cloneDeep(this.state.initialThreads), (t) => {
|
||||||
return t.title.toLowerCase().match(this.state.searchText.toLowerCase());
|
return t.title.toLowerCase().match(this.state.searchText.toLowerCase());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export class Realms extends React.Component<Props, State> {
|
|||||||
const realms = chain(res)
|
const realms = chain(res)
|
||||||
.filter({ category: 'realm' })
|
.filter({ category: 'realm' })
|
||||||
.orderBy(['title'])
|
.orderBy(['title'])
|
||||||
.value();
|
.value() as CategoryModel[];
|
||||||
this.setState({ realms });
|
this.setState({ realms });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|||||||
16188
client/package-lock.json
generated
Normal file
16188
client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,7 @@
|
|||||||
"build": "webpack -p --progress --colors",
|
"build": "webpack -p --progress --colors",
|
||||||
"dev": "webpack --progress --colors --watch",
|
"dev": "webpack --progress --colors --watch",
|
||||||
"c9": "webpack-dev-server --host 0.0.0.0 --port 8080 --inline --history-api-fallback",
|
"c9": "webpack-dev-server --host 0.0.0.0 --port 8080 --inline --history-api-fallback",
|
||||||
"start": "webpack-dev-server --inline --history-api-fallback",
|
"start": "webpack-dev-server --inline --history-api-fallback"
|
||||||
"update-latest": "rm -rf node_modules && rm yarn.lock && ncu --upgrade --upgradeAll && yarn install"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/fingerprintjs2": "^1.5.1",
|
"@types/fingerprintjs2": "^1.5.1",
|
||||||
|
|||||||
6732
client/yarn.lock
6732
client/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -26,13 +26,6 @@ defmodule MyApp.Data.Reply do
|
|||||||
end
|
end
|
||||||
|
|
||||||
# allow user to update reply
|
# allow user to update reply
|
||||||
defp user_update_changeset(reply, params \\ %{}) do
|
|
||||||
reply
|
|
||||||
|> cast(params, [:content])
|
|
||||||
|> force_change(:edited, true) # set edited flag on update
|
|
||||||
|> validate_required([:content])
|
|
||||||
end
|
|
||||||
|
|
||||||
@spec insert(map) :: {:ok, map} | {:error, map}
|
@spec insert(map) :: {:ok, map} | {:error, map}
|
||||||
def insert(params) do
|
def insert(params) do
|
||||||
{:ok, data} = Repo.transaction(fn ->
|
{:ok, data} = Repo.transaction(fn ->
|
||||||
|
|||||||
@@ -50,10 +50,8 @@ defmodule MyAppWeb.ReplyController do
|
|||||||
|
|
||||||
@spec mod_update(map, map) :: any
|
@spec mod_update(map, map) :: any
|
||||||
def mod_update(conn, params) do
|
def mod_update(conn, params) do
|
||||||
{:ok, _} = Data.Reply.mod_update(params)
|
Data.Reply.mod_update(params)
|
||||||
conn
|
Response.json(conn, "ok")
|
||||||
|> put_status(200)
|
|
||||||
|> Response.json("ok")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
2
makefile
2
makefile
@@ -3,7 +3,7 @@ clean:
|
|||||||
rm -rf _build
|
rm -rf _build
|
||||||
|
|
||||||
build-client:
|
build-client:
|
||||||
cd client && yarn install && yarn run build
|
cd client && npm install && npm run build
|
||||||
|
|
||||||
build-server:
|
build-server:
|
||||||
MIX_ENV=prod mix deps.get && MIX_ENV=prod mix release --env=prod
|
MIX_ENV=prod mix deps.get && MIX_ENV=prod mix release --env=prod
|
||||||
|
|||||||
Reference in New Issue
Block a user