forked from electron/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Revert es module (electron#1873)
* chore: fix ci & tests * Revert "chore: update to es module (electron#1869)" This reverts commit db9a401. * Revert "chore: fix ci & tests (electron#1870)" This reverts commit ecb88ce.
- Loading branch information
Showing
31 changed files
with
646 additions
and
8,982 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { _dirname } from './lib/dirname.js' | ||
|
||
const categories = JSON.parse( | ||
fs.readFileSync(path.join(_dirname(import.meta), './meta/categories.json')) | ||
) | ||
|
||
export default categories | ||
module.exports = require('./meta/categories.json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default [ | ||
module.exports = [ | ||
'Books', | ||
'Business', | ||
'Catalogs', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
if (!process.env.GH_TOKEN) { | ||
await import('dotenv-safe/config.js') | ||
require('dotenv-safe').config() | ||
} | ||
|
||
import { Octokit } from '@octokit/rest' | ||
const { Octokit } = require('@octokit/rest') | ||
const github = new Octokit({ | ||
auth: process.env.GH_TOKEN, | ||
}) | ||
|
||
export default github | ||
module.exports = github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
import fs from 'fs' | ||
import yaml from 'js-yaml' | ||
import path from 'path' | ||
import { _dirname } from './dirname.js' | ||
const fs = require('fs') | ||
const path = require('path') | ||
const yaml = require('js-yaml') | ||
|
||
export default fs | ||
.readdirSync(path.join(_dirname(import.meta), '../apps')) | ||
.filter((filename) => { | ||
return fs | ||
.statSync(path.join(_dirname(import.meta), `../apps/${filename}`)) | ||
.isDirectory() | ||
}) | ||
.sort() | ||
.reduce((slugs, slug) => { | ||
const yamlFile = path.join( | ||
_dirname(import.meta), | ||
`../apps/${slug}/${slug}.yml` | ||
) | ||
const meta = yaml.load(fs.readFileSync(yamlFile)) | ||
module.exports = function getSlugs() { | ||
return fs | ||
.readdirSync(path.join(__dirname, '../apps')) | ||
.filter((filename) => { | ||
return fs | ||
.statSync(path.join(__dirname, `../apps/${filename}`)) | ||
.isDirectory() | ||
}) | ||
.sort() | ||
.reduce((slugs, slug) => { | ||
const yamlFile = path.join(__dirname, `../apps/${slug}/${slug}.yml`) | ||
const meta = yaml.load(fs.readFileSync(yamlFile)) | ||
|
||
if (meta.disabled) { | ||
return slugs | ||
} else { | ||
const app = { | ||
slug: slug, | ||
iconPath: path.join( | ||
_dirname(import.meta), | ||
`../apps/${slug}/${slug}-icon.png` | ||
), | ||
...meta, | ||
if (meta.disabled) { | ||
return slugs | ||
} else { | ||
const app = { | ||
slug: slug, | ||
iconPath: path.join(__dirname, `../apps/${slug}/${slug}-icon.png`), | ||
...meta | ||
} | ||
return [...slugs, app] | ||
} | ||
return [...slugs, app] | ||
} | ||
}, []) | ||
|
||
}, []) | ||
} |
Oops, something went wrong.