Skip to content

Commit 9fc4c38

Browse files
committed
Merge branch 'master' into upstream_master
2 parents cde092e + 75112a7 commit 9fc4c38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+541
-201
lines changed

.github/pull.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: "1"
2+
rules: # Array of rules
3+
- base: upstream_master # Required. Target branch
4+
upstream: atom:master # Required. Must be in the same fork network.
5+
mergeMethod: hardreset # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
6+
mergeUnstable: true # Optional, merge pull request even when the mergeable_state is not clean. Default: false
7+
label: ":arrow_heading_down: pull upstream" # Optional

.github/renovate.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"schedule": ["every weekend"],
3+
"labels": ["dependencies"],
4+
"separateMajorMinor": "false",
5+
"packageRules": [
6+
{
7+
"matchDepTypes": ["devDependencies"],
8+
"matchUpdateTypes": ["major", "minor", "patch", "pin", "digest", "lockFileMaintenance", "rollback", "bump"],
9+
"groupName": "devDependencies",
10+
"semanticCommitType": "chore",
11+
"automerge": true
12+
},
13+
{
14+
"matchDepTypes": ["dependencies"],
15+
"matchUpdateTypes": ["major", "minor", "patch", "pin", "digest", "lockFileMaintenance", "rollback", "bump"],
16+
"groupName": "dependencies",
17+
"semanticCommitType": "fix"
18+
}
19+
]
20+
}

.github/workflows/rebase.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on:
2+
issue_comment:
3+
types: [created]
4+
name: Automatic Rebase
5+
jobs:
6+
rebase:
7+
name: Rebase
8+
if: github.event.issue.pull_request != '' && github.event.comment.author_association == 'MEMBER' && contains(github.event.comment.body, '/rebase')
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout the latest code
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Automatic Rebase
16+
uses: cirrus-actions/[email protected]
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

apm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"url": "https://github.com/atom/atom.git"
77
},
88
"dependencies": {
9-
"atom-package-manager": "2.6.2"
9+
"atom-package-manager": "npm:@atom-ide-community/[email protected]"
1010
}
1111
}

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/about/lib/update-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ let UpdateManager = class UpdateManager {
134134

135135
const releaseRepo =
136136
appVersion.indexOf('nightly') > -1 ? 'atom-nightly-releases' : 'atom';
137-
return `https://github.com/atom/${releaseRepo}/releases/tag/${appVersion}`;
137+
return `https://github.com/atom-ide-community/${releaseRepo}/releases/tag/${appVersion}`;
138138
}
139139
};
140140

packages/about/spec/update-manager-spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ describe('UpdateManager', () => {
1616

1717
it('returns the page for the release when not a dev version', () => {
1818
expect(updateManager.getReleaseNotesURLForVersion('1.7.0')).toContain(
19-
'atom/atom/releases/tag/v1.7.0'
19+
'atom-ide-community/atom/releases/tag/v1.7.0'
2020
);
2121
expect(updateManager.getReleaseNotesURLForVersion('v1.7.0')).toContain(
22-
'atom/atom/releases/tag/v1.7.0'
22+
'atom-ide-community/atom/releases/tag/v1.7.0'
2323
);
2424
expect(
2525
updateManager.getReleaseNotesURLForVersion('1.7.0-beta10')
26-
).toContain('atom/atom/releases/tag/v1.7.0-beta10');
26+
).toContain('atom-ide-community/atom/releases/tag/v1.7.0-beta10');
2727
expect(
2828
updateManager.getReleaseNotesURLForVersion('1.7.0-nightly10')
29-
).toContain('atom/atom-nightly-releases/releases/tag/v1.7.0-nightly10');
29+
).toContain(
30+
'atom-ide-community/atom-nightly-releases/releases/tag/v1.7.0-nightly10'
31+
);
3032
});
3133
});
3234
});

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages:
2+
- "."

script/bootstrap

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ const childProcess = require('child_process')
88
const cleanDependencies = require('./lib/clean-dependencies')
99
const deleteMsbuildFromPath = require('./lib/delete-msbuild-from-path')
1010
const dependenciesFingerprint = require('./lib/dependencies-fingerprint')
11-
const installApm = require('./lib/install-apm')
12-
const runApmInstall = require('./lib/run-apm-install')
13-
const installScriptDependencies = require('./lib/install-script-dependencies')
11+
const installScriptRunnerDependencies = require('./lib/install-script-runner-dependencies')
1412
const verifyMachineRequirements = require('./lib/verify-machine-requirements')
1513

1614
process.on('unhandledRejection', function (e) {
@@ -28,22 +26,31 @@ if (!ci && process.env.CI === 'true' && process.argv.indexOf('--no-ci') === -1)
2826

2927
verifyMachineRequirements(ci)
3028

31-
if (dependenciesFingerprint.isOutdated()) {
32-
cleanDependencies()
29+
async function bootstrap() {
30+
if (dependenciesFingerprint.isOutdated()) {
31+
await cleanDependencies()
32+
}
33+
34+
if (process.platform === 'win32') deleteMsbuildFromPath()
35+
36+
installScriptRunnerDependencies()
37+
38+
const { spawn, Thread, Worker } = require(`${CONFIG.scriptRunnerModulesPath}/threads`)
39+
40+
const installScriptDependencies = await spawn(new Worker('./lib/install-script-dependencies'))
41+
const installScriptDependenciesPromise = installScriptDependencies(ci)
42+
43+
const installApm = await spawn(new Worker('./lib/install-apm'))
44+
await installApm(ci);
45+
await Thread.terminate(installApm)
46+
47+
const runApmInstall = require('./lib/run-apm-install')
48+
runApmInstall(CONFIG.repositoryRootPath, ci)
49+
50+
await installScriptDependenciesPromise;
51+
await Thread.terminate(installScriptDependencies)
52+
53+
dependenciesFingerprint.write()
3354
}
3455

35-
if (process.platform === 'win32') deleteMsbuildFromPath()
36-
37-
installScriptDependencies(ci)
38-
installApm(ci)
39-
const apmVersionEnv = Object.assign({}, process.env);
40-
// Set resource path so that apm can load Atom's version.
41-
apmVersionEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath;
42-
childProcess.execFileSync(
43-
CONFIG.getApmBinPath(),
44-
['--version'],
45-
{stdio: 'inherit', env: apmVersionEnv}
46-
)
47-
runApmInstall(CONFIG.repositoryRootPath, ci)
48-
49-
dependenciesFingerprint.write()
56+
bootstrap().then(() => {process.exit(0)}).catch((e) => {throw e;})

script/build

Lines changed: 66 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
'use strict'
44

5+
const CONFIG = require('./config')
6+
57
if (process.argv.includes('--no-bootstrap')) {
68
console.log('Skipping bootstrap')
79
} else {
810
// Bootstrap first to ensure all the dependencies used later in this script
911
// are installed.
10-
require('./bootstrap')
12+
const path = require('path')
13+
const childProcess = require('child_process')
14+
childProcess.execFileSync(process.execPath, [path.join(CONFIG.scriptRootPath, 'bootstrap')], { env: process.env, cwd: CONFIG.repositoryRootPath, stdio: 'inherit' });
1115
}
1216

1317
// Required to load CS files in this build script, such as those in `donna`
@@ -52,47 +56,49 @@ const notarizeOnMac = require('./lib/notarize-on-mac')
5256
const packageApplication = require('./lib/package-application')
5357
const prebuildLessCache = require('./lib/prebuild-less-cache')
5458
const testSignOnMac = require('./lib/test-sign-on-mac')
55-
const transpileBabelPaths = require('./lib/transpile-babel-paths')
56-
const transpileCoffeeScriptPaths = require('./lib/transpile-coffee-script-paths')
57-
const transpileCsonPaths = require('./lib/transpile-cson-paths')
58-
const transpilePegJsPaths = require('./lib/transpile-peg-js-paths')
59-
const transpilePackagesWithCustomTranspilerPaths = require('./lib/transpile-packages-with-custom-transpiler-paths.js')
6059

6160
process.on('unhandledRejection', function (e) {
6261
console.error(e.stack || e)
6362
process.exit(1)
6463
})
6564

66-
const CONFIG = require('./config')
67-
68-
// Used by the 'github' package for Babel configuration
6965
process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion
7066

71-
let binariesPromise = Promise.resolve()
72-
73-
if (!argv.existingBinaries) {
74-
checkChromedriverVersion()
75-
cleanOutputDirectory()
76-
copyAssets()
77-
transpilePackagesWithCustomTranspilerPaths()
78-
transpileBabelPaths()
79-
transpileCoffeeScriptPaths()
80-
transpileCsonPaths()
81-
transpilePegJsPaths()
82-
generateModuleCache()
83-
prebuildLessCache()
84-
generateMetadata()
85-
generateAPIDocs()
86-
if (!argv.generateApiDocs) {
87-
binariesPromise = dumpSymbols()
88-
}
67+
async function transpile() {
68+
const { spawn, Thread, Worker } = require(`${CONFIG.scriptRunnerModulesPath}/threads`)
69+
70+
const transpilePackagesWithCustomTranspilerPaths = await spawn(new Worker('./lib/transpile-packages-with-custom-transpiler-paths'))
71+
const transpilePackagesWithCustomTranspilerPathsPromise = transpilePackagesWithCustomTranspilerPaths()
72+
73+
const transpileBabelPaths = await spawn(new Worker('./lib/transpile-babel-paths'))
74+
const transpileBabelPathsPromise = transpileBabelPaths()
75+
76+
const transpileCoffeeScriptPaths = await spawn(new Worker('./lib/transpile-coffee-script-paths'))
77+
const transpileCoffeeScriptPathsPromise = transpileCoffeeScriptPaths()
78+
79+
const transpileCsonPaths = await spawn(new Worker('./lib/transpile-cson-paths'))
80+
const transpileCsonPathsPromise = transpileCsonPaths()
81+
82+
const transpilePegJsPaths = await spawn(new Worker('./lib/transpile-peg-js-paths'))
83+
const transpilePegJsPathsPromise = transpilePegJsPaths()
84+
85+
await transpilePackagesWithCustomTranspilerPathsPromise;
86+
await Thread.terminate(transpilePackagesWithCustomTranspilerPaths)
87+
88+
await transpileBabelPathsPromise;
89+
await Thread.terminate(transpileBabelPaths)
90+
91+
await transpileCoffeeScriptPathsPromise;
92+
await Thread.terminate(transpileCoffeeScriptPaths)
93+
94+
await transpileCsonPathsPromise;
95+
await Thread.terminate(transpileCsonPaths)
96+
97+
await transpilePegJsPathsPromise;
98+
await Thread.terminate(transpilePegJsPaths)
8999
}
90100

91-
if (!argv.generateApiDocs) {
92-
binariesPromise
93-
.then(packageApplication)
94-
.then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
95-
.then(async packagedAppPath => {
101+
async function singAndCreateInstaller(packagedAppPath) {
96102
switch (process.platform) {
97103
case 'darwin': {
98104
if (argv.codeSign) {
@@ -147,7 +153,29 @@ if (!argv.generateApiDocs) {
147153
}
148154

149155
return Promise.resolve(packagedAppPath)
150-
}).then(packagedAppPath => {
156+
}
157+
158+
159+
async function build() {
160+
161+
if (!argv.existingBinaries) {
162+
checkChromedriverVersion()
163+
await cleanOutputDirectory()
164+
await copyAssets()
165+
await transpile()
166+
generateModuleCache()
167+
prebuildLessCache()
168+
generateMetadata()
169+
generateAPIDocs()
170+
if (!argv.generateApiDocs) {
171+
await dumpSymbols()
172+
}
173+
}
174+
175+
if (!argv.generateApiDocs) {
176+
const packagedAppPath = await packageApplication()
177+
await generateStartupSnapshot(packagedAppPath)
178+
await singAndCreateInstaller(packagedAppPath)
151179
if (argv.compressArtifacts) {
152180
compressArtifacts(packagedAppPath)
153181
} else {
@@ -159,5 +187,9 @@ if (!argv.generateApiDocs) {
159187
} else {
160188
console.log('Skipping installation. Specify the --install option to install Atom'.gray)
161189
}
162-
})
190+
}
191+
163192
}
193+
194+
195+
build().then(() => {process.exit(0)}).catch((e) => {throw e;})

script/clean

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ const cleanDependencies = require('./lib/clean-dependencies')
77
const cleanOutputDirectory = require('./lib/clean-output-directory')
88
const killRunningAtomInstances = require('./lib/kill-running-atom-instances')
99

10-
killRunningAtomInstances()
11-
cleanDependencies()
12-
cleanCaches()
13-
cleanOutputDirectory()
10+
async function clean() {
11+
killRunningAtomInstances()
12+
return Promise.all([
13+
cleanDependencies(),
14+
cleanCaches(),
15+
cleanOutputDirectory()
16+
])
17+
}
18+
19+
clean().then(() => {process.exit(0)}).catch((e) => {throw e;})

script/config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const spawnSync = require('./lib/spawn-sync');
1010
const repositoryRootPath = path.resolve(__dirname, '..');
1111
const apmRootPath = path.join(repositoryRootPath, 'apm');
1212
const scriptRootPath = path.join(repositoryRootPath, 'script');
13+
const scriptRunnerRootPath = path.join(scriptRootPath, 'script-runner');
14+
const scriptRunnerModulesPath = path.join(scriptRunnerRootPath, 'node_modules');
1315
const buildOutputPath = path.join(repositoryRootPath, 'out');
1416
const docsOutputPath = path.join(repositoryRootPath, 'docs', 'output');
1517
const intermediateAppPath = path.join(buildOutputPath, 'app');
@@ -35,6 +37,11 @@ if (process.env.npm_config_jobs === undefined) {
3537
process.env.npm_config_jobs = 'max';
3638
}
3739

40+
const REPO_OWNER = process.env.REPO_OWNER || 'atom';
41+
const MAIN_REPO = process.env.MAIN_REPO || 'atom';
42+
const NIGHTLY_RELEASE_REPO =
43+
process.env.NIGHTLY_RELEASE_REPO || 'atom-nightly-releases';
44+
3845
module.exports = {
3946
appMetadata,
4047
apmMetadata,
@@ -46,6 +53,8 @@ module.exports = {
4653
repositoryRootPath,
4754
apmRootPath,
4855
scriptRootPath,
56+
scriptRunnerRootPath,
57+
scriptRunnerModulesPath,
4958
buildOutputPath,
5059
docsOutputPath,
5160
intermediateAppPath,
@@ -55,7 +64,10 @@ module.exports = {
5564
homeDirPath,
5665
getApmBinPath,
5766
getNpmBinPath,
58-
snapshotAuxiliaryData: {}
67+
snapshotAuxiliaryData: {},
68+
REPO_OWNER,
69+
MAIN_REPO,
70+
NIGHTLY_RELEASE_REPO
5971
};
6072

6173
function getChannelName(channel) {

script/lib/clean-caches.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ module.exports = function() {
2020
path.join(os.tmpdir(), 'atom-build'),
2121
path.join(os.tmpdir(), 'atom-cached-atom-shells')
2222
];
23-
23+
const rmPromises = [];
2424
for (let path of cachePaths) {
2525
console.log(`Cleaning ${path}`);
26-
fs.removeSync(path);
26+
rmPromises.push(fs.remove(path));
2727
}
28+
29+
return Promise.all(rmPromises);
2830
};

0 commit comments

Comments
 (0)