Fix published npm package folder structure

This commit is contained in:
Alice Gaudon 2021-01-25 12:37:41 +01:00
parent 16dedb681a
commit 2a184e4ff5
5 changed files with 25 additions and 25 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
node_modules
dist
yarn-error.log
src/package.json

View File

@ -10,16 +10,17 @@
"registry": "https://registry.npmjs.com",
"access": "public"
},
"main": "dist/src/main.js",
"main": "dist/main.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "jest --verbose --runInBand",
"clean": "(test ! -d dist || rm -r dist)",
"prepare": "cp package.json src/",
"compile": "yarn clean && tsc",
"dev": "concurrently -k -n \"Typescript,Node,Webpack,Maildev\" -p \"[{name}]\" -c \"blue,green,red,yellow\" \"tsc --watch\" \"nodemon\" \"maildev\"",
"build": "yarn compile && cp -r package.json yarn.lock README.md config/ views/ dist/ && mkdir dist/types && cp src/types/* dist/types/",
"dev": "yarn prepare && concurrently -k -n \"Typescript,Node,Webpack,Maildev\" -p \"[{name}]\" -c \"blue,green,red,yellow\" \"tsc --watch\" \"nodemon\" \"maildev\"",
"build": "yarn prepare && yarn compile && cp -r yarn.lock README.md config/ views/ dist/ && mkdir dist/types && cp src/types/* dist/types/",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"release": "yarn lint && yarn test && yarn build && cd dist && yarn publish"
"release": "yarn build && yarn lint && yarn test && cd dist && yarn publish"
},
"devDependencies": {
"@types/compression": "^1.7.0",

View File

@ -1,18 +1,18 @@
import Application from "../src/Application";
import Migration, {MigrationType} from "../src/db/Migration";
import ExpressAppComponent from "../src/components/ExpressAppComponent";
import RedisComponent from "../src/components/RedisComponent";
import MysqlComponent from "../src/components/MysqlComponent";
import NunjucksComponent from "../src/components/NunjucksComponent";
import LogRequestsComponent from "../src/components/LogRequestsComponent";
import MailComponent from "../src/components/MailComponent";
import SessionComponent from "../src/components/SessionComponent";
import AuthComponent from "../src/auth/AuthComponent";
import FormHelperComponent from "../src/components/FormHelperComponent";
import ServeStaticDirectoryComponent from "../src/components/ServeStaticDirectoryComponent";
import Application from "./Application";
import Migration, {MigrationType} from "./db/Migration";
import ExpressAppComponent from "./components/ExpressAppComponent";
import RedisComponent from "./components/RedisComponent";
import MysqlComponent from "./components/MysqlComponent";
import NunjucksComponent from "./components/NunjucksComponent";
import LogRequestsComponent from "./components/LogRequestsComponent";
import MailComponent from "./components/MailComponent";
import SessionComponent from "./components/SessionComponent";
import AuthComponent from "./auth/AuthComponent";
import FormHelperComponent from "./components/FormHelperComponent";
import ServeStaticDirectoryComponent from "./components/ServeStaticDirectoryComponent";
import {Express} from "express";
import MagicLinkAuthMethod from "../src/auth/magic_link/MagicLinkAuthMethod";
import PasswordAuthMethod from "../src/auth/password/PasswordAuthMethod";
import MagicLinkAuthMethod from "./auth/magic_link/MagicLinkAuthMethod";
import PasswordAuthMethod from "./auth/password/PasswordAuthMethod";
import {MAGIC_LINK_MAIL} from "./Mails";
import CreateMigrationsTable from "./migrations/CreateMigrationsTable";
import CreateUsersAndUserEmailsTableMigration from "./auth/migrations/CreateUsersAndUserEmailsTableMigration";
@ -29,7 +29,7 @@ import Controller from "./Controller";
import AccountController from "./auth/AccountController";
import MakeMagicLinksSessionNotUniqueMigration from "./auth/magic_link/MakeMagicLinksSessionNotUniqueMigration";
import AddUsedToMagicLinksMigration from "./auth/magic_link/AddUsedToMagicLinksMigration";
import packageJson = require('../package.json');
import packageJson = require('./package.json');
import PreviousUrlComponent from "./components/PreviousUrlComponent";
export const MIGRATIONS = [

View File

@ -2,9 +2,9 @@ import {delimiter} from "path";
// Load config from specified path or default + swaf/config (default defaults)
process.env['NODE_CONFIG_DIR'] =
__dirname + '/../../node_modules/swaf/config/'
__dirname + '/../node_modules/swaf/config/'
+ delimiter
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../../config/');
+ (process.env['NODE_CONFIG_DIR'] || __dirname + '/../config/');
import {logger} from "./Logger";
import TestApp from "./TestApp";

View File

@ -11,10 +11,7 @@
"moduleResolution": "Node",
"esModuleInterop": true,
"baseUrl": "dist",
"rootDirs": [
"src",
"config"
],
"rootDir": "src",
"sourceRoot": "src",
"inlineSourceMap": true,
"inlineSources": true,