brasil-ceps-offline 1.0.1 → 1.0.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.
@@ -9,8 +9,10 @@ const path_1 = __importDefault(require("path"));
9
9
  const zlib_1 = __importDefault(require("zlib"));
10
10
  // Substitua pelo link direto que você copiou do seu GitHub Releases
11
11
  const URL_DO_BANCO = 'https://github.com/kaique-oliveira/lib-address-br/releases/download/v1.0.0/brasil-ceps.sqlite.gz';
12
- const DB_DIR = path_1.default.join(__dirname, '..', '.db');
13
- const DB_PATH = path_1.default.join(DB_DIR, 'brasil-ceps.sqlite');
12
+ // Subimos DOIS níveis (de dist/scripts -> dist -> raiz) para criar a pasta no lugar certo
13
+ const DB_DIR = path_1.default.join(__dirname, '..', '..', '.db');
14
+ // Ajustamos o nome para casar exatamente com o que a lib está procurando
15
+ const DB_PATH = path_1.default.join(DB_DIR, 'ceps.sqlite');
14
16
  function downloadDatabase() {
15
17
  if (!fs_1.default.existsSync(DB_DIR)) {
16
18
  fs_1.default.mkdirSync(DB_DIR, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brasil-ceps-offline",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Busca rápida de CEPs brasileiros com zero latência de rede - dados off-line usando SQLite",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",