alp-node 4.2.0 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.2.2](https://github.com/christophehurpeau/alp/compare/alp-node@4.2.1...alp-node@4.2.2) (2022-10-29)
7
+
8
+ **Note:** Version bump only for package alp-node
9
+
10
+
11
+
12
+
13
+
14
+ ## [4.2.1](https://github.com/christophehurpeau/alp/compare/alp-node@4.2.0...alp-node@4.2.1) (2022-10-19)
15
+
16
+ **Note:** Version bump only for package alp-node
17
+
18
+
19
+
20
+
21
+
6
22
  # [4.2.0](https://github.com/christophehurpeau/alp/compare/alp-node@4.1.4...alp-node@4.2.0) (2022-10-16)
7
23
 
8
24
 
package/README.md CHANGED
@@ -8,6 +8,9 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://npmjs.org/package/alp-node"><img src="https://img.shields.io/npm/v/alp-node.svg?style=flat-square"></a>
11
+ <a href="https://npmjs.org/package/alp-node"><img src="https://img.shields.io/npm/dw/alp-node.svg?style=flat-square"></a>
12
+ <a href="https://npmjs.org/package/alp-node"><img src="https://img.shields.io/node/v/alp-node.svg?style=flat-square"></a>
13
+ <a href="https://npmjs.org/package/alp-node"><img src="https://img.shields.io/npm/types/alp-node.svg?style=flat-square"></a>
11
14
  </p>
12
15
 
13
16
  ## Install
@@ -103,7 +103,7 @@ logger.debug('init', {
103
103
  appDirname,
104
104
  packageDirname
105
105
  });
106
- const packageConfig = JSON.parse(readFileSync(packagePath, 'utf-8'));
106
+ const packageConfig = JSON.parse(readFileSync(packagePath, 'utf8'));
107
107
  const buildedConfigPath = `${appDirname}/build/config/`;
108
108
  const configPath = existsSync(buildedConfigPath) ? buildedConfigPath : `${appDirname}/config/`;
109
109
  const config = new Config(configPath).loadSync({
@@ -1 +1 @@
1
- {"version":3,"file":"index-node14.mjs","sources":["../src/AlpNodeApp.ts","../src/index.ts"],"sourcesContent":["import type { IncomingMessage, Server, ServerResponse } from 'http';\nimport path from 'path';\nimport { deprecate } from 'util';\nimport _listen from 'alp-listen';\nimport type { Config } from 'alp-node-config';\nimport _config from 'alp-node-config';\nimport errors from 'alp-node-errors';\nimport language from 'alp-node-language';\nimport params from 'alp-params';\nimport translate from 'alp-translate';\nimport type {\n NodeApplication,\n NodeConfig,\n Context as AlpContext,\n ContextState,\n ContextSanitizedState,\n ContextRequest,\n} from 'alp-types';\nimport Koa from 'koa';\nimport type { ParameterizedContext, DefaultState, BaseRequest } from 'koa';\nimport compress from 'koa-compress';\nimport serve from 'koa-static';\nimport { Logger } from 'nightingale-logger';\n\nconst logger = new Logger('alp');\n\nexport interface AlpNodeAppOptions {\n appDirname: string;\n packageDirname: string;\n config: Config & NodeConfig;\n certPath?: string;\n publicPath?: string;\n}\n\ndeclare module 'koa' {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-shadow\n interface DefaultState extends ContextState {}\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n interface DefaultContext extends AlpContext {}\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n interface BaseContext extends AlpContext {}\n // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-shadow\n interface BaseRequest extends ContextRequest {}\n}\n\nexport class AlpNodeApp extends Koa<ContextState> implements NodeApplication {\n dirname: string;\n\n certPath: string;\n\n publicPath: string;\n\n config: NodeConfig & Config;\n\n declare request: BaseRequest & ContextRequest;\n\n _server?: Server;\n\n /**\n * @param {Object} [options]\n * @param {string} [options.certPath] directory of the ssl certificates\n * @param {string} [options.publicPath] directory of public files\n */\n constructor({\n appDirname,\n packageDirname,\n config,\n certPath,\n publicPath,\n }: AlpNodeAppOptions) {\n super();\n\n this.dirname = path.normalize(appDirname);\n\n Object.defineProperty(this, 'packageDirname', {\n get: deprecate(() => packageDirname, 'packageDirname'),\n configurable: false,\n enumerable: false,\n });\n\n this.certPath = certPath || `${packageDirname}/config/cert`;\n this.publicPath = publicPath || `${packageDirname}/public/`;\n\n this.config = _config(this, config);\n this.context.config = this.config;\n\n params(this);\n language(this);\n translate('locales')(this);\n\n this.use(compress());\n }\n\n existsConfigSync(name: string): ReturnType<Config['existsConfigSync']> {\n return this.config.existsConfigSync(name);\n }\n\n loadConfigSync(name: string): ReturnType<Config['loadConfigSync']> {\n return this.config.loadConfigSync(name);\n }\n\n createContext<StateT = DefaultState>(\n req: IncomingMessage,\n res: ServerResponse,\n ): ParameterizedContext<StateT> {\n const ctx = super.createContext<StateT>(req, res);\n ctx.sanitizedState = {} as ContextSanitizedState;\n return ctx;\n }\n\n servePublic(): void {\n this.use(serve(this.publicPath)); // static files\n }\n\n catchErrors(): void {\n this.use(errors);\n }\n\n listen(): Server {\n throw new Error('Use start instead');\n }\n\n /**\n * Close server and emit close event\n */\n close(): void {\n if (this._server) {\n this._server.close();\n this.emit('close');\n }\n }\n\n async start(fn: () => Promise<void> | void): Promise<Server> {\n await fn();\n try {\n const server = await _listen(this.config, this.callback(), this.certPath);\n this._server = server;\n logger.success('started');\n if (process.send) process.send('ready');\n return server;\n } catch (err: unknown) {\n logger.error('start fail', { err });\n throw err;\n }\n }\n}\n\nexport type { Context } from 'koa';\n","import { existsSync, readFileSync } from 'fs';\nimport path from 'path';\nimport { Config } from 'alp-node-config';\nimport { Logger } from 'nightingale-logger';\nimport type { AlpNodeAppOptions } from './AlpNodeApp';\nimport { AlpNodeApp } from './AlpNodeApp';\n\nexport { default as fetch } from 'node-fetch';\n\nexport type { Context } from './AlpNodeApp';\nexport { Config } from 'alp-node-config';\n\nconst logger = new Logger('alp');\n\nexport const appDirname = path.resolve('build');\n\nconst packagePath = path.resolve('package.json');\nif (!packagePath) {\n throw new Error(`Could not find package.json: \"${String(packagePath)}\"`);\n}\nexport const packageDirname = path.dirname(packagePath);\n\nlogger.debug('init', { appDirname, packageDirname });\n\nexport const packageConfig: Record<string, unknown> = JSON.parse(\n readFileSync(packagePath, 'utf-8'),\n) as Record<string, unknown>;\n\nconst buildedConfigPath = `${appDirname}/build/config/`;\nconst configPath = existsSync(buildedConfigPath)\n ? buildedConfigPath\n : `${appDirname}/config/`;\n\nexport const config = new Config(configPath).loadSync({ packageConfig });\n\nexport type AppOptions = Omit<\n AlpNodeAppOptions,\n 'appDirname' | 'packageDirname' | 'config'\n>;\n\nexport default class App extends AlpNodeApp {\n constructor(options?: AppOptions) {\n super({\n ...options,\n appDirname,\n packageDirname,\n config,\n });\n }\n}\n"],"names":["logger","Logger","AlpNodeApp","Koa","constructor","appDirname","packageDirname","config","certPath","publicPath","dirname","path","normalize","Object","defineProperty","get","deprecate","configurable","enumerable","_config","context","params","language","translate","use","compress","existsConfigSync","name","loadConfigSync","createContext","req","res","ctx","sanitizedState","servePublic","serve","catchErrors","errors","listen","Error","close","_server","emit","start","fn","server","_listen","callback","success","process","send","err","error","resolve","packagePath","String","debug","packageConfig","JSON","parse","readFileSync","buildedConfigPath","configPath","existsSync","Config","loadSync","App","options"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAMA,QAAM,GAAG,IAAIC,MAAM,CAAC,KAAK,CAAC,CAAA;AAqBzB,MAAMC,UAAU,SAASC,GAAG,CAA0C;AAa3E;AACF;AACA;AACA;AACA;AACEC,EAAAA,WAAW,CAAC;IACVC,UAAU;IACVC,cAAc;IACdC,MAAM;IACNC,QAAQ;AACRC,IAAAA,UAAAA;AACiB,GAAC,EAAE;AACpB,IAAA,KAAK,EAAE,CAAA;IAEP,IAAI,CAACC,OAAO,GAAGC,IAAI,CAACC,SAAS,CAACP,UAAU,CAAC,CAAA;AAEzCQ,IAAAA,MAAM,CAACC,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE;AAC5CC,MAAAA,GAAG,EAAEC,SAAS,CAAC,MAAMV,cAAc,EAAE,gBAAgB,CAAC;AACtDW,MAAAA,YAAY,EAAE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EAAE;EAChB,MAAM,IAAIf,KAAK,CAAE,CAAA,8BAAA,EAAgCgB,MAAM,CAACD,WAAW,CAAE,CAAA,CAAA,CAAE,CAAC,CAAA;AAC1E,CAAA;AACO,MAAMhD,cAAc,GAAGK,IAAI,CAACD,OAAO,CAAC4C,WAAW,EAAC;AAEvDtD,MAAM,CAACwD,KAAK,CAAC,MAAM,EAAE;EAAEnD,UAAU;AAAEC,EAAAA,cAAAA;AAAe,CAAC,CAAC,CAAA;AAEvCmD,MAAAA,aAAsC,GAAGC,IAAI,CAACC,KAAK,CAC9DC,YAAY,CAACN,WAAW,EAAE,OAAO,CAAC,EACR;AAE5B,MAAMO,iBAAiB,GAAI,CAAExD,EAAAA,UAAW,CAAe,cAAA,CAAA,CAAA;AACvD,MAAMyD,UAAU,GAAGC,UAAU,CAACF,iBAAiB,CAAC,GAC5CA,iBAAiB,GAChB,CAAExD,EAAAA,UAAW,CAAS,QAAA,CAAA,CAAA;AAEpB,MAAME,MAAM,GAAG,IAAIyD,MAAM,CAACF,UAAU,CAAC,CAACG,QAAQ,CAAC;AAAER,EAAAA,aAAAA;AAAc,CAAC,EAAC;AAOzD,MAAMS,GAAG,SAAShE,UAAU,CAAC;EAC1CE,WAAW,CAAC+D,OAAoB,EAAE;AAChC,IAAA,KAAK,CAAC;AACJ,MAAA,GAAGA,OAAO;MACV9D,UAAU;MACVC,cAAc;AACdC,MAAAA,MAAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAA;AACF;;;;"}
1
+ {"version":3,"file":"index-node14.mjs","sources":["../src/AlpNodeApp.ts","../src/index.ts"],"sourcesContent":["import type { IncomingMessage, Server, ServerResponse } from 'http';\nimport path from 'path';\nimport { deprecate } from 'util';\nimport _listen from 'alp-listen';\nimport type { Config } from 'alp-node-config';\nimport _config from 'alp-node-config';\nimport errors from 'alp-node-errors';\nimport language from 'alp-node-language';\nimport params from 'alp-params';\nimport translate from 'alp-translate';\nimport type {\n NodeApplication,\n NodeConfig,\n Context as AlpContext,\n ContextState,\n ContextSanitizedState,\n ContextRequest,\n} from 'alp-types';\nimport Koa from 'koa';\nimport type { ParameterizedContext, DefaultState, BaseRequest } from 'koa';\nimport compress from 'koa-compress';\nimport serve from 'koa-static';\nimport { Logger } from 'nightingale-logger';\n\nconst logger = new Logger('alp');\n\nexport interface AlpNodeAppOptions {\n appDirname: string;\n packageDirname: string;\n config: Config & NodeConfig;\n certPath?: string;\n publicPath?: string;\n}\n\ndeclare module 'koa' {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-shadow\n interface DefaultState extends ContextState {}\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n interface DefaultContext extends AlpContext {}\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n interface BaseContext extends AlpContext {}\n // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-shadow\n interface BaseRequest extends ContextRequest {}\n}\n\nexport class AlpNodeApp extends Koa<ContextState> implements NodeApplication {\n dirname: string;\n\n certPath: string;\n\n publicPath: string;\n\n config: NodeConfig & Config;\n\n declare request: BaseRequest & ContextRequest;\n\n _server?: Server;\n\n /**\n * @param {Object} [options]\n * @param {string} [options.certPath] directory of the ssl certificates\n * @param {string} [options.publicPath] directory of public files\n */\n constructor({\n appDirname,\n packageDirname,\n config,\n certPath,\n publicPath,\n }: AlpNodeAppOptions) {\n super();\n\n this.dirname = path.normalize(appDirname);\n\n Object.defineProperty(this, 'packageDirname', {\n get: deprecate(() => packageDirname, 'packageDirname'),\n configurable: false,\n enumerable: false,\n });\n\n this.certPath = certPath || `${packageDirname}/config/cert`;\n this.publicPath = publicPath || `${packageDirname}/public/`;\n\n this.config = _config(this, config);\n this.context.config = this.config;\n\n params(this);\n language(this);\n translate('locales')(this);\n\n this.use(compress());\n }\n\n existsConfigSync(name: string): ReturnType<Config['existsConfigSync']> {\n return this.config.existsConfigSync(name);\n }\n\n loadConfigSync(name: string): ReturnType<Config['loadConfigSync']> {\n return this.config.loadConfigSync(name);\n }\n\n createContext<StateT = DefaultState>(\n req: IncomingMessage,\n res: ServerResponse,\n ): ParameterizedContext<StateT> {\n const ctx = super.createContext<StateT>(req, res);\n ctx.sanitizedState = {} as ContextSanitizedState;\n return ctx;\n }\n\n servePublic(): void {\n this.use(serve(this.publicPath)); // static files\n }\n\n catchErrors(): void {\n this.use(errors);\n }\n\n listen(): Server {\n throw new Error('Use start instead');\n }\n\n /**\n * Close server and emit close event\n */\n close(): void {\n if (this._server) {\n this._server.close();\n this.emit('close');\n }\n }\n\n async start(fn: () => Promise<void> | void): Promise<Server> {\n await fn();\n try {\n const server = await _listen(this.config, this.callback(), this.certPath);\n this._server = server;\n logger.success('started');\n if (process.send) process.send('ready');\n return server;\n } catch (err: unknown) {\n logger.error('start fail', { err });\n throw err;\n }\n }\n}\n\nexport type { Context } from 'koa';\n","import { existsSync, readFileSync } from 'fs';\nimport path from 'path';\nimport { Config } from 'alp-node-config';\nimport { Logger } from 'nightingale-logger';\nimport type { AlpNodeAppOptions } from './AlpNodeApp';\nimport { AlpNodeApp } from './AlpNodeApp';\n\nexport { default as fetch } from 'node-fetch';\n\nexport type { Context } from './AlpNodeApp';\nexport { Config } from 'alp-node-config';\n\nconst logger = new Logger('alp');\n\nexport const appDirname = path.resolve('build');\n\nconst packagePath = path.resolve('package.json');\nif (!packagePath) {\n throw new Error(`Could not find package.json: \"${String(packagePath)}\"`);\n}\nexport const packageDirname = path.dirname(packagePath);\n\nlogger.debug('init', { appDirname, packageDirname });\n\nexport const packageConfig: Record<string, unknown> = JSON.parse(\n readFileSync(packagePath, 'utf8'),\n) as Record<string, unknown>;\n\nconst buildedConfigPath = `${appDirname}/build/config/`;\nconst configPath = existsSync(buildedConfigPath)\n ? buildedConfigPath\n : `${appDirname}/config/`;\n\nexport const config = new Config(configPath).loadSync({ packageConfig });\n\nexport type AppOptions = Omit<\n AlpNodeAppOptions,\n 'appDirname' | 'packageDirname' | 'config'\n>;\n\nexport default class App extends AlpNodeApp {\n constructor(options?: AppOptions) {\n super({\n ...options,\n appDirname,\n packageDirname,\n config,\n });\n }\n}\n"],"names":["logger","Logger","AlpNodeApp","Koa","constructor","appDirname","packageDirname","config","certPath","publicPath","dirname","path","normalize","Object","defineProperty","get","deprecate","configurable","enumerable","_config","context","params","language","translate","use","compress","existsConfigSync","name","loadConfigSync","createContext","req","res","ctx","sanitizedState","servePublic","serve","catchErrors","errors","listen","Error","close","_server","emit","start","fn","server","_listen","callback","success","process","send","err","error","resolve","packagePath","String","debug","packageConfig","JSON","parse","readFileSync","buildedConfigPath","configPath","existsSync","Config","loadSync","App","options"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAMA,QAAM,GAAG,IAAIC,MAAM,CAAC,KAAK,CAAC,CAAA;AAqBzB,MAAMC,UAAU,SAASC,GAAG,CAA0C;AAa3E;AACF;AACA;AACA;AACA;AACEC,EAAAA,WAAW,CAAC;IACVC,UAAU;IACVC,cAAc;IACdC,MAAM;IACNC,QAAQ;AACRC,IAAAA,UAAAA;AACiB,GAAC,EAAE;AACpB,IAAA,KAAK,EAAE,CAAA;IAEP,IAAI,CAACC,OAAO,GAAGC,IAAI,CAACC,SAAS,CAACP,UAAU,CAAC,CAAA;AAEzCQ,IAAAA,MAAM,CAACC,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE;AAC5CC,MAAAA,GAAG,EAAEC,SAAS,CAAC,MAAMV,cAAc,EAAE,gBAAgB,CAAC;AACtDW,MAAAA,YAAY,EAAE,KAAK;AACnBC,MAAAA,UAAU,EAAE,KAAA;AACd,KAAC,CAAC,CAAA;AAEF,IAAA,IAAI,CAACV,QAAQ,GAAGA,QAAQ,IAAK,CAAA,EAAEF,cAAe,CAAa,YAAA,CAAA,CAAA;AAC3D,IAAA,IAAI,CAACG,UAAU,GAAGA,UAAU,IAAK,CAAA,EAAEH,cAAe,CAAS,QAAA,CAAA,CAAA;IAE3D,IAAI,CAACC,MAAM,GAAGY,OAAO,CAAC,IAAI,EAAEZ,MAAM,CA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AsC,GAAGC,IAAI,CAACC,KAAK,CAC9DC,YAAY,CAACN,WAAW,EAAE,MAAM,CAAC,EACP;AAE5B,MAAMO,iBAAiB,GAAI,CAAExD,EAAAA,UAAW,CAAe,cAAA,CAAA,CAAA;AACvD,MAAMyD,UAAU,GAAGC,UAAU,CAACF,iBAAiB,CAAC,GAC5CA,iBAAiB,GAChB,CAAExD,EAAAA,UAAW,CAAS,QAAA,CAAA,CAAA;AAEpB,MAAME,MAAM,GAAG,IAAIyD,MAAM,CAACF,UAAU,CAAC,CAACG,QAAQ,CAAC;AAAER,EAAAA,aAAAA;AAAc,CAAC,EAAC;AAOzD,MAAMS,GAAG,SAAShE,UAAU,CAAC;EAC1CE,WAAW,CAAC+D,OAAoB,EAAE;AAChC,IAAA,KAAK,CAAC;AACJ,MAAA,GAAGA,OAAO;MACV9D,UAAU;MACVC,cAAc;AACdC,MAAAA,MAAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alp-node",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "framework based on koa 2",
5
5
  "keywords": [
6
6
  "springbokjs",
@@ -64,16 +64,12 @@
64
64
  "build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
65
65
  "build:definitions": "tsc -p tsconfig.build.json",
66
66
  "clean": "yarn clean:build",
67
- "clean:build": "rm -Rf dist",
67
+ "clean:build": "pob-babel-clean-out dist",
68
68
  "lint": "yarn run lint:eslint",
69
69
  "lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/alp-node",
70
70
  "watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
71
71
  },
72
- "prettier": {
73
- "trailingComma": "all",
74
- "singleQuote": true,
75
- "arrowParens": "always"
76
- },
72
+ "prettier": "@pob/root/prettier-config",
77
73
  "pob": {
78
74
  "babelEnvs": [
79
75
  {
@@ -98,12 +94,12 @@
98
94
  "@types/koa": "^2.13.1",
99
95
  "@types/node": ">=14.0.0",
100
96
  "@types/node-fetch": "^3.0.3",
101
- "alp-listen": "5.1.0",
102
- "alp-node-config": "7.1.0",
103
- "alp-node-errors": "6.1.0",
104
- "alp-node-language": "5.2.0",
105
- "alp-params": "4.3.0",
106
- "alp-translate": "6.1.0",
97
+ "alp-listen": "5.1.2",
98
+ "alp-node-config": "7.1.2",
99
+ "alp-node-errors": "6.1.2",
100
+ "alp-node-language": "5.2.2",
101
+ "alp-params": "4.3.2",
102
+ "alp-translate": "6.1.2",
107
103
  "alp-types": "3.1.0",
108
104
  "koa": "^2.13.1",
109
105
  "koa-compress": "^5.0.0",
@@ -112,12 +108,12 @@
112
108
  "node-fetch": "^3.2.0"
113
109
  },
114
110
  "devDependencies": {
115
- "@babel/core": "7.17.10",
111
+ "@babel/core": "7.19.3",
116
112
  "@types/koa-compress": "4.0.3",
117
113
  "@types/koa-static": "4.0.2",
118
114
  "@types/minimist": "1.2.2",
119
- "pob-babel": "34.2.0",
120
- "typescript": "4.6.2"
115
+ "pob-babel": "34.3.0",
116
+ "typescript": "4.8.4"
121
117
  },
122
- "gitHead": "de936d28d0779f271849b412d8a40ade84f22012"
118
+ "gitHead": "e39c7b67a1da463cbec7753aac9e4253b832f0f8"
123
119
  }
@@ -7,12 +7,13 @@
7
7
  "plugins": ["@typescript-eslint"],
8
8
  "extends": [
9
9
  "@pob/eslint-config-typescript",
10
- "@pob/eslint-config-typescript/node"
10
+ "@pob/eslint-config-typescript/node",
11
+ "@pob/eslint-config-typescript-react"
11
12
  ],
12
13
  "ignorePatterns": ["*.d.ts"],
13
14
  "overrides": [
14
15
  {
15
- "files": ["**/*.test.ts", "__tests__/**/*.ts"],
16
+ "files": ["**/*.test.{ts,tsx}", "__tests__/**/*.{ts,tsx}"],
16
17
  "extends": ["@pob/eslint-config-typescript/test"],
17
18
  "env": {
18
19
  "jest": true
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@ export const packageDirname = path.dirname(packagePath);
23
23
  logger.debug('init', { appDirname, packageDirname });
24
24
 
25
25
  export const packageConfig: Record<string, unknown> = JSON.parse(
26
- readFileSync(packagePath, 'utf-8'),
26
+ readFileSync(packagePath, 'utf8'),
27
27
  ) as Record<string, unknown>;
28
28
 
29
29
  const buildedConfigPath = `${appDirname}/build/config/`;
package/rollup.config.mjs DELETED
@@ -1,5 +0,0 @@
1
- import createRollupConfig from 'pob-babel/createRollupConfig.js';
2
-
3
- export default createRollupConfig({
4
- cwd: new URL('.', import.meta.url).pathname,
5
- });
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
-
4
- "compilerOptions": {
5
- "noEmit": true
6
- }
7
- }